Skip to content

Commit bf23fe4

Browse files
ambroisierycee
authored andcommitted
tmux: add 'focusEvents'
With `tmux-sensible` being disabled by default, add an easy toggle to enable this functionality. Disabled by default, as in upstream `tmux`.
1 parent 873e39d commit bf23fe4

8 files changed

+17
-0
lines changed

modules/programs/tmux.nix

+10
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ let
9595
''}
9696
9797
set -g mouse ${boolToStr cfg.mouse}
98+
set -g focus-events ${boolToStr cfg.focusEvents}
9899
setw -g aggressive-resize ${boolToStr cfg.aggressiveResize}
99100
setw -g clock-mode-style ${if cfg.clock24 then "24" else "12"}
100101
set -s escape-time ${toString cfg.escapeTime}
@@ -191,6 +192,15 @@ in {
191192
'';
192193
};
193194

195+
focusEvents = mkOption {
196+
default = false;
197+
type = types.bool;
198+
description = ''
199+
On supported terminals, request focus events and pass them through to
200+
applications running in tmux.
201+
'';
202+
};
203+
194204
historyLimit = mkOption {
195205
default = 2000;
196206
example = 5000;

tests/modules/programs/tmux/default-shell.conf

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ set -g mode-keys emacs
1919

2020

2121
set -g mouse off
22+
set -g focus-events off
2223
setw -g aggressive-resize off
2324
setw -g clock-mode-style 12
2425
set -s escape-time 500

tests/modules/programs/tmux/disable-confirmation-prompt.conf

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ bind-key -N "Kill the current pane" x kill-pane
1919

2020

2121
set -g mouse off
22+
set -g focus-events off
2223
setw -g aggressive-resize off
2324
setw -g clock-mode-style 12
2425
set -s escape-time 500

tests/modules/programs/tmux/emacs-with-plugins.conf

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ set -g mode-keys emacs
1919

2020

2121
set -g mouse off
22+
set -g focus-events off
2223
setw -g aggressive-resize on
2324
setw -g clock-mode-style 24
2425
set -s escape-time 500

tests/modules/programs/tmux/mouse-enabled.conf

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ set -g mode-keys emacs
1717

1818

1919
set -g mouse on
20+
set -g focus-events off
2021
setw -g aggressive-resize off
2122
setw -g clock-mode-style 12
2223
set -s escape-time 500

tests/modules/programs/tmux/prefix.conf

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ bind -N "Send the prefix key through to the application" \
2222

2323

2424
set -g mouse off
25+
set -g focus-events off
2526
setw -g aggressive-resize off
2627
setw -g clock-mode-style 12
2728
set -s escape-time 500

tests/modules/programs/tmux/shortcut-without-prefix.conf

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ bind C-a last-window
2323

2424

2525
set -g mouse off
26+
set -g focus-events off
2627
setw -g aggressive-resize off
2728
setw -g clock-mode-style 12
2829
set -s escape-time 500

tests/modules/programs/tmux/vi-all-true.conf

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ set -g mode-keys vi
1919

2020

2121
set -g mouse off
22+
set -g focus-events off
2223
setw -g aggressive-resize on
2324
setw -g clock-mode-style 24
2425
set -s escape-time 500

0 commit comments

Comments
 (0)