Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit code is wrong in case of Normal mode1 #137

Open
FFdhorkin opened this issue Feb 18, 2020 · 2 comments
Open

Exit code is wrong in case of Normal mode1 #137

FFdhorkin opened this issue Feb 18, 2020 · 2 comments
Labels

Comments

@FFdhorkin
Copy link

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

@greymd
Copy link
Owner

greymd commented Feb 21, 2020

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 greymd added the bug label Feb 22, 2020
@greymd
Copy link
Owner

greymd commented May 4, 2020

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 greymd changed the title Exit code is "[exited]" on OSX, not number code Exit code is wrong in case of Normal mode1 May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants