Skip to content

Commit 830c4df

Browse files
committed
Restore fish startup timing prompt
1 parent 8418a06 commit 830c4df

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

dot_config/fish/conf.d/00-env.fish

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,16 @@ if set -q MANPATH[1]
2727
set -gx MANPATH "" $MANPATH
2828
end
2929

30-
# Prefer a terminal-provided startup timestamp so Fish startup avoids extra
31-
# subprocesses just to measure prompt latency.
30+
# Prefer a terminal-provided startup timestamp. Fall back to a one-time
31+
# timestamp capture so the initial Starship right prompt can still show shell
32+
# startup duration outside terminal wrappers like Ghostty.
33+
if status is-interactive; and not set -q __BRADEN_SHELL_START_REAL
34+
if command -q perl
35+
set -gx __BRADEN_SHELL_START_REAL (command perl -MTime::HiRes=time -e 'printf "%.6f\n", time')
36+
else if command -q python3
37+
set -gx __BRADEN_SHELL_START_REAL (command python3 -c 'import time; print(f"{time.time():.6f}")')
38+
end
39+
end
3240

3341
if test -d /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home
3442
set -gx JAVA_HOME /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home

0 commit comments

Comments
 (0)