-
-
Notifications
You must be signed in to change notification settings - Fork 663
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 attaching without providing session name when multiple sessions exist #2100
Comments
A solution exists already. In integrations you can see a snippest that uses |
Those are great for user facing commands but if I set a my shell to auto start zellij, also from integrations with set ZELLIJ_AUTO_ATTACH true
set ZELLIJ_AUTO_EXIT true
eval (zellij setup --generate-auto-start fish | string collect) my terminal will fail to launch if I have more than one zellij session active as the attach command fails. |
Yes I see.
|
BTW, the integrations that you mentioned have different behaviour from your issue discription. The auto-start integration keeps creating new sessions whenever I login (I use bashrc). My pick with it is that it creates too many sessions and at some point your need to start filter through them one by one to see which one to close. This is probably the diametrical opposite of your problem of not attaching. |
I'm simply using the auto-attach code that zellij produces for fish, and it fails once you have two sessions. I'm not looking for a quick solution, I'm fine creating my own logic for now but in the long run this shouldn't be able to case your terminal to fail to launch. With a single session, every new terminal successfully reattaches to the session, as expected. If I open a second session: ❯ zellij list-sessions
tested-fang (current)
stiff-fall all new terminals fail immediately. [process exited with code 15 (0x0000000f)] The bash script may function differently, if that's the case the bug report here would be that the fish script handles multiple sessions incorrectly, as this setting should not stop your terminal from launching. |
Are you aware that there are shortcuts to attaching a particular session? Example: $ zellij a
Please specify the session to attach to, either by using the full name or a unique prefix.
The following sessions are active:
better-laborer
mammoth-disease
$ zellij a b # attaches the first session Also, you can set a custom, fixed session name and use that as your "main" session to attach to by default. |
Where would I do that? |
yeah imo the shell integrations are broken currently. the script generated by |
I'd also like something like this, where it will create a new session when the default is already in use |
I've cooked up the following launch command which might do what we want zellij a main || zellij -s main || zellij Which will attempt to attach to main, or create main, or otherwise launch normally |
Something like this would enable user to specify the session name without command chainging: |
I have |
When multiple sessions are active, Zellij requires the name of a session to send actions to. Alas a WezTerm pane does not inherit a shell's environment and therefore cannot use the ZELLIJ_SESSION_NAME environment variable. wez/wezterm#5906 zellij-org/zellij#3581 zellij-org/zellij#2100
Currently if you run
zellij attach
with a single session, it will successfully attach, but if there are multiple sessions active the command will fail and list the sessions instead.My initial expectation is that it would attach to the session I most recently exited, allowing me to hop in and out of a session easily but still swap to other sessions at will.
I'd expect this to be the default but it could be added as an
--recent
option or something of that nature if needed.The text was updated successfully, but these errors were encountered: