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

FR: Flag to specify shell #11

Open
marcelarie opened this issue Aug 1, 2024 · 1 comment
Open

FR: Flag to specify shell #11

marcelarie opened this issue Aug 1, 2024 · 1 comment

Comments

@marcelarie
Copy link

marcelarie commented Aug 1, 2024

I think it would be really useful to have a flag to specify the shell that will be used to run the commands.

For example"

tmex "$SESSION" --reattach --focus=0 --layout="2{41}" --shell=fish  "cd $REPO_NAME; clear; $EDITOR" "cd $REPO_NAME; clear;" 

Instead of doing something like:

tmex "$SESSION" --reattach --focus=0 --layout="2{41}"  "cd $REPO_NAME; clear; $EDITOR; fish" "cd $REPO_NAME; clear; fish" 
@evnp
Copy link
Owner

evnp commented Aug 6, 2024

Hey @marcelarie, I really like this idea – thanks! There's an existing --shellless / -s arg (a boolean flag) that I think it would be great to harmonize with.

One thought is that along with a new --shell arg as you suggest, --shellless would remain, and would be exactly equivalent to --shell=none (or --shell none) in the new setup. For simplicity, and for maintaining backwards-compatibility, I think the short form -s should continue to refer to --shellless.

Allowing -s to somehow control both cases is appealing (-s on its own equating to --shellless, and -s fish setting a shell) but I can't see a way of doing this that doesn't introduce ambiguity – is the arg following -s a shell, a layout, or a command? Maybe there's merit in checking whether the arg is an executable command?
(eg. if command -v "${argshell}"; then ...) But this starts to seem too nuanced. Very open to your thoughts on this.

I'd welcome a pull request for this if you have the time and are interested, but I'd also be happy to whip something up soon, whichever you prefer. I'm adding a few small quality-of-life features in the coming weeks that this will dovetail nicely with.

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

2 participants