diff --git a/modules/programs/tmux.nix b/modules/programs/tmux.nix index 38a184c94..85052c9fd 100644 --- a/modules/programs/tmux.nix +++ b/modules/programs/tmux.nix @@ -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} @@ -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; diff --git a/tests/modules/programs/tmux/default-shell.conf b/tests/modules/programs/tmux/default-shell.conf index 473ec0d6f..b3c5bbfee 100644 --- a/tests/modules/programs/tmux/default-shell.conf +++ b/tests/modules/programs/tmux/default-shell.conf @@ -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 diff --git a/tests/modules/programs/tmux/disable-confirmation-prompt.conf b/tests/modules/programs/tmux/disable-confirmation-prompt.conf index 0adb521fb..2074cb2ef 100644 --- a/tests/modules/programs/tmux/disable-confirmation-prompt.conf +++ b/tests/modules/programs/tmux/disable-confirmation-prompt.conf @@ -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 diff --git a/tests/modules/programs/tmux/emacs-with-plugins.conf b/tests/modules/programs/tmux/emacs-with-plugins.conf index 556a682df..841914afb 100644 --- a/tests/modules/programs/tmux/emacs-with-plugins.conf +++ b/tests/modules/programs/tmux/emacs-with-plugins.conf @@ -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 diff --git a/tests/modules/programs/tmux/mouse-enabled.conf b/tests/modules/programs/tmux/mouse-enabled.conf index 2fcd9f54a..814ab8740 100644 --- a/tests/modules/programs/tmux/mouse-enabled.conf +++ b/tests/modules/programs/tmux/mouse-enabled.conf @@ -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 diff --git a/tests/modules/programs/tmux/prefix.conf b/tests/modules/programs/tmux/prefix.conf index 3bc7c63ac..cf7bfcdf3 100644 --- a/tests/modules/programs/tmux/prefix.conf +++ b/tests/modules/programs/tmux/prefix.conf @@ -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 diff --git a/tests/modules/programs/tmux/shortcut-without-prefix.conf b/tests/modules/programs/tmux/shortcut-without-prefix.conf index e3c27610a..1058c5e92 100644 --- a/tests/modules/programs/tmux/shortcut-without-prefix.conf +++ b/tests/modules/programs/tmux/shortcut-without-prefix.conf @@ -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 diff --git a/tests/modules/programs/tmux/vi-all-true.conf b/tests/modules/programs/tmux/vi-all-true.conf index 3bcc51ddd..14b0509f9 100644 --- a/tests/modules/programs/tmux/vi-all-true.conf +++ b/tests/modules/programs/tmux/vi-all-true.conf @@ -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