romkatv / gitstatus

Git status for Bash and Zsh prompt
GNU General Public License v3.0
1.7k stars 105 forks source link

Spawned gitstatus under ZSH is unparented from the "owning" shell #288

Closed whisperity closed 2 years ago

whisperity commented 2 years ago

When a new shell is created, the GitStatus daemon is running in a way that it is not the child of the shell that it is, otherwise, attached to.

If I spawn a new shell, and run a command like htop in it, there will be the shell that is running the foreground program, and detached from it, and reparented to init, another copy of the same shell binary, with gitstatusd running under it. This makes it visually hard to recognise when multiple shells are running what is tied to what, because the commandline of gitstatusd shows no PIDs of its actual "parent".

Here's an example of the situation in Docker (for brevity, as it will only show the interesting processes), but the issue is there when running outside of Docker (but I couldn't make a good screenshot of that because there are a bunch of processes running):

Screenshot_20211223_134849

Running environment

Expected behaviour

The gitstatusd is running attached to the shell it is running for. OR there is only ONE gitstatusd spawned for my user (or user+shell combo, something like that).

romkatv commented 2 years ago

The gitstatusd is running attached to the shell it is running for.

This causes a warning in some terminals when you close them.

OR there is only ONE gitstatusd spawned for my user (or user+shell combo, something like that).

This makes updates harder and, requires significant changes in gitstatusd, and might make it impossible to implement efficient bash bindings (I'm not sure about the latter).

If you need to know the PID of gitstatusd, it's $GITSTATUS_DAEMON_PID_POWERLEVEL9K.