austinjones / tab-rs

The intuitive, config-driven terminal multiplexer designed for software & systems engineers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Removing the tab binary after an upgrade breaks the running tab daemon

userxfce opened this issue · comments

under xubuntu 20.04 terminal (bash, also rxvt, gnome-terminal), "tab foo" hangs

workaround: removing ~/.tab/ and reinstalling via "tab --install all" solves it

Hi @userxfce,
Thanks for all the bug reports! This one is really interesting - and I saw it once when I ran 'cargo uninstall' and then 'brew install'. I think what happened here is the v0.3.7 tab binary was removed. The daemon re-launches it's own executable to spawn PTY processes, and if the tab binary is removed it can't do this.

Removing the ~/.tab directory was what fixed it - because it removed the daemon pidfile. You can also use tab --shutdown after installing a new version to trigger a complete shutdown of the daemon and all PTY processes.

I think there are a few things that can be improved here:

  • Add documentation that tab --shutdown is recommended after upgrades.
  • Print a warning if the daemon binary and the command-line binary are not the same, and suggest tab --shutdown.
  • Print a stronger warning (or refuse to connect) if there are breaking API changes between the command-line and daemon binaries.

I also have an item on the backlog (#44) to shut down the daemon when the tab binary changes, but I've been holding off on implementing it because I'm worried about conflicting installations (e.g. both cargo and homebrew) causing weird behavior with daemon shutdowns.

The tab daemon should monitor it's own executable, as well as the tab runtime directory. If the file doesn't exist, it should trigger a global shutdown.

In 0.4.0, there are incompatibility warnings for two cases (added in #180).

  • If the tab daemon was launched from a different executable file path than the tab client
  • If the tab daemon is on a different non-patch version than the tab client (e.g. 0.3.X vs 0.4.X)

Both warning messages recommend tab --shutdown.

I decided against auto-shutdown if the tab executable is removed because existing tabs still work in this case - and those tabs may have local servers, ssh sessions, etc.

After having run "tab --install all", and then "tab -shutdown", now running "tab" no longer hangs.
I think this should be closed.

Closing, v0.4.0 is released!