From 532a5d6c74392f6d5381543f44b1d32e7848e901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Mon, 9 Mar 2026 18:16:24 -0700 Subject: [PATCH] feat(home): auto-switch starship to minimal prompt in narrow terminals Add precmd hook that checks $COLUMNS and swaps to minimal starship config when terminal width is under 80 columns. Responds dynamically to terminal resize. Co-Authored-By: Claude Opus 4.6 --- home/programs/zsh.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/home/programs/zsh.nix b/home/programs/zsh.nix index 6adc5a6..c28c548 100644 --- a/home/programs/zsh.nix +++ b/home/programs/zsh.nix @@ -42,6 +42,15 @@ unset STARSHIP_CONFIG } + _prompt_auto_width () { + if [[ $COLUMNS -lt 100 ]]; then + export STARSHIP_CONFIG=''${XDG_CONFIG_HOME:-$HOME/.config}/starship-minimal.toml + else + unset STARSHIP_CONFIG + fi + } + precmd_functions+=(_prompt_auto_width) + if command -v nix-your-shell > /dev/null; then nix-your-shell zsh | source /dev/stdin fi