Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'&' will cause an error when using got or goT on Windows Powershell #48

Open
FabriceLuo opened this issue Apr 5, 2019 · 3 comments
Open
Labels

Comments

@FabriceLuo
Copy link

let cdcmd = (''==#drive?'':drive.' & ').'cd '.shellescape(l:dir, 1)

'&' can be used in cmd, but is reserved in powershell and will cause an error when used in powershell. The '-and' connection command should be used in powershell.

@FabriceLuo
Copy link
Author

When changing '&' to '-and', got and goT work fine

@justinmk
Copy link
Owner

justinmk commented Apr 9, 2019

Are you setting g:gtfo#terminals ? Please mention that.

What is the full value of your 'shell' and $COMSPEC?

:put =&shell
:put =$COMSPEC

I assume you are hitting this line:

silent exe '!start '.s:termpath.' "'.cdcmd.'"'

for which s:force_cmdexe() does not apply.

@justinmk justinmk added the bug label Apr 9, 2019
@FabriceLuo
Copy link
Author

The vimrc for gtfo:
" for gtfo
let g:gtfo#terminals = { 'win': 'powershell -NoLogo -NoExit -Command'}

Add debug echom to open.vim:
161:echom "shell:" . &shell
162:echom "COMSPEC:" . $COMSPEC
163:echom "cdcmd:" . cdcmd

The debug output:
shell:C:\Windows\system32\cmd.exe
COMSPEC:C:\Windows\system32\cmd.exe
cdcmd:C: & cd "C:\Users\luominghao\vimfiles\plugged\vim-gtfo\autoload\gtfo"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants