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

Fish: Auto-start & Auto-exit break when there's multiple sessions #3773

Open
Dietr1ch opened this issue Nov 14, 2024 · 0 comments
Open

Fish: Auto-start & Auto-exit break when there's multiple sessions #3773

Dietr1ch opened this issue Nov 14, 2024 · 0 comments

Comments

@Dietr1ch
Copy link

Issue description

It's possible to get to a state where failure to auto-start a session breaks the terminal as the shell exits right away after not starting a session.

Minimal reproduction

I think the minimal reproduction is starting 2 named sessions and detaching from all clients.

Here the only way to interact with your shell is to open a new terminal, which will start your shell (fish) and it will run the code generated by zellij setup --generate-completion fish,

if not set -q ZELLIJ
    if test "$ZELLIJ_AUTO_ATTACH" = "true"
        zellij attach -c   # We hit this branch.
    else
        zellij
    end

    if test "$ZELLIJ_AUTO_EXIT" = "true"
        kill $fish_pid   # And then we hit this.
    end
end

However, zellij attach -c seems to exit immediately after prompting which session to attach to without waiting for user input.

Once this happens, if ZELLIJ_AUTO_EXIT is also set, fish will kill itself and the terminal will continue to quit successfully.

Other relevant information

  • It's possible that this issue affects other shells.
  • I'm using named sessions, or at least all the remaining sessions have user-given names. I'm not sure if this plays a role, maybe sessions with auto-generated names are special.
  • A simple workaround is to keep auto-exit off. It's also neat if you still reach out for tmux (nested sessions to use local and remote instances).
  • It can be quite hard to fix the issue without a terminal. I'd been locked out of my PC if I didn't have emacs around as my backup editors all depend on my shell starting.
    • With this in mind I recommend disabling auto-exit if no fix is found quickly. I'd rather annoy a bunch people a bit instead of locking a few out of their computer.
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

1 participant