Compare commits

...

6 commits

Author SHA1 Message Date
8987085494 WIP: xterm.js
All checks were successful
ci/woodpecker/push/check Pipeline was successful
2025-04-17 09:58:45 +00:00
29ae755d41 [2] WIP: home: tmux: fix undercurl rendering
All checks were successful
ci/woodpecker/push/check Pipeline was successful
2025-04-16 21:28:17 +01:00
ecd65c5e86 home: tmux: fix undercurl rendering 2025-04-16 21:28:17 +01:00
7c52c6a6d4 home: tmux: refactor 'mkTerminalFlags'
I'm about to add a similar helper for `terminal-overrides`, hence making
`mkTerminalFlags` the helper and `mkTerminalFeatures` the new function.
2025-04-16 21:28:17 +01:00
19ba9e9442 hosts: homes: bazin: fix terminal name
Turns out I *can* use a more accurate terminfo entry for HTerm.

This fixes undercurl rendering in that terminal.
2025-04-16 21:28:17 +01:00
ea5d240d83 hosts: homes: mousqueton: fix terminal name
Turns out I *can* use a more accurate terminfo entry for HTerm.

This fixes undercurl rendering in that terminal.
2025-04-16 21:28:17 +01:00
3 changed files with 36 additions and 8 deletions

View file

@ -13,8 +13,10 @@
enablePassthrough = true;
terminalFeatures = {
# HTerm uses `xterm-256color` as its `$TERM`, so use that here
xterm-256color = { };
# HTerm configured to use a more accurate terminfo entry than `xterm-256color`
hterm-256color = { };
# Terminal app uses `xterm.js`, not HTerm
"xterm.js" = { };
};
};

View file

@ -19,8 +19,10 @@
enableResurrect = true;
terminalFeatures = {
# HTerm uses `xterm-256color` as its `$TERM`, so use that here
xterm-256color = { };
# HTerm configured to use a more accurate terminfo entry than `xterm-256color`
hterm-256color = { };
# Terminal app uses `xterm.js`, not HTerm
"xterm.js" = { };
};
};
};

View file

@ -6,13 +6,16 @@ let
(config.my.home.wm.windowManager != null)
];
mkTerminalFlags = opt: flag:
mkTerminalFlags = tmuxVar: opt: flag:
let
mkFlag = term: ''set -as terminal-features ",${term}:${flag}"'';
mkFlag = term: ''set -as ${tmuxVar} ",${term}:${flag}"'';
enabledTerminals = lib.filterAttrs (_: v: v.${opt}) cfg.terminalFeatures;
terminals = lib.attrNames enabledTerminals;
in
lib.concatMapStringsSep "\n" mkFlag terminals;
mkTerminalFeatures = mkTerminalFlags "terminal-features";
mkTerminalOverrides = mkTerminalFlags "terminal-overrides";
in
{
options.my.home.tmux = with lib; {
@ -28,6 +31,8 @@ in
hyperlinks = my.mkDisableOption "hyperlinks through OSC8";
trueColor = my.mkDisableOption "24-bit (RGB) color support";
underscoreStyle = my.mkDisableOption "underscore style/color support";
};
});
@ -54,6 +59,20 @@ in
terminal = "tmux-256color"; # I want accurate termcap info
aggressiveResize = true; # Automatic resize when switching client size
# FIXME
# * Sixel support
# * OSC 133 prompt integration
# FIXME: when sensible-on-top is disabled: check if any of those are unset
# * tmux bind-key $prefix_without_ctrl last-window
# *
# * tmux bind-key C-b send-prefix: included
# * aggressive resize? done
# * tmux bind-key C-p previous-window: done
# * tmux bind-key C-n next-window: done
# * C-r to refresh my config: done
# * tmux set-option -g focus-events on: done
# FIXME: make PRs for `bind-key` description
plugins = with pkgs.tmuxPlugins; builtins.filter (attr: attr != { }) [
# Open high-lighted files in copy mode
open
@ -123,9 +142,14 @@ in
}
# Force OSC8 hyperlinks for each relevant $TERM
${mkTerminalFlags "hyperlinks" "hyperlinks"}
${mkTerminalFeatures "hyperlinks" "hyperlinks"}
# Force 24-bit color for each relevant $TERM
${mkTerminalFlags "trueColor" "RGB"}
${mkTerminalFeatures "trueColor" "RGB"}
# Force underscore style/color for each relevant $TERM
${mkTerminalFeatures "underscoreStyle" "usstyle"}
# FIXME: see https://github.com/folke/tokyonight.nvim#fix-undercurls-in-tmux for additional overrides
# ${mkTerminalOverrides "underscoreStyle" "Smulx=\\E[4::%p1%dm"}
# ${mkTerminalOverrides "underscoreStyle" "Setulc=\\E[58::2::::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m"}
'';
};
}