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

Allow NewTab Action to specify the shell that will run #3385

Open
giggio opened this issue May 27, 2024 · 4 comments
Open

Allow NewTab Action to specify the shell that will run #3385

giggio opened this issue May 27, 2024 · 4 comments

Comments

@giggio
Copy link

giggio commented May 27, 2024

Additionally to the current options to the NewTab command (cwd etc), I'd like to have the option to specify the shell that will run.
Reason: I've been using Nushell for a while, but I still go back to Bash every now and then, and having a keyboard shortcut that allows me to quickly go there would be very helpful.

@cristiand391
Copy link
Contributor

you can create a new layout that runs bash like this:
https://zellij.dev/documentation/creating-a-layout#command

both the CLI/keybind NewTab action take a layout.

related:
zellij actually support overriding config in layouts:
https://zellij.dev/documentation/layouts-with-config

so, you could set default_shell "nu" in the layout file, unfortunately this doesn't work with the new-tab action:

Note: These fields are ignored when loading a layout through the new-tab action

it does work if you create a new session and choose that layout, but I think setting a pane to run bash is easier for your use case.

@giggio
Copy link
Author

giggio commented May 28, 2024

I don't work a log with splits, I prefer to have my terminal fullscreen, so the layout solution wouldn't help me. I need a quick keyboard shortcut that opens a new tab on a different shell.

@cristiand391
Copy link
Contributor

I'm not sure I understand what you mean about splits.

Here's an example with layouts, my default shell is zsh but I can pass this layout to new-tab to start with bash:

Screencast.from.05-28-2024.08.00.28.PM.webm
layout {
  pane size=1 borderless=true {
    plugin location="zj-status-bar"
  }
  pane command="bash"
}
zellij action new-tab --layout ~/.config/zellij/layouts/bash.kdl

@cristiand391
Copy link
Contributor

oh nvm, new panes will still open your default shell, maybe that's what you meant.

rather than having new-tab take a new param it might be better if config overriding would be supported like mentioned above.

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