From a0b044dbc9208a174686255917c8f4ee607b4670 Mon Sep 17 00:00:00 2001 From: imxyy_soope_ Date: Thu, 24 Jul 2025 21:48:13 +0800 Subject: [PATCH] feat(starship): speedup jj prompt --- modules/cli/shell/zsh.nix | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/modules/cli/shell/zsh.nix b/modules/cli/shell/zsh.nix index 6921816..d213e7f 100644 --- a/modules/cli/shell/zsh.nix +++ b/modules/cli/shell/zsh.nix @@ -44,11 +44,11 @@ lib.my.makeSwitch { jj = { ignore_timeout = true; description = "The current jj status"; - when = "jj root"; - symbol = " "; + when = true; command = '' jj log --revisions @ --no-graph --ignore-working-copy --color always --limit 1 --template ' separate(" ", + " ", change_id.shortest(4), bookmarks, "|", @@ -64,19 +64,9 @@ lib.my.makeSwitch { "(no description set)", ) ++ raw_escape_sequence("\x1b[0m"), ) - ' + ' || (starship module git_branch && starship module git_status) ''; }; - git_branch = { - when = true; - command = "jj root >/dev/null 2>&1 || starship module git_branch"; - description = "Only show git_branch if we're not in a jj repo"; - }; - git_status = { - when = true; - command = "jj root >/dev/null 2>&1 || starship module git_status"; - description = "Only show git_status if we're not in a jj repo"; - }; }; git_state.disabled = true; git_commit.disabled = true;