Compare commits
3 commits
bd69e28143
...
42ab12179e
| Author | SHA1 | Date | |
|---|---|---|---|
| 42ab12179e | |||
| 3a1ccea142 | |||
| c01f657e8d |
3 changed files with 29 additions and 4 deletions
|
|
@ -11,6 +11,19 @@ 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 {
|
||||
|
|
@ -75,6 +88,14 @@ 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
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@
|
|||
# I use scripts that use the passthrough sequence often on this host
|
||||
my.home.tmux.enablePassthrough = true;
|
||||
|
||||
programs.tmux.extraConfig = ''
|
||||
# Setup 24-bit color explicitly, as the default terminfo entry does not
|
||||
set-option -sa terminal-overrides ",xterm-256color:Tc"
|
||||
'';
|
||||
# HTerm uses `xterm-256color` as its `$TERM`, so use that here
|
||||
my.home.tmux.trueColorTerminals = [ "xterm-256color" ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,4 +24,10 @@ 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 [ ];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue