mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
tmux: Disable confirmation prompt
This commit is contained in:
parent
0db26fc3ab
commit
29824a8cf6
6 changed files with 77 additions and 0 deletions
|
@ -65,6 +65,11 @@ let
|
|||
bind C-${cfg.shortcut} last-window
|
||||
''}
|
||||
|
||||
${optionalString cfg.disableConfirmationPrompt ''
|
||||
bind-key & kill-window
|
||||
bind-key x kill-pane
|
||||
''}
|
||||
|
||||
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}
|
||||
|
@ -109,6 +114,14 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
disableConfirmationPrompt = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
description = ''
|
||||
Disable confirmation prompt before killing a pane or window
|
||||
'';
|
||||
};
|
||||
|
||||
enable = mkEnableOption "tmux";
|
||||
|
||||
escapeTime = mkOption {
|
||||
|
|
|
@ -3,4 +3,5 @@
|
|||
tmux-not-enabled = ./not-enabled.nix;
|
||||
tmux-vi-all-true = ./vi-all-true.nix;
|
||||
tmux-secure-socket-enabled = ./secure-socket-enabled.nix;
|
||||
tmux-disable-confirmation-prompt = ./disable-confirmation-prompt.nix;
|
||||
}
|
||||
|
|
31
tests/modules/programs/tmux/disable-confirmation-prompt.conf
Normal file
31
tests/modules/programs/tmux/disable-confirmation-prompt.conf
Normal file
|
@ -0,0 +1,31 @@
|
|||
# ============================================= #
|
||||
# Start with defaults from the Sensible plugin #
|
||||
# --------------------------------------------- #
|
||||
run-shell @sensible_rtp@
|
||||
# ============================================= #
|
||||
|
||||
set -g default-terminal "screen"
|
||||
set -g base-index 0
|
||||
setw -g pane-base-index 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
set -g status-keys emacs
|
||||
set -g mode-keys emacs
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bind-key & kill-window
|
||||
bind-key x kill-pane
|
||||
|
||||
|
||||
setw -g aggressive-resize off
|
||||
setw -g clock-mode-style 12
|
||||
set -s escape-time 500
|
||||
set -g history-limit 2000
|
||||
|
||||
|
28
tests/modules/programs/tmux/disable-confirmation-prompt.nix
Normal file
28
tests/modules/programs/tmux/disable-confirmation-prompt.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
substituteExpected = path: pkgs.substituteAll {
|
||||
src = path;
|
||||
|
||||
sensible_rtp = pkgs.tmuxPlugins.sensible.rtp;
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
disableConfirmationPrompt = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.tmux.conf
|
||||
assertFileContent home-files/.tmux.conf \
|
||||
${substituteExpected ./disable-confirmation-prompt.conf}
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -21,6 +21,8 @@ set -g mode-keys emacs
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
setw -g aggressive-resize on
|
||||
setw -g clock-mode-style 24
|
||||
set -s escape-time 500
|
||||
|
|
|
@ -21,6 +21,8 @@ set -g mode-keys vi
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
setw -g aggressive-resize on
|
||||
setw -g clock-mode-style 24
|
||||
set -s escape-time 500
|
||||
|
|
Loading…
Reference in a new issue