fmoralesc / neovim-gnome-terminal-wrapper

Wrapper for running neovim in a separate instance of gnome-terminal
129 stars 21 forks source link

Accidental press of Ctrl+Z leads to unrecoverable state #16

Open synaptiko opened 8 years ago

synaptiko commented 8 years ago

I've just ran into an issue that I'm not able to recover neovim's session when accidentally pressing Ctrl+Z. When I'm in terminal it's just ok but because wrapper is running directly nvim process it leads to this strange situation (starring at blank screen and trying to figure out what just happened).

Do you have any idea if it's solvable somehow?

It doesn't happen often but if it happens it's quite frustrating, especially if you have several unsaved buffers "locked" inside.

fmoralesc commented 8 years ago

Gotcha; I hadn't noticed because I have <C-z> mapped to ]se anyway...

I don't think it's possible to make the behaviour more consistent without running the nvim process within a wrapped shell... which sounds ugly, and I don't think I'll endorse. I wonder what do proper neovim GUIs like neovim-qt do in this case...

A workaround would be to map <C-z> to <nop> when nvim is launched with the wrapper.

synaptiko commented 8 years ago

Ok, I'll use the workaround in combination with env variable to detect it's running in wrapper for now, thanks :-)

andreiple commented 5 years ago

Workaround without using env variable:

if expand('`ps -p $(ps -o ppid= -p '.getpid().') -o comm=`') ==# 'gnome-terminal-'
noremap <C-z> <nop>
endif