Skip to content

starship: skip one program invocation on each shell init#8705

Open
anka-213 wants to merge 1 commit intonix-community:masterfrom
anka-213:patch-1
Open

starship: skip one program invocation on each shell init#8705
anka-213 wants to merge 1 commit intonix-community:masterfrom
anka-213:patch-1

Conversation

@anka-213
Copy link
Copy Markdown

@anka-213 anka-213 commented Feb 7, 2026

Description

Same simplification as #2862, but for fish and ion.

Both of the shell's indirect init functions do identical or equivalent as what we do in the module already.

Fish

❯ starship init ion
eval $(starship init ion --print-full-init)
❯ starship init fish
source (starship init fish --print-full-init | psub)

I'm not sure why the fish code using psub instead of just starship init fish --print-full-init | source, but the latter works perfectly fine when I try piping the full init to source.

See also starship/starship#2637 for discussion about this. The indirection for fish was removed and the reverted because it was incompatible with eval (starship init fish), but that isn't relevant for us.

I haven't actually tried the ion simplification, but since the output is identical to the code in this module, I can't imagine that it could possibly break anything

Checklist

  • Change is backwards compatible.

  • Code formatted with nix fmt or
    nix-shell -p treefmt nixfmt deadnix keep-sorted nixf-diagnose --run treefmt.

  • Code tested through nix run .#tests -- test-all or
    nix-shell --pure tests -A run.all.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.
    • Generate a news entry. See News
    • Basic tests added. See Tests
  • If this PR adds an exciting new feature or contains a breaking change.

    • Generate a news entry. See News

Same fix as nix-community#2862, but for fish and ion.

Both of the shell's indirect init functions do exactly what we do here already.
@github-actions github-actions bot added the shell label Feb 7, 2026
@khaneliman
Copy link
Copy Markdown
Collaborator

Please update the tests to match the new behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants