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 value should not be 0 if action fails #3860

Open
AvdN opened this issue Dec 10, 2024 · 0 comments
Open

exit value should not be 0 if action fails #3860

AvdN opened this issue Dec 10, 2024 · 0 comments

Comments

@AvdN
Copy link

AvdN commented Dec 10, 2024

zellij --version
zellij 0.41.2

When trying zellij action go-to-tab-name xyz the exit value of the command is 0 (zero), independent of whether a tab with name xyz already exists or not.
If a tab with that name doesn't exist, you stay in the current tab, and an error, i.e. non-zero, exit value should be used, on which the calling script/program can act.

Always using --create for the action is not an option (in my use case), as I need different script behaviour depending on whether the tab is there or not (i.e. switch to the tab, do A if not failing; and if failing do create the tab and then B).

You can work around this by parsing the output of zellij action query-tab-names before issuing the go-to-tab action (with or without --create, but using a differentiating exit value is easier in almost all (scripting) languages and shells.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant