Get the bash prompt up ~30ms sooner (#13591)

fzf's completion.bash rewraps the completions of ~76 commands on every
interactive shell start, costing ~25ms once bash-completion is loaded. Keep
only the key bindings (Ctrl-R, Ctrl-T, Alt-C); **<Tab> fuzzy completion goes.

`starship init bash` only prints a line that runs starship again with
--print-full-init, so call that directly and start the binary once.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
David Heinemeier HanssonandClaude Opus 5.5 authored and GitHub committed 2026-09-28 21:07:30 +02:00
1 parent b18ab4952b
commit e332dc975d
1 file changed
+3 -4
+3 -4
View File
@@ -3,7 +3,7 @@ if command -v mise &> /dev/null; then
fi
if [[ $- == *i* ]] && [[ ${TERM:-} != "dumb" ]] && command -v starship &> /dev/null; then
eval "$(starship init bash)"
eval "$(starship init bash --print-full-init)"
fi
if command -v zoxide &> /dev/null; then
@@ -18,10 +18,9 @@ if command -v try &> /dev/null; then
}
fi
# Only the key bindings (Ctrl-R, Ctrl-T, Alt-C): fzf's completion.bash rewraps
# ~76 commands' completions on every shell start, adding ~25ms before the prompt.
if command -v fzf &> /dev/null; then
if [[ -f /usr/share/fzf/completion.bash ]]; then
source /usr/share/fzf/completion.bash
fi
if [[ -f /usr/share/fzf/key-bindings.bash ]]; then
source /usr/share/fzf/key-bindings.bash
fi