Unfortunately there does not appear to be a simple default keybind to do this, possibly because it's an action you might want to be careful about though this could be addressed with a confirm dialogue.
One way is
C-x : to get the tmux prompt and
As @Vaisakh-k-m pointed out
w gives you an interface to select windows across multiple sessions which you can select with the arrow keys and
t to toggle the tagged status then
X to kill the tagged windows and
y to confirm this action.
This way there is no need to type a command at the prompt (accessed with
kill-server kills all sessions not merely the current one
If you'd like a custom kill session keybind @user79262 suggests these additions to your
bind C-x confirm-before -p "kill other windows? (y/n)" "kill-window -a"
bind Q confirm-before -p "kill-session #S? (y/n)" kill-session
You can close the current window with:
C-x (Your prefix
Ctrl+a in the case of the OP,
Ctrl+b by default)
& and confirm with
This shortcut kills the window but not the current session unless your are in the last open window.
If you run
tmux ls you'll see that with
d the session is still running in the background. You can re-attach to these background sessions with
tmux a -t <session> where session is a name number.
s) and then press
xwith the target section selected, followed by
yto confirm. No typing
:kill-session, no rebinding