From 6edfa0320653fd36920df6db787cb945c4a1ea3f Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Sat, 17 Oct 2026 12:40:10 -0400 Subject: [PATCH] starship: disable cmd_duration notifications (root cause of post-TUI lag) --- docs/CHANGELOG.md | 7 +++++++ .../modules/nmasur/presets/programs/starship.nix | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index acd82bf0..babfc8b0 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 2026-10-17: post-TUI lag ROOT CAUSE — starship cmd_duration notifications + +- The first timestamped episode (fish 4.9.3, fresh zellij session) showed fish handling keys in ~1ms, but every prompt took **~2s**, blocked on one child process. After Ctrl-b, prompts dropped to ~50ms. +- Cause: `starship.nix` set `cmd_duration.show_notifications = true` on darwin only (`min_time_to_notify = 30000`). On macOS, sending that notification blocks `starship prompt` for ~2s (measured: 0.03s with `--cmd-duration=100` vs 2.02s with `--cmd-duration=600000`). fish keeps `$CMD_DURATION` until another command actually executes. So after any command over 30s (i.e. every TUI session), every prompt redraw re-sent the notification and froze the shell for 2s: Enter on an empty line, vi mode switches, repaints. +- This explains every observation: macOS-only (Linux had notifications off), "post-TUI" (TUIs are the long commands), and why the toggle "cured" it. Executing *any* command resets `$CMD_DURATION`; autosuggestions were never involved. The 2026-08/09 entries blaming fish autosuggestions, query-term and thread pools were wrong. +- Fix: `show_notifications = false` everywhere. Verified: the real config with a 10-minute duration renders in 0.05s and still shows the duration. + ## 2026-10-17: disable atuin tests - Added `overlays/atuin.nix` to disable atuin 18.23.0's `checkPhase`. Its diff --git a/platforms/home-manager/modules/nmasur/presets/programs/starship.nix b/platforms/home-manager/modules/nmasur/presets/programs/starship.nix index c5f83bff..ff61953f 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/starship.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/starship.nix @@ -42,8 +42,13 @@ in }; cmd_duration = { min_time = 5001; - show_notifications = if pkgs.stdenv.hostPlatform.isLinux then false else true; - min_time_to_notify = 30000; + # Must stay off. On macOS the notification blocks the prompt for ~2s, + # and fish's $CMD_DURATION keeps its value until the next command + # actually runs. So after any long command (every TUI session), + # every prompt redraw -- Enter on an empty line, vi mode switches, + # repaints -- re-sent the notification and froze the shell for 2s. + # That was the "post-TUI typing lag" (see docs/CHANGELOG.md). + show_notifications = false; format = "[$duration]($style) "; }; custom = {