rcaloras / bash-preexec

⚡ preexec and precmd functions for Bash just like Zsh.
MIT License
876 stars 93 forks source link

preexec_function gets inaccurate arguments in tmux #74

Closed JeffFaer closed 6 years ago

JeffFaer commented 6 years ago

Observed problem: Exiting from tmux executes all preexec_functions with the previous command.

Expected behavior: $1 should probably be empty or "logout", since that's what tmux briefly shows on my screen before exiting.

Steps to reproduce:

$ git -C ~/src/bash-preexec describe --tags
0.3.6
$ tmux -V
tmux 2.6
$ tmux
tmux $ foo() { echo "$@" >> preexec.out; }
tmux $ preexec_functions+=(foo)
tmux $ echo 123
<CTRL + D>
$ cat preexec.out
echo 123
echo 123

If you tail -f preexec.out while performing these steps, you see that the second echo 123 does indeed come from the <CTRL + D>.

rcaloras commented 6 years ago

@JeffreyFalgout thanks for reporting! Believe this is the same issue as #27. What do you think? Any ideas for how to address?

JeffFaer commented 6 years ago

Yep, sounds like a dupe.

JeffFaer commented 6 years ago

Duplicate of #27