tmux-xpanes icon indicating copy to clipboard operation
tmux-xpanes copied to clipboard

Exit code is wrong in case of Normal mode1

Open FFdhorkin opened this issue 5 years ago • 2 comments

So, tmux-xpanes is great and seems to do almost everything I'd like.

However, I'm using this in a bash script with -ss provided, and I need a way to know if my subcommands succeeded. I thought from https://github.com/greymd/tmux-xpanes/wiki/Exit-Status that I'd simply be able to look at the value of $?, and if it was nonzero, print a generic error message with the code.

It appears, on OSX at least, that instead of getting a number code, I'm getting a value of [exited], regardless of success/failure

FFdhorkin avatar Feb 18 '20 18:02 FFdhorkin

Hi, I could reproduce it. When xpanes starts from tmux session, the exit code is 31.

Screenshot 2020-02-21 at 02 17 44

But when it starts from normal terminal, exit code is always zero.

Screenshot 2020-02-21 at 02 16 57

It might be the bug. I will work on it and I will report the progress on this issue. Thx!

greymd avatar Feb 21 '20 02:02 greymd

It may be difficult to solve this issue since exit status of the command cannot be fetched outside of the tmux session.

bash-3.2# tmux new-session 'exit 123'
[exited]
bash-3.2# echo $?
0

greymd avatar May 04 '20 13:05 greymd