MordechaiHadad / bob

A version manager for neovim
MIT License
1.41k stars 36 forks source link

bug: terminates on usr1 signal #209

Closed sarmong closed 3 months ago

sarmong commented 4 months ago

Neovim supports Signal autocommand. However, when the signal is sent to the neovim instance installed with bob, neovim terminates with 138.

This doesn't happen when neovim is built from source, or via official appimage.

To reproduce:

  1. bob use latest (the same with nightly)
  2. kill -USR1 $(pgrep nvim)
  3. nvim terminates and the terminal is messed up

Happens on Debian 12

MordechaiHadad commented 4 months ago

Yes it's a problem with bob itself (maybe rust doesn't handle SIGUSR1). I will look into this but might take a while since Rust doesn't kill subprocesses with SIGTERM which will take some time to figure out unless I used a bit dep like nix crate.

Side note: for windows users there isn't really anything to do regarding this since windows TerminateProcess is not something that can be caught and handled.

MordechaiHadad commented 3 months ago

@sarmong Could you test the PR?

sarmong commented 3 months ago

Neovim still terminates, however now the terminal (or is it shell) is not messed up after termination

MordechaiHadad commented 3 months ago

It is meant to terminate, so it works.

sarmong commented 3 months ago

No, it is not. This is USR1 signal, not INT. Any other version version of nvim (from source, .deb, .appimage) doesn't terminate.

MordechaiHadad commented 3 months ago

Oh, I thought the expected behavior was not the fucked up terminal which was caused by SIGKILL so I simply changed it to SIGTERM, is the expected behavior is to keep working basically?

sarmong commented 3 months ago

Yes. Neovim can catch USR1 via Signal autocommand, but it is not possible when opening bob version of neovim.

MordechaiHadad commented 3 months ago

Updated the PR let me know if this is the behavior u expected. (cant really test this, since I am on windows)

sarmong commented 3 months ago

Works properly now, thanks!