justinmk / vim-gtfo

Go to Terminal or File manager :point_right:
319 stars 17 forks source link

gof does not work in WSL #60

Open hrai opened 1 year ago

hrai commented 1 year ago

gof does not open anything in WSL but got opens a terminal.

This is on windows 10 host and Ubuntu 22.x WSL

Konfekt commented 4 months ago

Did you try

if executable('pwsh.exe') " Win32 or WSL
  let s:pwsh = 'pwsh.exe -NoExit -NoLogo -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;'
  let g:gtfo#terminals = { 'win': s:pwsh, 'unix': s:pwsh }
  unlet s:pwsh
endif

?

Konfekt commented 4 months ago

Maybe in

https://github.com/justinmk/vim-gtfo/blob/7d5318ecbf2455ea9a82866359f8e41195469215/autoload/gtfo/open.vim#L176

gtfo is too smart to make pwsh work, since only pwsh.exe is executable, not pwsh