diff options
author | Daniel Mueller <deso@posteo.net> | 2020-07-06 18:17:29 -0700 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2020-07-06 18:17:29 -0700 |
commit | c907a2001619e9c695280b5f1cefa82571c6dcf6 (patch) | |
tree | 24654162f1e9018dc0d52f66a6b8844af27820cc | |
parent | c2d816d9e31cf9e2ebaf2b51b346ab2a992d7457 (diff) |
fzy-tmux: Use named pipe for conveying exit code
On a couple of occasions I've seen the following error being reported by
the fzy-tmux script:
> head: cannot open '/tmp/tmp.qUbDwrPLxQ/ret' for reading: No such file or directory
> /usr/bin/fzy-tmux: line 41: exit: : numeric argument required
The issue seems to be that PATH_FIFO_RET is not yet created but we
already try to read from it, causing the read to fail. With this change
we use a named pipe which we create before the actual tmux invocation,
preventing this case from happening.
Credit for the fix goes to @zsugabubus.
Closes: #143
-rwxr-xr-x | contrib/fzy-tmux | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/fzy-tmux b/contrib/fzy-tmux index ba7c146..3ddf57b 100755 --- a/contrib/fzy-tmux +++ b/contrib/fzy-tmux @@ -23,7 +23,7 @@ main() { fatal "Unable to create a temporary directory" fi - mkfifo "${PATH_FIFO_IN}" "${PATH_FIFO_OUT}" + mkfifo "${PATH_FIFO_IN}" "${PATH_FIFO_OUT}" "${PATH_FIFO_RET}" export TMUX=$(_echo "${TMUX}" | cut -d , -f 1,2) eval "tmux \ |