Search found 11 matches

by jo.navy
Wed 30 Jan, 2019 17:18
Forum: Support and Troubleshooting
Topic: Keep new window open after execution of a command with Shift-Enter
Replies: 20
Views: 4718

Keep new window open after execution of a command with Shift-Enter

I handled two other corner cases: disabled the macro in plugin panels and when ShiftEnter is pressed on a folder; I also avoided "hitting" ShiftEnter instead of Enter to execute the "start" command. The final logic with indentation is: %s="start \"%COMSPEC%\" "; $If(CmdLine.Empty) $If (APanel.Folder...
by jo.navy
Mon 28 Jan, 2019 17:47
Forum: Support and Troubleshooting
Topic: Keep new window open after execution of a command with Shift-Enter
Replies: 20
Views: 4718

Keep new window open after execution of a command with Shift-Enter

the start "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Far Manager 3\Far Manager 3.lnk" command doesn't start FAR Yes, it doesn't start Far because the file name contains spaces so Far Manager must add quotes to it and quotes are used by the start command for the window title too. Using st...
by jo.navy
Mon 28 Jan, 2019 17:17
Forum: Support and Troubleshooting
Topic: Keep new window open after execution of a command with Shift-Enter
Replies: 20
Views: 4718

Keep new window open after execution of a command with Shift-Enter

I'd recommend adding empty double quotes as start's first argument — it fixes at least starting .lnk shortcut files for me. Yes, more precisely it fixes any ShiftEnter over a file or directory containing spaces. I've found a vague reference to this fact here . Since start's first argument is the ti...
by jo.navy
Mon 28 Jan, 2019 15:51
Forum: Support and Troubleshooting
Topic: Keep new window open after execution of a command with Shift-Enter
Replies: 20
Views: 4718

Keep new window open after execution of a command with Shift-Enter

Further improvement: replaced %COMSPEC% /k with start . Result is: "Sequence"="%e = CmdLine.Empty; %s=\"start \"; %i=index(CmdLine.Value, %s); $If(%i != 0) CtrlHome $Text %s $End $If(%e) CtrlEnter $End ShiftEnter" In this way if I shift-enter over a RAR file (for example) I get the WinRAR window onl...
by jo.navy
Mon 28 Jan, 2019 15:04
Forum: Support and Troubleshooting
Topic: Keep new window open after execution of a command with Shift-Enter
Replies: 20
Views: 4718

Keep new window open after execution of a command with Shift-Enter

Minor improvement of HaRT's solution: "Sequence"="%e = CmdLine.Empty; %cs=\"%COMSPEC% /k \"; %i=index(CmdLine.Value, %cs); $If(%i != 0) CtrlHome $Text %cs $End $If(%e) CtrlEnter $End ShiftEnter" In this way if I recall a "ShiftEnter-ed" command from history and hit ShiftEnter again I don't get two %...
by jo.navy
Mon 28 Jan, 2019 14:28
Forum: Support and Troubleshooting
Topic: Keep new window open after execution of a command with Shift-Enter
Replies: 20
Views: 4718

Keep new window open after execution of a command with Shift-Enter

HaRT wrote:
Mon 28 Jan, 2019 13:22
"Sequence"="%e = CmdLine.Empty; CtrlHome $Text \"%COMSPEC% /k \" $If(%e) CtrlEnter $End ShiftEnter"
Great! It works. The only drawback is that %COMSPEC% /k appears in the command history but it is acceptable.
by jo.navy
Mon 28 Jan, 2019 13:06
Forum: Support and Troubleshooting
Topic: Keep new window open after execution of a command with Shift-Enter
Replies: 20
Views: 4718

Keep new window open after execution of a command with Shift-Enter

The case when command line is empty is handled by flags="NotEmptyCommandLine" - reread the macro. But it means that your macro has no effect when the command line is empty (right?), on the contrary the file selected in active panel should be runned with cmd.exe /k so that the window remains open in...
by jo.navy
Mon 28 Jan, 2019 13:03
Forum: Support and Troubleshooting
Topic: Keep new window open after execution of a command with Shift-Enter
Replies: 20
Views: 4718

Keep new window open after execution of a command with Shift-Enter

After Shmuel's Far3 example I have tried also the following: REGEDIT4 [-HKEY_CURRENT_USER\Software\Far\KeyMacros\Shell\ShiftEnter] [HKEY_CURRENT_USER\Software\Far\KeyMacros\Shell\ShiftEnter] "Sequence"="$If (!CmdLine.Empty) CmdLine.Value =\"%COMSPEC% /k \" + CmdLine.Value; $End ShiftEnter" "DisableO...
by jo.navy
Mon 28 Jan, 2019 12:55
Forum: Support and Troubleshooting
Topic: Keep new window open after execution of a command with Shift-Enter
Replies: 20
Views: 4718

Keep new window open after execution of a command with Shift-Enter

Shmuel wrote:
Mon 28 Jan, 2019 12:03
panel.SetCmdLine(nil, "cmd.exe /k "..panel.GetCmdLine())
Thank you, Shmuel. Is panel.SetCmdLine available in v1.75 too? I don't see it in "Far Manager Encyclopedia" provided with v1.75.
And what about the case the command line is empty? It's not considered by your script.
by jo.navy
Mon 28 Jan, 2019 12:46
Forum: Support and Troubleshooting
Topic: Keep new window open after execution of a command with Shift-Enter
Replies: 20
Views: 4718

Keep new window open after execution of a command with Shift-Enter

Yes, I was already examining the docs about macros and available examples. I also created a simple macro recently. I know that I can get the content of the command line with CmdLine.Value and I how to hit "hit" Enter, but I'm not sure about the syntax to prepend CmdLine.Value with cmd.exe /k ; furth...
by jo.navy
Mon 28 Jan, 2019 10:43
Forum: Support and Troubleshooting
Topic: Keep new window open after execution of a command with Shift-Enter
Replies: 20
Views: 4718

Keep new window open after execution of a command with Shift-Enter

When I execute a command from the command line with Shift-Enter I would like to keep the new console window open after the command terminates its execution. I use Shift-Enter, for example, when i run a build from the command line so I need to examine the output to check for build errors. Keeping the...

Go to advanced search