Cmdline far:new ?

Something is missing in Far Manager? You have a great idea that should be heard? Write here.
Post Reply
Duhaczek2
Posts: 2
Joined: Wed 02 Jan, 2019 12:02

Cmdline far:new ?

Post by Duhaczek2 » Wed 02 Jan, 2019 12:07

Command "far:new" could create new instance of FarManager (panels in same locations as original instance)...

KlepetoX
Posts: 115
Joined: Sun 08 Jan, 2012 08:23
Location: Czech Republic

Cmdline far:new ?

Post by KlepetoX » Wed 02 Jan, 2019 15:54

That would be great feature. I used macro for this reason, but it is not perfect. Cursor position and plugin panels (except of ArcLite) are ignored...

It uses ConEmu, but you can make small change to run Far.exe directly.

Code: Select all

Macro {
  key		="CtrlAltO";
  area		="Common";
  description	="Clone Far";
  action=function()
    local FarName=win.GetEnv("FARHOME").."\\far.exe"
    local ConemuName=win.GetEnv("FARHOME").."\\conemu.exe"
    local FarLeft,FarRight

    if APanel.Left then FarLeft=APanel.Path FarRight=PPanel.Path end
    if PPanel.Left then FarLeft=PPanel.Path FarRight=APanel.Path end

    if     APanel.Left and APanel.Prefix=='arc' then FarLeft ='arc:'..APanel.HostFile end
    if not APanel.Left and APanel.Prefix=='arc' then FarRight='arc:'..APanel.HostFile end
    if     PPanel.Left and PPanel.Prefix=='arc' then FarLeft ='arc:'..PPanel.HostFile end
    if not PPanel.Left and PPanel.Prefix=='arc' then FarRight='arc:'..PPanel.HostFile end

    if FarLeft =='' then FarLeft ='c:' end
    if FarRight=='' then FarRight='c:' end

    local Text='""'..FarName..'" "'..FarLeft..'" "'..FarRight..'""'

    win.ShellExecute(nil,nil,ConemuName,'-run '..Text,nil,nil)
  end;
}

Post Reply

Return to “Suggestions and Ideas”