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

Improve Session Resurrection #3861

Open
Eloquencere opened this issue Dec 10, 2024 · 5 comments
Open

Improve Session Resurrection #3861

Eloquencere opened this issue Dec 10, 2024 · 5 comments

Comments

@Eloquencere
Copy link

In my usual workflow, I source a shell file that exports certain necessary environment variables to initialize the project correctly. After which, I launch a Zellij session. Now, if, say that the zellij session is terminated and I attempt to resurrect it, the session comes back to life with the layout and the commands that were previously run. Still, the environment variables that had been sourced before that session was launched (1st time and 2nd time) aren't accessible anymore. So, it would be a great addition if the variables could also be revived before resurrection or if the variables could be passed via a JSON/KDL file.

@bonsaiiV
Copy link

Have you looked into the env node? It can be use in the layout file before the layout node to set environment variables when using the layout. It can also be used in the config.

@Eloquencere
Copy link
Author

Hi, thanks for pointing me in the right direction. I tried looking into the documentation webpage under creating layouts but couldn't find what you mentioned. It's possible I might've missed it, could you attach a link to the relevant documentation?

@Eloquencere
Copy link
Author

I looked into the env node as you suggested but it doesn't seem to support running shell commands to obtain the environment variables to be run, can that be fixed?

@Eloquencere
Copy link
Author

Also, just like how tab names can be specified in the layout file, can the same be done for session names?

@bonsaiiV
Copy link

Specifying the name of the session is propably not supported, as it is assumed, that multiple sessions with the same layout can exist. I personaly am using a fish function for entering zellij most of the time, which sets the session name.

You could also have a pane, that runs your setup commands. This is a hacky workaround, as that pane exists until you close it. Maybe you can kill it in your setup script though.

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