starship: skip one program invocation on each shell init#2862
Merged
berbiche merged 1 commit intonix-community:masterfrom Apr 7, 2022
nagy:starship-init
Merged
starship: skip one program invocation on each shell init#2862berbiche merged 1 commit intonix-community:masterfrom nagy:starship-init
berbiche merged 1 commit intonix-community:masterfrom
nagy:starship-init
Conversation
The code that is being evaled without the `--print-full-init` flag is
this:
```sh
__main() {
local major="${BASH_VERSINFO[0]}"
local minor="${BASH_VERSINFO[1]}"
if ((major > 4)) || { ((major == 4)) && ((minor >= 1)); }; then
source <(/nix/store/...-starship-1.3.0/bin/starship init bash --print-full-init)
else
source /dev/stdin <<<"$(/nix/store/...-starship-1.3.0/bin/starship init bash --print-full-init)"
fi
}
__main
unset -f __main
```
This code checks for bash version >= 4.1 , which has been released in
2009. Since this version is widely unavailable in nixpkgs, we can skip
one program invocation and directly call `starship init bash
--print-full-init`.
teto
pushed a commit
to teto/home-manager
that referenced
this pull request
Aug 22, 2022
…ty#2862) The code that is being evaled without the `--print-full-init` flag is this: ```sh __main() { local major="${BASH_VERSINFO[0]}" local minor="${BASH_VERSINFO[1]}" if ((major > 4)) || { ((major == 4)) && ((minor >= 1)); }; then source <(/nix/store/...-starship-1.3.0/bin/starship init bash --print-full-init) else source /dev/stdin <<<"$(/nix/store/...-starship-1.3.0/bin/starship init bash --print-full-init)" fi } __main unset -f __main ``` This code checks for bash version >= 4.1 , which has been released in 2009. Since this version is widely unavailable in nixpkgs, we can skip one program invocation and directly call `starship init bash --print-full-init`.
spacekookie
pushed a commit
to spacekookie/home-manager
that referenced
this pull request
Feb 10, 2023
…ty#2862) The code that is being evaled without the `--print-full-init` flag is this: ```sh __main() { local major="${BASH_VERSINFO[0]}" local minor="${BASH_VERSINFO[1]}" if ((major > 4)) || { ((major == 4)) && ((minor >= 1)); }; then source <(/nix/store/...-starship-1.3.0/bin/starship init bash --print-full-init) else source /dev/stdin <<<"$(/nix/store/...-starship-1.3.0/bin/starship init bash --print-full-init)" fi } __main unset -f __main ``` This code checks for bash version >= 4.1 , which has been released in 2009. Since this version is widely unavailable in nixpkgs, we can skip one program invocation and directly call `starship init bash --print-full-init`.
anka-213
added a commit
to anka-213/home-manager
that referenced
this pull request
Feb 7, 2026
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.
9 tasks
nagy
added a commit
to nagy/nixpkgs
that referenced
this pull request
Feb 15, 2026
The code that is being evaled without the `--print-full-init` flag is this: ``` eval -- "$(/nix/store/...-starship-1.24.2/bin/starship init bash --print-full-init)" ``` We can skip one program invocation and directly call `starship init bash --print-full-init`. This is a replication of my other PR in home-manager: - nix-community/home-manager#2862
13 tasks
dbeley
pushed a commit
to dbeley/nixpkgs
that referenced
this pull request
Feb 16, 2026
The code that is being evaled without the `--print-full-init` flag is this: ``` eval -- "$(/nix/store/...-starship-1.24.2/bin/starship init bash --print-full-init)" ``` We can skip one program invocation and directly call `starship init bash --print-full-init`. This is a replication of my other PR in home-manager: - nix-community/home-manager#2862
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The code that is being evaled without the
--print-full-initflag is this:This code checks for bash version >= 4.1 , which has been released in 2009. Since this version is widely unavailable in nixpkgs, we can skip one program invocation and directly call
starship init bash --print-full-init.Checklist
Change is backwards compatible.
Code formatted with
./format.Code tested through
nix-shell --pure tests -A run.all.Test cases updated/added. See example.
Commit messages are formatted like
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.
Added myself and the module files to
.github/CODEOWNERS.