-
-
Notifications
You must be signed in to change notification settings - Fork 681
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
feat: add kill-session
command
#745
Conversation
Hey, just wanted to apologize for not getting to this yet! I plan on taking a look tomorrow. |
Hey @jaeheonji - first of all, I'm really sorry for taking so long to get to this (and not getting to this when I promised). It's been a week for me. Second - I'm happy to see this being picked up. We just had a request for this on Discord. So, before I look at the code - I tried this out and it isn't working for me. Though maybe I'm doing something wrong? What I'm doing:
I also tried with Also, if I just do cargo make run -- kill-session I get a hard-crash (panicked on unwrapping a None). |
Aha! I think I know why this happened. I recently added a "mirrored sessions" feature to allow users to connect to the same session from different terminal windows. With this feature the behaviour of the Have a good sleep meanwhile :) |
There was such a story! thank you :) |
I simply added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thanks for picking up on my changes! This looks great. I have a few functionality comments and one minor comment on the code itself (left in the code).
Functionality:
-
Running
kill-session
without anything (eg.zellij kill-session
) results in a panic. Maybe we can show an informative error? I think this is something we can achieve with our cli parser. -
Running
kill-session -t <non-existent-session>
gives a non-informative error... can we show something nicer here? -
It's possible to run the command with both
-a
and-t
- which works, but is a little non-explicit. Do you think we can make them mutually exclusive?
@imsnif thanks! Good! I totally agreed your opinion of Functionality 1, 2. There should be additional information for users. But, we need to think about Functionality 3 and your comment of #745 (comment). First, I implemented the
The Yes I know.. This looks pretty confusing and weird. Perhaps this is why we make a better terminal multiplexer with Zellij. (like modern unix tools) From here on, this is my personal opinion. As you commented,
Personally, I think it's simpler and more intuitive, but I'm wonder about other people's opinions. 🤔 |
I totally agree with your opinion! Let's do that. Only nitpick is that I think you accidentally dropped the |
* separation of command `kill-session` and `kill-all-sessions` function. * Add information to various situations * Add a question (yes or no) when executing the `kill-all-sessions` command.
There is one concern I have added during development. If the user unintentionally uses The code can be weird because it's simple to implement without using additional libraries 😭 If you think it's too functionally overkill, please leave a comment. |
You are fast! :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! I love the added warning :)
I fixed some minor issue with the wording and will merge once the CI passes. Thanks for this! Hope to see more contributions for you in the future. Feel free to drop by our Discord if you'd like
I am so happy to be able to contribute to a project I love. thank you! 😄 |
Just used this feature. Thanks! |
Fix #644
Hi, everyone 👋
I simply added a command to close the session.
The purpose of this feature is to close a session via a command inside or outside the session.
In order to give the same experience as
tmux
as much as possible, I implemented it referring to the commands oftmux
like below.kill-session [-a] [-t target-session]
By the way, I'm a Rust newbie and I need a lot of feedback from community!
Anyone feel free to give feedback 😸