Search code examples
windowtmux

How do I terminate a window in tmux?


How do I terminate a window in tmux? Like the Ctrlak shortcut in screen, where Ctrla is the prefix.


Solution

  • Kent's response fully answered your question, however if you are looking to change tmux's configuration to be similar to GNU Screen, here's a tmux.conf that I've used to accomplish this:

    # Prefix key
    set -g prefix C-a
    unbind C-b
    bind C-a send-prefix
    
    # Keys
    bind k confirm kill-window
    bind K confirm kill-server
    bind % split-window -h
    bind : split-window -v
    bind < resize-pane -L 1
    bind > resize-pane -R 1
    bind - resize-pane -D 1
    bind + resize-pane -U 1
    bind . command-prompt
    bind a last-window
    bind space command-prompt -p index "select-window"
    bind r source-file ~/.tmux.conf
    
    # Options
    set -g bell-action none
    set -g set-titles on
    set -g set-titles-string "tmux (#I:#W)"
    set -g base-index 1
    set -g status-left ""
    set -g status-left-attr bold
    set -g status-right "tmux"
    set -g pane-active-border-bg black
    set -g pane-active-border-fg black
    set -g default-terminal "screen-256color"
    
    # Window options
    setw -g monitor-activity off
    setw -g automatic-rename off
    
    # Colors
    setw -g window-status-current-fg colour191
    set -g status-bg default
    set -g status-fg white
    set -g message-bg default
    set -g message-fg colour191