Closed Jaehaks closed 3 months ago
I'm windows user and use cmd prompt for shell. I tested simple code to check
ls -remote
works properly with this codecmd z ${{ lf -remote "send %id% echo test" }}
But it just blinks the
lf
and doesn't work anything
You can't use multiline commands (i.e. {{ ... }}
) for Windows CMD, see https://github.com/gokcehan/lf/wiki/Troubleshoot#multiline-shell-commands-dont-work-on-windows
If you use only a single line like below, then that should work:
cmd z %lf -remote "send %id% echo test"
I also recommend to use %
(shell-pipe) instead of $
(shell), which will write the output to the status line at the bottom, otherwise you won't be able to see the output until you quit lf
.
I tested with powershell version 7.4.4 as wiki said buf After I write
set shellflag "-cwa"
in lfrc, other functions doesn't work. (all functions open new cmd prompt)set shellflag "-cwa" cmd z ${{ lf -remote "send $env:id echo test" }}
Did you also configure the shell
to use PowerShell instead of Windows CMD?
set shell pwsh
@joelim-work
You can't use multiline commands (i.e. {{ ... }}) for Windows CMD, see https://github.com/gokcehan/lf/wiki/Troubleshoot#multiline-shell-commands-dont-work-on-windows
I didn't recognize the Troubleshoot document Thank you for your reply.
set shell pwsh
It misunderstand it is automatic. I'll try it
I add like this to use zoxide integration with cmd and it works, Thanks @joelim-work
I'm using set shell cmd
lfrc
## -- command - zoxide
cmd z &%LF_CONFIG_HOME%\lf\lf_z.bat
cmd zi $%LF_CONFIG_HOME%\lf\lf_zi.bat
lf_z.bat
@echo off
setlocal enabledelayedexpansion
chcp 65001 > nul 2>&1
for /F "usebackq tokens=*" %%a in (`zoxide query --exclude "%cd%" %*`) do (
set z_dir=%%a
set "z_dir=!z_dir:\=\\!"
lf -remote "send %id% cd '!z_dir!'"
)
endlocal
lf_zi.bat
@echo off
setlocal enabledelayedexpansion
chcp 65001 > nul 2>&1
for /F "usebackq tokens=*" %%a in (`zoxide query -i --exclude "%cd%" %*`) do (
set z_dir=%%a
set "z_dir=!z_dir:\=\\!"
lf -remote "send %id% cd '!z_dir!'"
)
endlocal
Thank you for your efforts
I'm windows user and use cmd prompt for shell. I tested simple code to check
ls -remote
works properly with this codeBut it just blinks the
lf
and doesn't work anythingI tested with powershell version 7.4.4 as wiki said buf After I write
set shellflag "-cwa"
in lfrc, other functions doesn't work. (all functions open new cmd prompt)What I missed?