baskerville / sxhkd

Simple X hotkey daemon
BSD 2-Clause "Simplified" License
2.79k stars 139 forks source link

st crashes after opening nvim if st is opened with sxhkd key bind #215

Closed shahzebs closed 3 years ago

shahzebs commented 4 years ago

If sxhkd is not already running, executing :!sxhkd & from within nvim causes st to crash when trying to run nvim in a new st window if that window was opened using a sxhkd key bind. If I open the st window using a launcher like dmenu or from an existing terminal, executing nvim in that new window works just fine.

This issue only appears if I execute sxhkd from within nvim (vim works fine) and with my terminal emulator st. So the issue seems to mostly be related to st, then sxhkd and lastly nvim. All three are relevant because only st crashes (kitty works fine), a crash only occurs when opening st using a sxhkd key bind and nvim seems to be the only program inducing the crash.

If nvim is causing st to crash and I run vim (v8.2), from any terminal (tested both st and kitty) opened with sxhkd, it gives me this error:

Error detected while processing /usr/share/nvim/runtime/plugin/rplugin.vim[65]..function <SNR>27_LoadRemotePlugins[1]..<SNR>27_GetManifest[1]..<SNR>27_GetManifestPath:
line    7:
E117: Unknown function: stdpath

and opens fine. The error does not appear normally. I haven't found any other program that does this. It doesn't seem to matter which vimrc I use. Even a new, empty one causes this. So does nvim -u NONE. The only way to fix this is to kill the sxhkd process started from nvim and create a new process from a terminal.

shahzebs commented 3 years ago

This is a an issue with vim's :h :!. See this issue for a workaround: https://github.com/neovim/neovim/issues/13198#issuecomment-727138178