zellij
zellij copied to clipboard
Feature request: setting environment variables in layout
It would be nice if we could set environment variables in layout files, with their values being contained in a pane/tab.
This could look something like
pane {
// here $TERM has its normal value
pane {
env "TERM=xterm-color"
// we override $TERM in this pane (and all sub-panes)
}
}
@Zstorm999 agree that it would be a great addition to the tool but till then, you can have this workaround:
pane name="hello" command="zsh" {
args "-c" "export SOMETHING=123; zsh"
}
seconding interest in this, would be very helpful to have for kiosk-like panes which run a program directly instead of starting a shell
This would be nice to automate opening date-stamped files or sets of files with * wildcards.
Would also greatly help if we could do sub command execution or use a command to provide a list of files to editors:
layout {
pane borderless=true {
name "report editor"
cwd "$HOME/folder"
command "nvim"
args "$(date '+%m_%B')*.md" "-c" ":NvimTreeOpen"
focus true
}
}
Load all date stamped files from this month and open the tree in case I want to look around :rofl:
this might be of help, as an example
pane name="sidebar"{
command "env"
args "YAZI_CONFIG_HOME=/home/lucca/.config/zellij/yazi/sidebar" "yazi"
size "20%"
}
this runs yazi with said environment variable, but you could just as well run bash or maybe just the env command