From d2fbf7892725a9748b08eb8fd11f9eea35304fee Mon Sep 17 00:00:00 2001 From: alexion Date: Fri, 24 Jul 2026 14:47:49 -0400 Subject: [PATCH] fix(fish): fit the fastfetch greeting to the terminal width The greeting always drew the full NixOS logo beside the info block, which overflows in a narrow terminal. Choose the logo by column count: the full logo when it fits, the compact one when it does not, and none below that. --- modules/fish/fish.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/fish/fish.nix b/modules/fish/fish.nix index 05d34de..706c232 100644 --- a/modules/fish/fish.nix +++ b/modules/fish/fish.nix @@ -84,7 +84,18 @@ in }; functions = { - fish_greeting = "fastfetch"; + # Pick the logo that fits the terminal so the greeting never wraps: + # the full logo needs about 118 columns beside the info block, the + # compact one about 89, and the info block alone about 71. + fish_greeting = '' + if test "$COLUMNS" -ge 118 + fastfetch + else if test "$COLUMNS" -ge 89 + fastfetch --logo NixOS_small + else + fastfetch --logo none + end + ''; # vi insert mode omits the emacs ctrl-f and ctrl-r bindings, so # restore both.