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: Detachable/Persistent sessions #531

Merged
merged 15 commits into from
May 25, 2021
Merged

Feature: Detachable/Persistent sessions #531

merged 15 commits into from
May 25, 2021

Conversation

kunalmohan
Copy link
Member

Adds the basic implementation of detachable/persistent sessions.
This PR adds two commands- attach or a and list-sessions or ls and a new input mode- Session mode.

  • Users can enter session mode by Ctrl + b and then detach the session using d. Suggestions for better keybindings are most welcome.
  • Users can attach to an existing session using zellij attach <session_name> or zellij a <session_name>. If the session is attached to another client, zellij exits with a message. To force connect, users can add a --force (-f) flag- zellij a <session_name> -f. Note: this will disconnect the session from the existing client and connect to this new client.
  • Users can check the active zellij sessions using zellij list-sessions or zellij ls command. If called from within a zellij session, the output will display (current) alongside the current session name.

Users can now specify names for their session using --session or -s flag. This will create a new session with the given name. If a session with the name already exists, zellij exits with a message.

TBD (maybe in a separate PR):

  • We should display the session name in the window somewhere (possibly Tabbar).
  • Add usage documentation.

Copy link
Member

@imsnif imsnif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @kunalmohan - this looks great and I'm quite excited to say I have virtually no comments.
I left just a really minor few clarification requests on parts that weren't super clear to me, and otherwise two usability things:

  1. I think we should make the Sessions shortcut be Ctrl + i. Otherwise people might confuse it with tmux :)
  2. Let's put the session shortcut before the Quit in the bar - I think it's good for consistency that quit be the last
  3. There's a small bug where if you reduce the width of the Zellij window, the shortcut of Session becomes <b>sess. This is unavoidable now that we start having shortcuts where the shortcut letter doesn't match the first letter of the mode name. So I think the best thing would be to remove this behaviour completely from the status bar. If you have time to do this quickly as part of this PR, that would be grand. Otherwise we can leave this bug inside and do it another time - as you wish.

When you feel this is ready, go ahead and merge.

zellij-server/src/lib.rs Show resolved Hide resolved
zellij-server/src/os_input_output.rs Show resolved Hide resolved
zellij-server/src/tab.rs Show resolved Hide resolved
@kunalmohan kunalmohan merged commit 2bca7e0 into main May 25, 2021
@kunalmohan kunalmohan deleted the detach-sessions branch May 25, 2021 12:00
kunalmohan added a commit that referenced this pull request May 25, 2021
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

Successfully merging this pull request may close these issues.

2 participants