Repository navigation
Replies: 2 comments
|
There are four ways to do this, depending on whether you want a different default shell or specific "profiles" like in Windows Terminal or Cmder. 1. Change the default shellOn Windows, Zellij picks the shell for new panes in this order: the So either add this to your default_shell "pwsh.exe"or set
2. Shell + batch script in a layout (like Windows Terminal profiles)A command pane can run any program with arguments. // e.g. dev.kdl, in the "layouts" folder inside your config dir
layout {
default_tab_template {
pane size=1 borderless=true {
plugin location="tab-bar"
}
children
pane size=1 borderless=true {
plugin location="status-bar"
}
}
tab name="VS dev" {
pane command="cmd.exe" {
args "/k" "C:\\tools\\vsdev-env.bat"
}
}
tab name="pwsh" {
pane command="pwsh.exe" {
args "-NoExit" "-File" "C:\\tools\\env.ps1"
}
}
}Start it with 3. A key that opens a pane with the script (like Cmder's "new task")keybinds {
shared_except "locked" {
bind "Alt e" {
Run "cmd.exe" "/k" "C:\\tools\\vsdev-env.bat" {
direction "Down"
close_on_exit true
}
}
}
}Add 4. One-off, from inside a session
|
|
There are two parts to this: changing the default shell, and opening a shell that runs a batch script first. 1. A different default shellSet default_shell "pwsh"
// or a full path:
// default_shell "C:\\Program Files\\PowerShell\\7\\pwsh.exe"If you don't set it, Zellij on Windows uses https://github.com/zellij-org/zellij/blob/v0.46.0/zellij-server/src/pty.rs#L2689-L2698
2. A shell that starts with a batch script (like a Windows Terminal profile)
One-off, from inside Zellij: A key binding (in the keybinds {
shared_except "locked" {
bind "Alt d" {
Run "cmd" "/k" "C:\\tools\\dev-env.bat" {
name "dev"
close_on_exit true
}
}
}
}
A layout, if the session should start with it: // dev.kdl
layout {
pane command="cmd" {
args "/k" "C:\\tools\\dev-env.bat"
close_on_exit true
}
}Start it with Note that inside KDL strings, backslashes have to be doubled ( |
Uh oh!
There was an error while loading. Please reload this page.
[Running Zellij 0.46 on WIndows 11 26H2]
I may want to open different shells than
cmd.exe, and more than that, start a new shell with a predefined batch script to set up a specific environment, as I do on Windows Terminal or on Cmder: how do I?All reactions