From ea30328d6bfc77517f578c458e64377f1acad772 Mon Sep 17 00:00:00 2001 From: aaron Date: Sat, 7 Mar 2026 21:06:33 +0100 Subject: [PATCH] feature(zsh): only display a theme with glyphs if the terminal is able to render them --- modules/home-manager/shell.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/home-manager/shell.nix b/modules/home-manager/shell.nix index 1e141f3..0bbbbbe 100644 --- a/modules/home-manager/shell.nix +++ b/modules/home-manager/shell.nix @@ -1,15 +1,25 @@ { config, pkgs, inputs, ... }: { + # configure z-shell to use omz with some plugins programs.zsh = { enable = true; autosuggestion.enable = true; syntaxHighlighting.enable = true; oh-my-zsh = { enable = true; - theme = "agnoster"; + # theme will be set below + theme = ""; plugins = [ "git" "ssh-agent" "gpg-agent" ]; }; + # only display a fancy theme when glyphs are rendered + initExtraBeforeCompInit = '' + if [[ "$TERM" == "linux" || "$TERM" == "screen" ]]; then + ZSH_THEME="gentoo" + else + ZSH_THEME="agnoster" + fi + ''; }; # set important env vars -- 2.47.3