Skip to content

Commit

Permalink
tmux: add 'focusEvents'
Browse files Browse the repository at this point in the history
With `tmux-sensible` being disabled by default, add an easy toggle to
enable this functionality.

Disabled by default, as in upstream `tmux`.
  • Loading branch information
ambroisie authored and rycee committed Dec 2, 2024
1 parent 873e39d commit bf23fe4
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/programs/tmux.nix
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ let
''}
set -g mouse ${boolToStr cfg.mouse}
set -g focus-events ${boolToStr cfg.focusEvents}
setw -g aggressive-resize ${boolToStr cfg.aggressiveResize}
setw -g clock-mode-style ${if cfg.clock24 then "24" else "12"}
set -s escape-time ${toString cfg.escapeTime}
Expand Down Expand Up @@ -191,6 +192,15 @@ in {
'';
};

focusEvents = mkOption {
default = false;
type = types.bool;
description = ''
On supported terminals, request focus events and pass them through to
applications running in tmux.
'';
};

historyLimit = mkOption {
default = 2000;
example = 5000;
Expand Down
1 change: 1 addition & 0 deletions tests/modules/programs/tmux/default-shell.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ set -g mode-keys emacs


set -g mouse off
set -g focus-events off
setw -g aggressive-resize off
setw -g clock-mode-style 12
set -s escape-time 500
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ bind-key -N "Kill the current pane" x kill-pane


set -g mouse off
set -g focus-events off
setw -g aggressive-resize off
setw -g clock-mode-style 12
set -s escape-time 500
Expand Down
1 change: 1 addition & 0 deletions tests/modules/programs/tmux/emacs-with-plugins.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ set -g mode-keys emacs


set -g mouse off
set -g focus-events off
setw -g aggressive-resize on
setw -g clock-mode-style 24
set -s escape-time 500
Expand Down
1 change: 1 addition & 0 deletions tests/modules/programs/tmux/mouse-enabled.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ set -g mode-keys emacs


set -g mouse on
set -g focus-events off
setw -g aggressive-resize off
setw -g clock-mode-style 12
set -s escape-time 500
Expand Down
1 change: 1 addition & 0 deletions tests/modules/programs/tmux/prefix.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ bind -N "Send the prefix key through to the application" \


set -g mouse off
set -g focus-events off
setw -g aggressive-resize off
setw -g clock-mode-style 12
set -s escape-time 500
Expand Down
1 change: 1 addition & 0 deletions tests/modules/programs/tmux/shortcut-without-prefix.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ bind C-a last-window


set -g mouse off
set -g focus-events off
setw -g aggressive-resize off
setw -g clock-mode-style 12
set -s escape-time 500
Expand Down
1 change: 1 addition & 0 deletions tests/modules/programs/tmux/vi-all-true.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ set -g mode-keys vi


set -g mouse off
set -g focus-events off
setw -g aggressive-resize on
setw -g clock-mode-style 24
set -s escape-time 500
Expand Down

0 comments on commit bf23fe4

Please sign in to comment.