diff options
author | Jae-Heon Ji <32578710+jaeheonji@users.noreply.github.com> | 2021-10-11 23:57:56 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-11 16:57:56 +0200 |
commit | 0ca5c187295a157d9e6d24676146681da4fa0188 (patch) | |
tree | 0b4cba0de0444319c66c4342828863613f52d588 /zellij-utils | |
parent | 8415004834d47e68da2fe4c5ecd9ef7f74945642 (diff) |
feat(cli): add `kill-session` command (#745)
* feat: add kill-session command
* style: apply formatting rules
* feat: add new instruction for kill-session
* feat: update feedback of kill-session
* 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.
* chore: adjust clippy warning
* fix warning wording
* make rustfmt happy
Co-authored-by: Aram Drevekenin <aram@poor.dev>
Diffstat (limited to 'zellij-utils')
-rw-r--r-- | zellij-utils/src/cli.rs | 15 | ||||
-rw-r--r-- | zellij-utils/src/errors.rs | 1 | ||||
-rw-r--r-- | zellij-utils/src/ipc.rs | 1 |
3 files changed, 17 insertions, 0 deletions
diff --git a/zellij-utils/src/cli.rs b/zellij-utils/src/cli.rs index 452033b8a..7ac9e958c 100644 --- a/zellij-utils/src/cli.rs +++ b/zellij-utils/src/cli.rs @@ -89,4 +89,19 @@ pub enum Sessions { #[structopt(subcommand, name = "options")] options: Option<SessionCommand>, }, + + /// Kill the specific session + #[structopt(alias = "k")] + KillSession { + /// Name of target session + target_session: Option<String>, + }, + + /// Kill all sessions + #[structopt(alias = "ka")] + KillAllSessions { + /// Automatic yes to prompts + #[structopt(short, long)] + yes: bool, + }, } diff --git a/zellij-utils/src/errors.rs b/zellij-utils/src/errors.rs index 348e6013a..1859a9042 100644 --- a/zellij-utils/src/errors.rs +++ b/zellij-utils/src/errors.rs @@ -304,6 +304,7 @@ pub enum ServerContext { ClientExit, RemoveClient, Error, + KillSession, DetachSession, AttachClient, } diff --git a/zellij-utils/src/ipc.rs b/zellij-utils/src/ipc.rs index 5c327022f..995b89fb4 100644 --- a/zellij-utils/src/ipc.rs +++ b/zellij-utils/src/ipc.rs @@ -68,6 +68,7 @@ pub enum ClientToServerMsg { AttachClient(ClientAttributes, Options), Action(Action), ClientExited, + KillSession, } // Types of messages sent from the server to the client |