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

Feature request: setting environment variables in layout #2988

Open
Zstorm999 opened this issue Dec 5, 2023 · 4 comments
Open

Feature request: setting environment variables in layout #2988

Zstorm999 opened this issue Dec 5, 2023 · 4 comments
Labels
enhancement New feature or request layout issues related to the layout system

Comments

@Zstorm999
Copy link

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)
    }
}
@jaeheonji jaeheonji added enhancement New feature or request layout issues related to the layout system labels Dec 12, 2023
@igorrizhyi
Copy link

igorrizhyi commented Feb 8, 2024

@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"
}

@astral-l
Copy link

astral-l commented Mar 4, 2024

seconding interest in this, would be very helpful to have for kiosk-like panes which run a program directly instead of starting a shell

@optimizasean
Copy link

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 🤣

@luccahuguet
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request layout issues related to the layout system
Projects
None yet
Development

No branches or pull requests

6 participants