Skip to content

[Feature Request] Command to kill session groups #2346

@serban

Description

@serban

Request

Please provide a command to kill all sessions in a session group.

Background

I use session groups to show different windows of the same session on multiple displays simultaneously.

I create and destroy session groups frequently, but tmux does not provide a convenient way to kill all the sessions in a session group at once. I work around this with a shell function similar to this:

function kg --argument-names group
  tmux list-sessions -F '#{session_group} #{session_name}' \
      | grep "^$group " | cut --delimiter=' ' --fields=2 \
      | while read --line session
    tmux kill-session -t =$session
  end
end

It would be very nice to be able to do this from within tmux. After all, tmux provides kill-server, kill-session, kill-window, and kill-pane. kill-group would be a natural addition, since session groups are a native tmux abstraction.

With kill-group, users could destroy a session group in just a couple of keystrokes using a binding like this:

bind-key K confirm-before kill-group

Thanks

I use tmux all day, every day. This is excellent software. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions