Open joao-p-marques opened 2 years ago
@peng1999 you wrote the original code. Do you understand why this is happening? Is tmux not being found and is the while loop running all the way until the end where pid = 0 ?
@joao-p-marques is there any chance that you are/were launching tmux with another path in the params? e.g.
/usr/bin/tmux new-session -c /some/start/dir
Asking to understand if this error might be fixed by https://github.com/franciscolourenco/done/pull/124
@joao-p-marques have you experienced this problem with the latest version?
Sometimes, the
__done_is_tmux_window_active
function will try to access the root process (PID 1
). It is happening to me usingbyobu
(tmux
). When that happens(tmux_fish_pid=1
),ps -o ppid= -p $tmux_fish_pid | string trim
will return0
, causing a failure when we accessbasename (ps -o command= -p $tmux_fish_ppid)
To ensure we don't get ugly errors if that is the case, we can check it we reached that case before checking the process'basename
.There might be a better solution, this is just a quick fix, so if someone with better
fish
skills has a better suggestion, I am open to changes :+1: