Closed bluz71 closed 1 year ago
I think this is fixed by https://github.com/lincheney/fzf-tab-completion/commit/7de33435821237aaaeec79137bb9d407fa5a17cb if you are able to test
Issue is caused by fzf-tab-completion (although on the flip side, it is gitstatus that is doing the exiting of the terminal; it could be a bit more fault tolerant)
Hello @lincheney,
I just tested your fix, and yes the issue is now fixed.
I am very grateful indeed; thank you very much.
Issue is caused by fzf-tab-completion (although on the flip side, it is gitstatus that is doing the exiting of the terminal; it could be a bit more fault tolerant)
I created this gitstatus issue but the author had no interest in debugging the issue.
All good now, I can use both gitstatus
and fzf-tab-completion
at the same time.
Regards.
it is gitstatus that is doing the exiting of the terminal; it could be a bit more fault tolerant
Can you suggest how? I'm not versed in bash.
Basically, the shell gets killed by SIGPIPE when gitstatus attempts to write to a file descriptor.
echo -nE "$req_id"$'\x1f'"$dir"$'\x1f'"$no_diff"$'\x1e' >&$_GITSTATUS_REQ_FD
Here $_GITSTATUS_REQ_FD
is a file descriptor to a fifo. The other end of the fifo is supposed to be open by another process. That process got killed by fzf-tab-completion, so echo
causes SIGPIPE. By default there is no handler for SIGPIPE and the default one kills the process.
I see two ways of surviving this:
(echo -nE "...") || return
. If done this way, the subshell will get killed but the top-level shell will stay alive.local_traps
from zsh, so we would need to restore the trap manually. The only way I can find how to retrieve the current trap is trap -p PIPE
, which requires forking (or file I/O).Both of these options require forking. The whole point of gitstatus is to be fast, so an extra fork to survive a pathological case doesn't look appealing.
Is there a better way?
Honestly I'm not sure (or perhaps it is as you say, would require introducing some forks into it). Personally though, I'm satisfied that fzf-tab-completion being the actual root cause, the ultimate fix lies there.
Hello,
A couple days ago I wanted to use fzf-tab-completion in my Bash configuration which uses my bash-seafly-prompt script and the gitstatus utility.
No good, there is a bad interaction between
gitstatus
andfzf-tab-completion
when doing Bash tab completion; basically the terminal GUI window (Alacritty & GNOME-Terminal) will close upon hittingENTER
after a completion.I can repeat the issue with this minimal
~/.bashrc
file:I installed
fzf-tab-completion
viagit clone https://github.com/lincheney/fzf-tab-completion
in the home directory. And I installedgitstatus
viagit clone --depth 1 https://github.com/romkatv/gitstatus.git ~/.gitstatus
.Do
cd <TAB>
, select a directory from thefzf
list followed byENTER
to execute thecd
command. BOOM, the window will close.Maybe
gitstatus
is at fault, I don't know.Regards.