Prevent inspecting a process that doesn't exist #123
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 👍