Files
dotfiles/platforms/home-manager/modules/nmasur/presets/programs/lag-triage/default.nix
T
Noah Masur d4e56dd190 post-TUI lag: autosuggestion culprit confirmed; add self-heal hook
A/B in a live lagging shell: disabling fish_autosuggestion_enabled cures
the lag instantly, and re-enabling does NOT bring it back — the toggle
resets the wedged reader state. __autosuggestion_unwedge (fish_postexec)
now applies that reset after every command, at the moment TUIs exit.
Builtins only, invisible, respects a deliberate manual disable. Flight
recorder stays armed until the hook is proven in real use.

Also from this investigation: wedged-thread evidence (sampler attach
cures), lag-sample tool, flight recorder in the zellij fish wrapper.
2026-09-07 11:17:44 -04:00

48 lines
1.1 KiB
Nix

{
config,
pkgs,
lib,
...
}:
let
cfg = config.nmasur.presets.programs.lag-triage;
term-probe = pkgs.writeScriptBin "term-probe" ''
#!${lib.getExe pkgs.python3}
${builtins.readFile ./term_probe.py}
'';
in
{
options.nmasur.presets.programs.lag-triage.enable =
lib.mkEnableOption "Terminal input-lag triage tools";
config = lib.mkIf cfg.enable {
home.packages = [ term-probe ];
programs.fish.functions = {
lag-triage = {
description = "Diagnose post-TUI typing lag in the current shell";
body = builtins.readFile ./lag-triage.fish;
};
unlag = {
description = "Reset terminal state left behind by a TUI";
body = builtins.readFile ./unlag.fish;
};
lag-sample = {
description = "Stack-sample fish and zellij while typing lag is happening";
body = builtins.readFile ./lag-sample.fish;
};
__autosuggestion_unwedge = {
description = "Reset autosuggestion state after each command to prevent post-TUI typing lag";
onEvent = "fish_postexec";
body = builtins.readFile ./autosuggestion-unwedge.fish;
};
};
};
}