redrawing the screen after subcommand Topic is solved

You have encountered a problem using Far macros? Here you can get help.
Post Reply
tquest1234
Posts: 6
Joined: Fri 17 Apr, 2020 07:34
Has thanked: 1 time

redrawing the screen after subcommand

Post by tquest1234 »

Hello, I would like to use the tool fzf, I have the windows binary in my %PATH% and it works great.

(I'm not allowed to post links, but google for fzf github)

So I want a macro to call it from far. This almost works:

Code: Select all

Macro {
    description="Fuzzy Find";
    area="Shell";
    key="CtrlF12";
    action=function()
        local restore = win.GetCurrentDir()

        win.SetCurrentDir(APanel.UNCPath)

        local dir = io.popen("fzf"):read()

        win.SetCurrentDir(restore)
        mf.print(dir)                   
    end;                                                        
}
But it can leave the console messed up, I've tried far.AdvControl("ACTL_REDRAWALL"), but nothing happens. Any ideas?
Shmuel
Posts: 6167
Joined: Thu 23 Mar, 2006 21:36
Location: Israel
Has thanked: 31 times
Been thanked: 330 times

redrawing the screen after subcommand

Post by Shmuel »

Try to call panel.GetUserScreen() before and panel.SetUserScreen() after calling fzf.
tquest1234
Posts: 6
Joined: Fri 17 Apr, 2020 07:34
Has thanked: 1 time

redrawing the screen after subcommand

Post by tquest1234 »

Whoa, thank you so much! That works perfectly!
Post Reply

Return to “Support and Troubleshooting”