coc-extensions / coc-powershell

PowerShellEditorService integration for coc.vim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Close shell window when last powershell script is closed

n3wjack opened this issue · comments

I often close my PS script using :q, but then the shell remains, and I have to close gvim manually to get rid of it.
Even worse, if I'm using vim from the command line, I can't exit it (typical vim problem I know) because there seems to be no way to close the shell (exit doesn't work).

So it would be handy if in this case, the shell would automatically close.

Unless there's some way to close the shell that I don't know about.

I don't know if it's what's happening, but I've found that the terminal in n/vim is difficult to get out of because doesn't exit insert mode. There is a different key by default: https://vi.stackexchange.com/questions/4919/exit-from-terminal-mode-in-neovim-vim-8 When you're out of insert mode, but still focused on the terminal buffer, :q should quit the buffer. Of course if you're looking to completely leave n/vim then :qa from anywhere in Normal Mode should also close the PowerShell terminal.

That SO answer didn't work for me, but it did point me to the help where it states that CTRL-W can be used to enter command mode, so you're able to enter :quit! to quit the terminal session.
CTRL-W can also be used in combination with the movement keys jklm to jump out of the terminal window, as alt-tab doesn't work to jump between windows.