Compare commits

..

No commits in common. "42ab12179e16e7af7e467365d76607d5ae7ca15f" and "bd69e281434f4a4a129b5b08a2e7c287f3aba9b0" have entirely different histories.

3 changed files with 4 additions and 29 deletions

View file

@ -11,19 +11,6 @@ in
enable = my.mkDisableOption "tmux terminal multiplexer";
enablePassthrough = mkEnableOption "tmux DCS passthrough sequence";
trueColorTerminals = mkOption {
type = with types; listOf str;
default = lib.my.nullableToList config.my.home.terminal.program;
defaultText = ''
`[ config.my.home.terminal.program ]` if it is non-null, otherwise an
empty list.
'';
example = [ "xterm-256color" ];
description = ''
$TERM values which should be considered to always support 24-bit color.
'';
};
};
config.programs.tmux = lib.mkIf cfg.enable {
@ -88,14 +75,6 @@ in
set -g allow-passthrough on
''
}
# Force 24-bit color for each relevant $TERM
${
let
mkTcFlag = term: ''set -as terminal-features ",${term}:RGB"'';
in
lib.concatMapStringsSep "\n" mkTcFlag cfg.trueColorTerminals
}
'';
};
}

View file

@ -20,6 +20,8 @@
# I use scripts that use the passthrough sequence often on this host
my.home.tmux.enablePassthrough = true;
# HTerm uses `xterm-256color` as its `$TERM`, so use that here
my.home.tmux.trueColorTerminals = [ "xterm-256color" ];
programs.tmux.extraConfig = ''
# Setup 24-bit color explicitly, as the default terminfo entry does not
set-option -sa terminal-overrides ",xterm-256color:Tc"
'';
}

View file

@ -24,10 +24,4 @@ in
# (any -> value)
# [ any ]
mapFilter = pred: f: attrs: filter pred (map f attrs);
# Transform a nullable value into a list of zero/one element.
#
# nullableToList ::
# (nullable a) -> [ a ]
nullableToList = x: if x != null then [ x ] else [ ];
}