Skip to content

fish: add ~/bin and ~/.local/bin to PATH (fixes missing starship prompt on Linux)#12

Merged
goude merged 1 commit into
mainfrom
claude/relaxed-lovelace-9s5pD
Jun 1, 2026
Merged

fish: add ~/bin and ~/.local/bin to PATH (fixes missing starship prompt on Linux)#12
goude merged 1 commit into
mainfrom
claude/relaxed-lovelace-9s5pD

Conversation

@goude

@goude goude commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Problem

On a Linux box where fish is the login shell (chsh to /usr/bin/fish, reached over SSH), the starship prompt didn't load — fish showed its plain default prompt while bash on the same machine showed starship. The deeper issue: fish never set up PATH, so user-installed tools in ~/bin were invisible.

Root cause

The POSIX/bash/zsh stack gets its PATH from rc.common:

export PATH="$HOME/bin:$HOME/.local/bin:$PATH"

Fish had no equivalent — the only PATH code in fish config was the macOS-only Homebrew brew shellenv block. So a fish login shell on Linux started with the bare PAM//etc/environment PATH, which lacks ~/bin.

setup/tools.sh installs starship to ~/bin. With ~/bin off PATH, type -q starship in config.fish was false, so the starship init block was silently skipped and fish fell back to its built-in default prompt.

This was easy to misdiagnose because a fish -ic subshell spawned from bash inherits bash's PATH (which does have ~/bin), so it found starship — making config.fish look correct. macOS works because starship is reachable there via Homebrew (/opt/homebrew/bin, added by the brew block).

Confirmed with a clean login-like environment:

BEFORE: starship NOT found  <-- the bug
AFTER fish_add_path:  starship FOUND -> /home/<user>/bin/starship

Change

  • Add home/.config/fish/conf.d/path.fish — uses fish_add_path -gp $HOME/bin $HOME/.local/bin so fish owns its PATH setup, mirroring rc.common. conf.d/ loads before config.fish, so PATH is ready before the starship block runs. -g keeps it config-driven and reproducible (no per-host universal vars); fish_add_path is idempotent.
  • Remove home/.config/fish/functions/fish_prompt.fish — it was a verbatim copy of fish's built-in default prompt, only relevant as a fallback when starship is absent (and identical to fish's built-in default). It was a red herring during diagnosis and is dead weight.

Deploy / verify

After merge, on the Linux box:

homeshick pull dotfiles && homeshick link dotfiles
exec fish    # or reconnect SSH

Then a fresh login fish shows the starship prompt and echo $PATH includes ~/bin and ~/.local/bin.

No setup/*.sh scripts changed, so just lint (shellcheck) is unaffected.

https://claude.ai/code/session_01MWWuGHpDryzmyVdGGVvtZ1


Generated by Claude Code

Fish never set up PATH the way the bash/zsh stack does. rc.common prepends
"$HOME/bin:$HOME/.local/bin" to PATH, but fish's config had no equivalent —
only the macOS-only Homebrew shellenv block.

On Linux where fish is the login shell (e.g. SSH after chsh to fish), the
login PATH lacks ~/bin, so tools installed there are invisible. starship
(installed to ~/bin by setup/tools.sh) couldn't be found, so `type -q
starship` in config.fish was false and the prompt block was silently
skipped — fish fell back to its default prompt instead of starship.

Add conf.d/path.fish using fish_add_path so fish owns its PATH setup,
mirroring rc.common. conf.d loads before config.fish, so PATH is ready
before the starship block runs.

Also drop functions/fish_prompt.fish: it was a verbatim copy of fish's
built-in default prompt and only mattered as a fallback when starship was
absent. It is redundant (fish's built-in default is identical) and was a
red herring while diagnosing the missing prompt.

https://claude.ai/code/session_01MWWuGHpDryzmyVdGGVvtZ1
@goude goude merged commit b6f521a into main Jun 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants