* refactor(bash): use `STARSHIP_*` for the internal variable names
The current codebase uses `dbg_trap` to save the original DEBUG trap
in bash <= 4.3. However, the variable name possibly conflicts a user
variable since it is not prefixed by `_starship` or `starship_` or
`STARSHIP_`. In this patch, we rename `dbg_trap` to
`STARSHIP_DEBUG_TRAP` following other variables of
`STARSHIP_EXIT_STATUS` and `STARSHIP_PIPE_STATUS`. We also rename the
variable `_PRESERVED_PROMPT_COMMAND` to `STARSHIP_PROMPT_COMMAND`.
* fix(bash): correctly extract DEBUG trap with spaces
* fix(bash): evaluate DEBUG trap by eval
The current code executes the saved DEBUG trap just by
$_starship_dbg_trap. This causes various problems. The content of
the variable `_starship_dbg_trap` is unexpectedly subject to the word
splitting with the pathname expansions. Also, the needed shell
expansions and quote removal are not performed. With a custom IFS,
the content of the variable will be split in an unexpected way. The
saved DEBUG trap needs to be executed by eval "$_starship_dbg_trap".
* feat(k8s): Add detect env vars option
Have added the option to trigger the k8s module based on what env vars
are set, this has been done in a backwards compatible way so if nothing
is changed from the defaults the module will still behave the same way
as before. This is similar to what I did in #4486 for the python module
and if goes well I'd like to rollout to other modules.
* Update src/modules/kubernetes.rs
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Update src/modules/kubernetes.rs
---------
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* combine ANSI color codes before wrapping them
The existing code wraps each individual module's output for
`context.shell`, concatenates all that output together and passes it to
`AnsiStrings` to merge ANSI color codes. However, the wrapping obscures
ANSI color codes, meaning that no merging is possible.
This commit changes the shell-specific wrapping to happen right before
output, once all modules' output has been concatenated together. This
results in ANSI color codes being correctly merged, as well as reducing
the number of calls to `wrap_colorseq_for_shell` to one.
With a minimal `starship.toml`:
```
format = """$directory"""
[directory]
format = '[a]($style)[b]($style)'
```
The current code produces[0]:
```
\n%{\x1b[31m%}a%{\x1b[0m%}%{\x1b[31m%}b%{\x1b[0m%
```
And this commit's code:
```
\n%{\x1b[31m%}ab%{\x1b[0m%}
```
You can see that the current code emits an additional reset and repeated
color code between "a" and "b" compared to the new code.
[0] Produced in a Python shell with:
```
subprocess.check_output(
"./target/debug/starship prompt", shell=True,
env={"STARSHIP_CONFIG": "./starship.toml", "STARSHIP_SHELL": "zsh"}
)
```
* utils: return early from wrap_seq_for_shell unless wrapping required
* refactor(utils): simplify wrap_seq_for_shell
This commit modifies wrap_seq_for_shell to (a) return early for shells
with no wrapping required, and (b) determine the wrapping characters
once at the start of the function (rather than inline in the map
function for every character).
* Create place to put it in the config
* Initial functional version
* Fix grammar
* Add option documentation to README
* Add test for two aliases and emoji translation
* Remove println
* Rewrite match as iflet
* Improve converting the reference
* Format file
* Try to restore autoformat of markdown
* Replace toml:Map with concrete IndexMap
* Update schema
* Add option that got lost
* Add Odin lang module
* add utils string and remove commit number from output
* switch to new symbol because ZWJ support is rare
* add config docs
* add option to show the commit number
* fix lack of trimming
* fix formatting to comply with checks
* Add trailing newline to comply with cargo fmt
* Add new Odin test and add newline in cmd output
Resolve#5847 by initializing `$env.STARSHIP_SHELL` before calling `starship`
Most minimal change possible. Other simplification are possible but not know to be
backwards compatible. Also considered `with-env` or `STARSHIP_SHELL=nu starship` but
they'd be worse. Happy to reformat indentation if desired.
* Added the option "detect_env_vars" to the `username` module
with the same functionality as in the `hostname` module.
* Fixed logic error and added test to catch it
* build(deps): update dependency vitepress to ^1.0.0-rc.45
* build(deps): update rust crate shadow-rs to 0.27.1
* Added the option "detect_env_vars" to the `username` module
with the same functionality as in the `hostname` module.
* Fixed logic error and added test to catch it
* Removed unused gix import
* Removed unused gix import, again
* Removed unused gix import. Next try
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
docs(python): Remove a bad config example in the python
Running a unknown binary in a subfolder (called `.venv/bin/python`) has at least two drawbacks with some security implication:
- In case of a unknown directory, simply cd'ing into a subdirectory could lead to starship executing a unknown binary (usually the binary MUST be in path so it's a decision taken by the user, e.g. by activating the venv)
- starship would show the result of the venv python even if the venv is not active but calling `python3` on the cli would NOT run that `python3` in the venv but a different one (most likely the system python3).
* feat(docs): move to vitepress
* change up hero styles to match existing site
* A bit more style tweaking
* Replace stylus with plain CSS
* improve unicode-range value for nerdfont
---------
Co-authored-by: Matan Kushner <hello@matchai.dev>
* Support right prompt in bash
* Docs for transience in bash
* Apply suggestions from review
* Simplify conditional
* Use ble.sh hooks, if available
* Properly quote args
* Use BLE_PIPESTATUS
* Update starship.bash
* Update src/init/starship.bash
Co-authored-by: Koichi Murase <myoga.murase@gmail.com>
---------
Co-authored-by: Koichi Murase <myoga.murase@gmail.com>
* update AllowStatus to work with direnv 2.33
direnv now returns int enum instead of boolean, https://github.com/direnv/direnv/pull/1158
* update schema
* maybe fixed the schema now
* Whoops, I inverted the flags somehow
* have coffee, fix mistaken understanding
* undo changes to tranlations
* Update docs/config/README.md
* Update src/modules/direnv.rs
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* update test output
---------
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* do not detect R for .Rprofile files, closes#2817
* get R package version, #5586
* update schema
* fix and simplify regex for rlang package version
* attempt to fix regex
* proper detect R packages, closes#5590
* reduce diff vs master branch
* docs(config): add quote to unquoted strings
Add quote to unquoted strings
There are some unquoted default value strings in module's "options" table
* docs(config): Unify quotes in Option table
some strings in modules' "options" table are wrapped in single quotes, some are
wrapped in double quotes,
standardize them to be wrapped in single quotes
* docs(config): Format file using dprint
* fix: Do not install with snap-curl
Snap-installed curl doesn't work: when trying to download files from
GitHub, it either fails to download the file, or fails to write the
output at all.
Prevent a curl program which is installed with snap from being used to
download starship.
* Update install.sh
* Minor changes to formatting and wording
* fix: Change how starship version is determined
* Add STARSHIP_VERSION envar into CI for notarization
* More strict!
* Supress pushd/popd output
* Fix shellcheck issue with quoting
* Added hostname.detect_env_vars
based on the newly added context::detect_env_vars
- extended context::detect_env_vars to check for negated environment
variables as well, analogous to the other detect modules
- made hostname.detect_env_vars only active if ssh_only is set to false
for backwards compatibility
Co-authored-by: Dominik Sander <dsander@users.noreply.github.com>
* added clippy recommendations, removed unneeded comments
* Added new logic (suggested in https://github.com/starship/starship/pull/5196#issuecomment-1566228913)
The new `detect_env_vars` now requires either SSH_ONLY to be false or the
environment variable SSH_CONNECTION to be set, so that is will be used
* Fixed typo
* Refactored the detect_env_vars function for early returns and better readability
* Change boolean logic for better readability
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Apply suggestions from code review to `detect_env_vars` method.
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Fixed bracket error & updated comments
- fixed bracket error in hostname.rs, after changes
- updated comments for context.rs, for the suggested changes
* Removed obsolete warning from docs/config/README.md
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
---------
Co-authored-by: Dominik Sander <dsander@users.noreply.github.com>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* feat(kubernetes): Add styling based on current context
Add an ability to customize the configuration of the kubernetes module style, based on the current context.
A new variable is added to the config section, called environments, which is a list of possible customizations. Each such customization is an object with a context_pattern regex, which matches context name, and an optional style and icon that will override the global configuration, if the currently used context matched the context_pattern.
Based on multiple attempts to add per-context styling and symbols to the kubernetes module.
- https://github.com/starship/starship/pull/1568 by @lht https://github.com/lht -> base
- https://github.com/starship/starship/pull/614 by @nomaed https://github.com/nomaed -> naming, symbol, some tests
Rebased and combined by @jankatins
Contains the following squasched commits
- Rename to contexts and move aliases into contexts
- Move deprecated functions to a submodule
- Cleanup: ignore None-valued KubeCtxComponents
- Add regex func + clean up matching-context search
- Placate paper clip
Closes: https://github.com/starship/starship/issues/570
Co-authored-by: =?UTF-8?q?Boris=20Aranovic=CC=8C?= <nomaed@gmail.com>
Co-authored-by: Jan Katins <jasc@gmx.net>
Co-authored-by: Kevin Song <chips@ksong.dev>
* refactor(kubernetes): Remove options and use clearer names
* test(kubernetes): Handle duplicated contexts right
* refactor(kubernetes): Cleaner user matching
* fix(kubernetes): Only show warning in case of problems
* feat(kubernetes): Add back alias replacements
* refactor(kubernetes): Cleanup rust usage
---------
Co-authored-by: Haitao Li <lihaitao@gmail.com>
Co-authored-by: =?UTF-8?q?Boris=20Aranovic=CC=8C?= <nomaed@gmail.com>
Co-authored-by: Kevin Song <chips@ksong.dev>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* feat(fossil_metrics): add fossil_metrics module
* Return early if not in a Fossil check-out
* Add more tests for fossil_metrics
* Move is in Fossil checkout check after module enabled check
* Update type for new toml version
* Update the config file schema
* Rework parsing of fossil diff output
* Fix Fossil check-out detection in subdirectories
* Use regex to only match expected fossil diff output
* Use shared ancestor scanning and fix detection on Windows
* Add note on minimum Fossil version
* build(deps): update clap crates
* build(deps): update rust crate notify-rust to 4.7.1
* build(deps): update rust crate shadow-rs to 0.20.1
* build(deps): update rust crate git-features to 0.26.5
* build(deps): update rust crate notify-rust to 4.8.0
* docs(kubernetes): Remove extra backspace from regex in example (#4905)
Remove extra backspace from regex in example
In the example, `[\\w-]` would match a literal backspace `\`, the
character `w` or a dash `-`. By removing the backspace, instead it
matches any "word character" `\w` or a dash `-`.
* docs(i18n): new Crowdin updates (#4877)
* chore: use updated gitoxide crate names (#4913)
* build(deps): update rust crate gix to 0.37.1
* build(deps): update rust crate toml_edit to 0.19.4
* docs(install): update nushell instructions in installation script (#4921)
Improve Nushell installation instruction
Consistently use `save -f` rather than `save`; the latter fails if the
file already exists
Signed-off-by: Michel Alexandre Salim <michel@michel-slm.name>
* build(deps): update rust crate clap_complete to 4.1.3
* build(deps): update rust crate gix to 0.37.2
* docs(i18n): new Crowdin updates (#4925)
* chore(master): release 1.13.0 (#4730)
* build(deps): update rust crate tempfile to 3.4.0
* fix: trigger release
* chore(master): release 1.13.1 (#4937)
* ci: set Node version for docs build
* ci: allow docs to be manually published via workflow_dispatch
* ci: remove unneeded dependency in publish job
* ci: add caching for docs publishing step
* build(deps): update rust crate schemars to 0.8.12
* build(deps): update dprint plugins
* build(deps): update rust crate shadow-rs to 0.21.0
* build(deps): update clap crates
* feat(release): handle chocolatey starship.portable and starship.install pkg publishing (#4723)
Handles starship.install (MSI installer) and starship.portable and makes starship an
empty meta-package that only depends on starship.install. MSI/installer packages
seem to be preferred over zip-based installers on chocolatey. Proper virtual packages
that allow choosing either a portable or install variant aren't implemented in chocolatey yet.
* ci: replace `audit` with `deny` action (#4856)
* build(deps): update rust crate clap to 4.1.8
* build(deps): update gitoxide crates
* ci: use `reviewdog/action-suggester` for config-schema check (#4857)
* ci: use `reviewdog/action-suggester` for config-schema check
* increase workflow permissions
* fix(preset): add output-flag to avoid encoding issues (#4926)
* build(deps): update rust crate rayon to 1.7.0
* build(deps): update gitoxide crates
* build(deps): update pest crates to 2.5.6
* build(deps): update rust crate serde_json to 1.0.94
* build(deps): update npm to ^1.9.9
* build(deps): update rust crate open to 3.4.0
* docs(character): use updated `vimcmd_symbol` instead of older `vicmd_symbol` variant (#4960)
Fix typo in character example
* build(deps): update rust crate serde to 1.0.153
* docs(install): fix typo and update indentation and whitespaces (#4941)
* build(deps): update rust crate serde to 1.0.154
* build(deps): update rust crate gix to 0.40.0
* chore: fix clippy warnings for rust 1.68 (#4983)
* fix(init): avoid cygpath for starship binary path (#4970)
Update mod.rs
* build(deps): update rust crate open to v4 (#4982)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* build(deps): update rust crate toml_edit to 0.19.5
* build(deps): update rust crate gix to 0.41.0 (#4984)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* build(deps): update rust crate serde to 1.0.155
* build(deps): update rust crate chrono to 0.4.24
* build(deps): update rust crate semver to 1.0.17
* build(deps): update rust crate quick-xml to 0.28.0
* Update sponsors
* build(deps): update toml crates
* build(deps): update rust crate nu-ansi-term to 0.47.0
* build(deps): update rust crate windows to 0.46.0
* build(deps): update rust crate serde to 1.0.156
* docs(preset): Add `hostname.ssh_symbol` to nerd font preset (#4991)
docs(preset): Add missing ssh_symbol in nerd font
* fix(fossil_branch): fossil checkout database file name on windows (#4978)
fix(fossil_branch): use proper fossil checkout database file name on windows
* build(deps): update gitoxide crates
* build(deps): update rust crate toml_edit to 0.19.7
* build(deps): update clap crates
* build(deps): update rust crate serde to 1.0.157
* build(deps): update rust crate quick-xml to 0.28.1
* build(deps): update rust crate clap to 4.1.11
* docs(preset): add missing config for Java to no-runtime-version (#5011)
docs(preset): add missing Java to no-runtime-version
* build(deps): update rust crate serde to 1.0.158
* feat(aws): Adds support for AWS_CREDENTIAL_EXPIRATION environment variable (#5002)
feat(aws): supports AWS_CREDENTIAL_EXPIRATION environment variable
Adds support for the AWS_CREDENTIAL_EXPIRATION environment variable
which was adopted as the standard way to set the expiration for
temporary credentials. The existing AWS_SESSION_EXPIRATION environment
variable is not dropped for backwards compatibility.
See https://github.com/aws/aws-cli/pull/7398
* build(deps): update rust crate open to 4.0.1
* build(deps): update rust crate regex to 1.7.2
* chore: add spell checker to workflows (#4975)
* chore: add spell checker to workflows
* fix: update config schema
* fix: revert for fennel.rs
* build(deps): update rust crate toml_edit to 0.19.8
* build(deps): update crate-ci/typos action to v1.14.3
* build(deps): update rust crate clap to 4.1.13
* build(deps): update embarkstudios/cargo-deny-action action to v1.5.0
* build(deps): update rust crate gix to 0.43.0
* fix(gradle): add support for unstable Gradle versions (#5021)
* build(deps): update rust crate serde_json to 1.0.95
* docs: Update nerd-font-symbols.toml pop_os! symbol (#5017)
Update nerd-font-symbols.toml
Use the specific pop_os! nerd symbol instead of the generic lollipop
* build(deps): update clap crates
* build(deps): update rust crate regex to 1.7.3
* build(deps): update rust crate serde to 1.0.159
* build(deps): update rust crate indexmap to 1.9.3
* build(deps): update clap crates to 4.2.0
* build(deps): update rust crate tempfile to 3.5.0
* build(deps): update rust crate windows to 0.47.0
* build(deps): update rust crate clap to 4.2.1
* build(deps): update rust crate gix to 0.43.1
* build(deps): update rust crate windows to 0.48.0
* fix(pulumi): Fix formatting on pulumi module when using version (#5038)
Fix formatting on pulumi module when using version
Sanitize `pulumi version` output to remove leading 'v' character and trailing
newlines.
* feat(fossil): detection of Fossil check-outs in subdirectories (#4910)
* Move PathExt::device_id() outside modules module
* Add upwards_sibling_scan-function
* Fix Fossil check-out detection in subdirectories
* Use shared upwards scanning function in hg_branch
* Let the caller specify if they're looking for a file or a folder
* fix merge
---------
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* feat(aws): add support for source_profile (#4859)
feat(aws): add support for source_profile (#3834)
Co-authored-by: @luiscamaral
* feat(custom): add option to check if pwd is in a repo (#4822)
* feat(custom): add option to check if pwd is in a repo
* Apply suggestions from code review
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* change whenrepo to require_repo
* chore: fix doc formatting
---------
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* build(deps): update rust crate terminal_size to 0.2.6
* build(deps): update rust crate process_control to 4.0.3 (#5046)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* build(deps): update pest crates to 2.5.7 (#5043)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* build(deps): update crate-ci/typos action to v1.14.4
* docs(presets): add azure and gcloud default symbols to plaintext preset (#5040)
* chore(nu): use updated closure syntax (#5054)
Update starship.nu to conform to Nushell changes
Nushell recently made a change to require that all closures have an explicit parameter list, even if it's empty, in https://github.com/nushell/nushell/pull/8290.
This updates starship.nu to conform to this requirement.
I have casually tested this against both the latest released version of Nushell, and the latest version on HEAD; the changed code works well (for me) on both.
* build(deps): update crate-ci/typos action to v1.14.5
* build(deps): update embarkstudios/cargo-deny-action action to v1.5.1
* fix(java): wrong version number when using Android Studio JDK (#4966)
The regular expression would get the revision number found in:
with gcc Android (7284624, based on r416183b)
so it would print "7284624".
* build(deps): update dprint plugins
* build(deps): update rust crate os_info to 3.7.0 (#5057)
* build(deps): update rust crate os_info to 3.7.0
* add new os symbols
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* docs(i18n): new Crowdin updates (#4956)
* chore(master): release 1.14.0 (#4948)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* fix: trigger release
* fix: bootstrap manifest for release-please (#5087)
* fix: update the release-please manifest
* chore: fix release-please-manifest version
* ci: Revert "fix: bootstrap manifest for release-please (#5087)"
This reverts commit e392d14f4e.
* chore(master): release 1.14.1 (#5090)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* ci: add missing GH token to doc publishing flow
* build(deps): update rust crate serde to 1.0.160
* docs: update snap instructions (#5007)
As part of #4954, non-edge packages of Starship were removed from Snapcraft. This means the only way to install Starship is through the `edge` channel using `snap install --edge starship`.
* fix(git_commit): resolve panic on 32-bit targets (#5095)
* chore(choco): remove chocolatey dependency (#5078)
* docs(i18n): new Crowdin updates (#5093)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations tokyo-night.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations bracketed-segments.md (Ukrainian)
* New translations nerd-font.md (Ukrainian)
* New translations no-runtimes.md (Ukrainian)
* New translations plain-text.md (Ukrainian)
* New translations pure-preset.md (Ukrainian)
* New translations pastel-powerline.md (Ukrainian)
* New translations no-nerd-font.md (Ukrainian)
* New translations no-empty-icons.md (Ukrainian)
* New translations README.md (French)
* New translations README.md (Russian)
* New translations README.md (Spanish)
* New translations README.md (Arabic)
* New translations README.md (German)
* New translations README.md (Italian)
* New translations README.md (Japanese)
* New translations README.md (Korean)
* New translations README.md (Dutch)
* New translations README.md (Polish)
* New translations README.md (Portuguese)
* New translations README.md (Turkish)
* New translations README.md (Chinese Simplified)
* New translations README.md (Chinese Traditional)
* New translations README.md (Vietnamese)
* New translations README.md (Portuguese, Brazilian)
* New translations README.md (Indonesian)
* New translations README.md (Sorani (Kurdish))
* New translations README.md (Ukrainian)
* New translations README.md (Norwegian)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations README.md (Ukrainian)
* New translations bracketed-segments.md (Ukrainian)
* New translations nerd-font.md (Ukrainian)
* New translations no-runtimes.md (Ukrainian)
* New translations plain-text.md (Ukrainian)
* New translations pure-preset.md (Ukrainian)
* New translations pastel-powerline.md (Ukrainian)
* New translations no-nerd-font.md (Ukrainian)
* New translations no-empty-icons.md (Ukrainian)
* New translations tokyo-night.md (Ukrainian)
* New translations README.md (Ukrainian)
* chore(master): release 1.14.2 (#5098)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* build(deps): update embarkstudios/cargo-deny-action action to v1.5.2
* build(deps): update rust crate quick-xml to 0.28.2
* build(deps): update rust crate serde_json to 1.0.96
* build(deps): update rust crate starship-battery to 0.8.0 (#5106)
* build(deps): update rust crate gethostname to 0.4.2
* feat: add typechange to git_status module (#4829)
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* feat(azure): subscription name aliases (#4949)
* From issue #4448, added `subscription_aliases`
as a field for the Azure module
Can be set in starship.toml with
[azure.subscription_aliases]
* Updated config file schema
* Added entry into documentation
* Update README.md
* Formatted with dprint
* feat(git_metrics): add option to ignore submodules (#5052)
* add docs
* update schema
* ok, actually update schema
* add test
* fix lint
* accidentally included my .devenv directory
* feat: Add Solidity Module (#5047)
* Adding documentation
* Documentation and schema addition
* Creating solidity config
* Module for solidity lang
* Updating all the files
* Changing according to clippy
* Fixing misspellings
* Changes suggested by clippy
* Updating schema , maybe fixing docs workflow error
* Updating schema
* Removing solcjs from default compiler list
* Fallback test added and test string fixed
* Fixing docs
* Updating schema
* Updating schema
* Fixing docs
* Updating schema
* Updating schema
* Typo fix
* Update docs/config/README.md
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Update src/utils.rs
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Fix build commit
---------
Co-authored-by: Anirban Halder <shaeo967@gmail.com>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* build(deps): update crate-ci/typos action to v1.14.6
* build(deps): update rust crate clap to 4.2.2
* fix(config): Make print-config not panic without a config (#5001)
* build(deps): update rust crate open to 4.0.2
* build(deps): update rust crate clap to 4.2.3
* build(deps): update rust crate gix-features to 0.29.0
* build(deps): update crate-ci/typos action to v1.14.8
* build(deps): update rust crate clap to 4.2.4
* build(deps): update rust crate dunce to 1.0.4
* build(deps): update rust crate regex to 1.8.0
* build(deps): update rust crate clap_complete to 4.2.1
* build(deps): update rust crate regex to 1.8.1
* docs(pwsh): use a more convenient method to update the window title (#5125)
docs: fix PowerShell example to update the window title
* fix(style): ensure nested style variables are processed during formatting (#5120)
fix: ensure nested style variables are processed during formatting
* refactor(Context): `set_config` method for `Context` (#5079)
* add `set_config` method to `Context`
* Made inline comment a doc comment
* use `default_context()` for `set_config()` test
* use `set_config()` in tests for `print.rs`
* set root config w `set_config()` (`print.rs` test)
* build(deps): update rust crate home to 0.5.5
* build(deps): update pest crates to 2.6.0
* build(deps): update rust crate open to 4.1.0
* build(deps): upgrade gitoxide to v0.44 for performance improvements during discovery (#5141)
upgrade gitoxide to v0.44 for performance improvements during discovery
Please note that there is a new `dot_git_only` option which would further
speedup discovery. On even moderatly fast disks that probably not going
to make a difference, but it will on incredibly slow (networked) disks.
See https://github.com/helix-editor/helix/issues/6867 for reference.
* fix(snap): Update snapcraft.yaml to add personal-files interface (#5131)
* build(deps): update rust crate clap to 4.2.5
* docs: add Ukranian to the project README (#5147)
* Specify personal-file interface for snap
* fix(presets): Added ($style) to format in module 'sudo' in Bracketed Segments Preset (#5146)
* Fixed error in module 'sudo'
There was no ($style) in format. When module enabled this lead to the error [WARN] - (starship::modules::sudo): Error in module `sudo`
* Update docs/.vuepress/public/presets/toml/bracketed-segments.toml
typo fix
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
---------
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* ci: remove actions-rs actions (#5115)
* build(deps): update rust crate clap to 4.2.7
* build(deps): update crate-ci/typos action to v1.14.9
* build(deps): update rust crate serde to 1.0.162
* build(deps): update rust crate rust-ini to 0.19.0 (#5172)
* build(deps): update rust crate rust-ini to 0.19.0
* add CC0-1.0 to allowed license list
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* build(deps): update rust crate versions to v5 (#5176)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* feat(aws): support aws sso with automatic authentication refresh (#5170)
* feat(aws): support aws sso with automatic authentication refresh
* docs(aws): add sso_session for profile detection
* feat(gcloud): add `detect_env_vars` option (#5166)
* feat(gcloud): add `detect_env_vars` option
* regenerate config schema
* docs: update CONTRIBUTING.md and README.md (#5153)
* build(deps): update rust crate clap_complete to 4.2.2
* fix: update of presets and default configuration to reflect changes in Nerd Fonts 3.0 (#5162)
* Updated nf-mdi-* to nf-md-* symbols
The following symbols where changed
- directory.read_only
- memory_usage
- meson
- nim
- os.symbols.Garuda
- os.symbols.HardenedBSD
- os.symbols.Illumos
- os.symbols.OpenBSD
- os.symbols.OracleLinux
- os.symbols.Redox
- os.symbols.Solus
- os.symbols.Windows
- package
- rlang
* Updated nf-mdi-* to nf-md-* symbols (for all other presets)
The following symbols where changed
for pastel-powerline:
- directory.substitutions.Documents
- nim
for tokyo-night
- directory.substitutions.Documents
- golang
* Updated nf-mdi-* to nf-md-* symbols for the default configuration in modules in src/configs/*.rs
The following symbols where changed
- azure
- battery.full_symbol
- battery.charging_symbol
- battery.discharging_symbol
- battery.unknown_symbol
- battery.empty_symbol
* Updated config-schema.json
* Updated src/modules/*.rs docs/config/README.md
and used `nerdfix` to check if I overlook anything
* Fixed the battery discharging symbol in the tests
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: jtrv <travershasemail@gmail.com>
* build(deps): disable unnecessary/unused regex features (#5175)
This will reduce the binary size by ~400 kB.
* build(deps): update rust crate serde to 1.0.163
* build(deps): update xalvarez/prevent-file-change-action action to v1.3.2
* build(deps): update rust crate clap_complete to 4.2.3
* build(deps): update rust crate gethostname to 0.4.3
* build(deps): update dprint plugins
* build(deps): update toml crates
* build(deps): update crate-ci/typos action to v1.14.10
* build(deps): update clap crates to 4.3.0
* build(deps): update crate-ci/typos action to v1.14.11
* build(deps): update rust crate regex to 1.8.2
* build(deps): update rust crate toml_edit to 0.19.10
* build(deps): update rust crate regex to 1.8.3
* build(deps): update rust crate shadow-rs to 0.22.0
* build(deps): update rust crate log to 0.4.18
* build(deps): update rust crate chrono to 0.4.25
* build(deps): update rust crate once_cell to 1.17.2
* build(deps): update rust crate chrono to 0.4.26
* refactor: simplify `shadow-rs` setup in `build.rs` (#5209)
Update build.rs
* feat(golang): adding `mod_version` variable (#5177)
* feat(nodejs): Add `expected_version` variable (#5081)
* add `expected_version` variable to `nodejs`
* show comparison symbols with `expected_version`
* documentation, formatting, more tests
* Remapped `engines_version` to $version
* Added better descriptions to docs
* Update docs/config/README.md
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Removed clone from `nodejs`, formatting
* refactored function calls
* rewrote `engines_version` formatter
* Moved Lazy variables into maps
---------
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* build(deps): update crate-ci/typos action to v1.14.12
* build(deps): update clap crates to 4.3.1
* fix: bump libz-ng-sys (#5218)
* build(deps): update rust crate clap to 4.3.2
* build(deps): update rust crate shadow-rs to 0.23.0
* build(deps): update rust crate regex to 1.8.4
* build(deps): update rust crate once_cell to 1.18.0
* Update GA measurement ID
* build(deps): update rust crate nu-ansi-term to 0.48.0
* docs(i18n): new Crowdin updates (#5109)
* Revert "Specify personal-file interface for snap"
This reverts commit 2641a37865.
This was reverted due to errors in the snap publishing pipeline:
interface 'starship-config' not found in base declaration declaration-snap-v2_plug_known (starship-config, starship-config)
invalid plugs interface definition 'starship-config' lint-snap-v2_app_plugs_plug_reference (starship, starship-config)
unknown interface 'starship-config' lint-snap-v2_plugs (starship-config, starship-config)
* chore(master): release 1.15.0 (#5108)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Checkout before running gh commands in CI
* Inline script for GA4
* build(deps): update gitoxide crates
* build(deps): update rust crate tempfile to 3.6.0
* Update GA4 tag attribute
* build(deps): update crate-ci/typos action to v1.15.0
* feat: update the nushell init file and make it valid module and overlay (#5188)
* break long commands into multiple lines for readability
* fix the format of closures
We generally write `{|| ...}` instead of `{ || ...}`.
* remove the `$"--opt=(val)"` structure when possible
`starship` does not require to use `--opt=val` and so we do not
need to do that with Nushell :)
the only place where this is required is with `--status` because
`$env.LAST_EXIT_CODE` can be negative and `starship` does not
appear to *like* values of the form `-2`...
so i left this line as it was.
on the other hand, `$env.CMD_DURATION_MS` and `(term size).columns`
should be fine 😌
* simplify the `config` mutation with new `?` syntax
This is a new very handy feature of Nushell which gives a much
simpler command combined with `default` and `merge`.
* put all `let-env`s inside an `export-env` with `load-env`
This commit has two reasons of existing:
- i think it makes it a bit easier to read with less `let-env`s
- it transforms the *script* into both a valid module and a valid
overlay
* bump the version to `0.78` in to docs
* add a note about the init file being also a module to all docs
* tweak the documentation
* update the Nushell part of the install script
* format the vuepress config file
as previous commit 117580136d3da5e00a4ccb7ada508c8510a2e50e was
not successful, let's try to make the CI happy manually 😌
* remove code quotes in the `config_cmd` of Nushell
* format the style in the Nushell `warning` section
* build(deps): update rust crate serde to 1.0.164 (#5231)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* build(deps): update rust crate starship-battery to 0.8.1 (#5232)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* feat(pwsh): Support vi command mode indicator (#5049)
Support vi command mode in powershell
* build(deps): update rust crate clap to 4.3.3 (#5235)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* build(deps): update rust crate gix to 0.46.0
* build(deps): update rust crate log to 0.4.19 (#5240)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* chore: fix typos (#5239)
* chore: fix new clippy lints (#5241)
* docs: Correct Arch Linux Repo Name (#5243)
* Correct Arch Linux repo name
* Revert changes to translated files.
* build(deps): update rust crate quick-xml to 0.29.0
* build(deps): update reviewdog/action-suggester action to v1.6.1
* build(deps): update rust crate clap to 4.3.4
* build(deps): update rust crate serde_json to 1.0.97
* build(deps): update rust crate shadow-rs to 0.23.0 (#5250)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* fix(bash): Clear out completed jobs before counting NUM_JOBS (#5253)
Clear out completed jobs before counting NUM_JOBS
* build(deps): update pest crates to 2.6.1
* redesign
* jet link
* screenshot
* readme, config
* clean trails whitespace
* fmt
* comment vicmd
* mv pos, right prompt warn
* right prompt prereq
* reco and typo
* resolve build check error
* tidy
* resolve build check error
* resolve build check error
* request changes
* rm src contents
* rm git_status.rs
* tryint fix checks
* PR review request: rm comments
* PR review request: rm redundant default
* PR review request: enable aws
---------
Signed-off-by: Michel Alexandre Salim <michel@michel-slm.name>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tom Fenech <tomjwfenech@gmail.com>
Co-authored-by: Matan Kushner <hello@matchai.dev>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
Co-authored-by: Michel Alexandre Salim <michel@michel-slm.name>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jan Dittrich <mail@jand.one>
Co-authored-by: Zhizhen He <hezhizhen.yi@gmail.com>
Co-authored-by: Swarnim Maheshwari <rexzeo0@gmail.com>
Co-authored-by: Guilhem Saurel <guilhem.saurel@laas.fr>
Co-authored-by: Stefan Cosma <66746+stefanc@users.noreply.github.com>
Co-authored-by: Christian Meusel <christian.meusel@posteo.de>
Co-authored-by: Harry Hodge <harry@harryhodge.co.uk>
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
Co-authored-by: Dave Parr <8363743+DaveParr@users.noreply.github.com>
Co-authored-by: Ryan Sabatini <11415980+rjsab@users.noreply.github.com>
Co-authored-by: Vegard Skui <me@vegardskui.com>
Co-authored-by: Cosimo Matteini <dev.matteini@gmail.com>
Co-authored-by: jliaoh <48660001+hunterliao29@users.noreply.github.com>
Co-authored-by: Matthew T <tet68mt+github@gmail.com>
Co-authored-by: Samir Talwar <samir@functional.computer>
Co-authored-by: Aurélien Gâteau <mail@agateau.com>
Co-authored-by: Aki Kanellis <hello@akikanellis.com>
Co-authored-by: Chad Denyar <6653063+cdenyar@users.noreply.github.com>
Co-authored-by: marcybell <marcy@marcelinesystems.dev>
Co-authored-by: Colton Donnelly <colton@donn.io>
Co-authored-by: AnirbanHalder654322 <92542059+AnirbanHalder654322@users.noreply.github.com>
Co-authored-by: Anirban Halder <shaeo967@gmail.com>
Co-authored-by: Dom Slee <domslee1@gmail.com>
Co-authored-by: Micky Brunetti <micky2be@users.noreply.github.com>
Co-authored-by: Andrew Pantuso <ajpantuso@gmail.com>
Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
Co-authored-by: Scott Parkhill <scott.parkhill@gmail.com>
Co-authored-by: Eldar Khurmamatov <74624554+e-khurmamatov@users.noreply.github.com>
Co-authored-by: kensasongko <ken.sasongko@gmail.com>
Co-authored-by: Denis Cornehl <denis@cornehl.org>
Co-authored-by: Mick Hohmann <gh@m69.im.net>
Co-authored-by: jtrv <travershasemail@gmail.com>
Co-authored-by: Jakub Jirutka <jakub@jirutka.cz>
Co-authored-by: baoyachi. Aka Rust Hairy crabs <liaoymxsdl@sina.com>
Co-authored-by: Antoine Stevan <44101798+amtoine@users.noreply.github.com>
Co-authored-by: Nemo157 <git@nemo157.com>
Co-authored-by: Dosenpfand <Dosenpfand@users.noreply.github.com>
Co-authored-by: Ajeet D'Souza <98ajeet@gmail.com>
Skip unnecessary indirection in starship init zsh
The installation instructions indicate that one should add this snippet
to zsh's configuration:
eval "$(starship init zsh)"
The command `starship init zsh` prints a little shell script for zsh to
execute:
> starship init zsh
source <(/usr/bin/starship init zsh --print-full-init)%
Running `starship init zsh --print-full-init` prints yet another script
that zsh executes. There is an intermediate step that seems redundant;
starship prints a script for zsh to execute, and this script prints
another script for zsh to execute.
This commit skips the intermediate execution and prints the final script
in `starship init`. This is backwards compatible and does not require
any changes in the installation instructions, so it could be release
without a major version bump.
Note that it would still be possible to update the installation
instructions to `source <(starship init zsh)`; this patch works with
both `source` and `eval`. Picking the most performant one is beyond this
scope of this commit.
See: https://github.com/starship/starship/issues/2637
* docs: add new preset gruvbox-rainbow
* docs: add readme page of gruvbox-rainbow preset
* docs: update the screenshot of gruvbox-rainbow
* fix: update the background color of root
* format: fix markdown format
* format: fix markdown format with dprint
* docs(presets): sort the options
* docs(presets): use $linebreak instead of \n
* docs(presets): add icons for redhat distro
* perf: put the space into version block
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* docs(presets): use custom palette to manage colors
* docs(presets): put the space into version block for all context
* docs(presets): add prefix to color names
---------
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
build: Sort toml input file list
for reproducible build results.
See https://reproducible-builds.org/ for why this is good.
This patch was done while working on reproducible builds for openSUSE.
* docs(directory): specify option name in example
It took me longer than I'd like to admit to figure out what option this example was referring to. It didn't help that the referenced option is hidden in a collapsible, which evaded any attempt made through the browser's find `ctrl+f` functionality.
* more natural grammar
* break long commands into multiple lines for readability
* fix the format of closures
We generally write `{|| ...}` instead of `{ || ...}`.
* remove the `$"--opt=(val)"` structure when possible
`starship` does not require to use `--opt=val` and so we do not
need to do that with Nushell :)
the only place where this is required is with `--status` because
`$env.LAST_EXIT_CODE` can be negative and `starship` does not
appear to *like* values of the form `-2`...
so i left this line as it was.
on the other hand, `$env.CMD_DURATION_MS` and `(term size).columns`
should be fine 😌
* simplify the `config` mutation with new `?` syntax
This is a new very handy feature of Nushell which gives a much
simpler command combined with `default` and `merge`.
* put all `let-env`s inside an `export-env` with `load-env`
This commit has two reasons of existing:
- i think it makes it a bit easier to read with less `let-env`s
- it transforms the *script* into both a valid module and a valid
overlay
* bump the version to `0.78` in to docs
* add a note about the init file being also a module to all docs
* tweak the documentation
* update the Nushell part of the install script
* format the vuepress config file
as previous commit 117580136d3da5e00a4ccb7ada508c8510a2e50e was
not successful, let's try to make the CI happy manually 😌
* remove code quotes in the `config_cmd` of Nushell
* format the style in the Nushell `warning` section
This reverts commit 2641a37865.
This was reverted due to errors in the snap publishing pipeline:
interface 'starship-config' not found in base declaration declaration-snap-v2_plug_known (starship-config, starship-config)
invalid plugs interface definition 'starship-config' lint-snap-v2_app_plugs_plug_reference (starship, starship-config)
unknown interface 'starship-config' lint-snap-v2_plugs (starship-config, starship-config)
* add `expected_version` variable to `nodejs`
* show comparison symbols with `expected_version`
* documentation, formatting, more tests
* Remapped `engines_version` to $version
* Added better descriptions to docs
* Update docs/config/README.md
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Removed clone from `nodejs`, formatting
* refactored function calls
* rewrote `engines_version` formatter
* Moved Lazy variables into maps
---------
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Updated nf-mdi-* to nf-md-* symbols
The following symbols where changed
- directory.read_only
- memory_usage
- meson
- nim
- os.symbols.Garuda
- os.symbols.HardenedBSD
- os.symbols.Illumos
- os.symbols.OpenBSD
- os.symbols.OracleLinux
- os.symbols.Redox
- os.symbols.Solus
- os.symbols.Windows
- package
- rlang
* Updated nf-mdi-* to nf-md-* symbols (for all other presets)
The following symbols where changed
for pastel-powerline:
- directory.substitutions.Documents
- nim
for tokyo-night
- directory.substitutions.Documents
- golang
* Updated nf-mdi-* to nf-md-* symbols for the default configuration in modules in src/configs/*.rs
The following symbols where changed
- azure
- battery.full_symbol
- battery.charging_symbol
- battery.discharging_symbol
- battery.unknown_symbol
- battery.empty_symbol
* Updated config-schema.json
* Updated src/modules/*.rs docs/config/README.md
and used `nerdfix` to check if I overlook anything
* Fixed the battery discharging symbol in the tests
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: jtrv <travershasemail@gmail.com>
* Fixed error in module 'sudo'
There was no ($style) in format. When module enabled this lead to the error [WARN] - (starship::modules::sudo): Error in module `sudo`
* Update docs/.vuepress/public/presets/toml/bracketed-segments.toml
typo fix
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
---------
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
upgrade gitoxide to v0.44 for performance improvements during discovery
Please note that there is a new `dot_git_only` option which would further
speedup discovery. On even moderatly fast disks that probably not going
to make a difference, but it will on incredibly slow (networked) disks.
See https://github.com/helix-editor/helix/issues/6867 for reference.
* add `set_config` method to `Context`
* Made inline comment a doc comment
* use `default_context()` for `set_config()` test
* use `set_config()` in tests for `print.rs`
* set root config w `set_config()` (`print.rs` test)
* From issue #4448, added `subscription_aliases`
as a field for the Azure module
Can be set in starship.toml with
[azure.subscription_aliases]
* Updated config file schema
* Added entry into documentation
* Update README.md
* Formatted with dprint
As part of #4954, non-edge packages of Starship were removed from Snapcraft. This means the only way to install Starship is through the `edge` channel using `snap install --edge starship`.
Update starship.nu to conform to Nushell changes
Nushell recently made a change to require that all closures have an explicit parameter list, even if it's empty, in https://github.com/nushell/nushell/pull/8290.
This updates starship.nu to conform to this requirement.
I have casually tested this against both the latest released version of Nushell, and the latest version on HEAD; the changed code works well (for me) on both.
* feat(custom): add option to check if pwd is in a repo
* Apply suggestions from code review
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* change whenrepo to require_repo
* chore: fix doc formatting
---------
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Move PathExt::device_id() outside modules module
* Add upwards_sibling_scan-function
* Fix Fossil check-out detection in subdirectories
* Use shared upwards scanning function in hg_branch
* Let the caller specify if they're looking for a file or a folder
* fix merge
---------
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
feat(aws): supports AWS_CREDENTIAL_EXPIRATION environment variable
Adds support for the AWS_CREDENTIAL_EXPIRATION environment variable
which was adopted as the standard way to set the expiration for
temporary credentials. The existing AWS_SESSION_EXPIRATION environment
variable is not dropped for backwards compatibility.
See https://github.com/aws/aws-cli/pull/7398
Handles starship.install (MSI installer) and starship.portable and makes starship an
empty meta-package that only depends on starship.install. MSI/installer packages
seem to be preferred over zip-based installers on chocolatey. Proper virtual packages
that allow choosing either a portable or install variant aren't implemented in chocolatey yet.
Improve Nushell installation instruction
Consistently use `save -f` rather than `save`; the latter fails if the
file already exists
Signed-off-by: Michel Alexandre Salim <michel@michel-slm.name>
Remove extra backspace from regex in example
In the example, `[\\w-]` would match a literal backspace `\`, the
character `w` or a dash `-`. By removing the backspace, instead it
matches any "word character" `\w` or a dash `-`.
Fixed a startup error, when using nushell.
The nushell warns about not using `let-env` for configuring `config`. I have removed the `load-env` and just added a `let-env` for the `config` as the documentation recommends: https://www.nushell.sh/book/environment.html#let-env
* Fixes#3821 to provide an improved experience for display of container
Details:
- podman containerenv processing is now happens before systemd
- if systemd/container contains "docker", now shows "Docker"
- maintains fix from #4593 to prevent 'Systemd" display on WSL
- refactors tests for systemd detection
* only compile function for linux
* correct 'default' systemd test use use None, codecov caught this mistake
* refactor my change to systemd/container detection so that it has one stage instead of multiple
chore(aws): fix unintended test failure of `aws::missing_any_credentials`
Because its mocking is not enough, The test may unintentionally fail
if `~/.aws/credentials` exists.
This commit fixes this issue by mocking `credentials` file as well.
* feat: Pijul VCS support
* Extra bits needed for new module.
* Format Markdown table.
* Fix lint.
* Don't test Pijul module so thoroughly.
Installing from source is too expensive, and compiled binaries are only
available for Windows (and unofficially as well). Perhaps once Pijul
1.0.0 comes out of beta there will be more binaries available in package
repos.
* Format!
* Bad rebase, remove Pijul install from workflow.
* Mock Pijul commands for code coverage.
* Make fake .pijul directory in fixture.
* Truly mock `pijul` command.
* Rename module from `pijul` to `pijul_channel`.
* Format!
* Fix config-schema.json.
* Missed changing module name in docs/ folder.
* feat(hg_branch): Add support for mercurial topics and find hg root dir
* Fix clippy errors
* Use crate::utils::read_file
* Update config-schema.json
* Extend PathExt to retrieve device ID of Path
* Break hg root search when switching to another device
* Fix clippy and formatting errors
* Update docs/config/README.md
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Update src/modules/utils/path.rs
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Update src/configs/hg_branch.rs
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Update hg_branch description
* Revert to lazy loading, use truncate_text from utils and use fake topic
* Format code and fix clippy error
* Revert to previous test string as topic is optional in the config
* Fix doc formatting
* Stub device_id for windows
* Update config-schema.json
* Update src/modules/hg_branch.rs
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Do not use unwrap in device_id
* Fix formatter error
* Use dev under non linux unixes
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Support `nix shell`
* Remove unnecessary `Debug` implementation
* Add test to detect false positive
* Improve detection of `/nix/store` in $PATH
* Add docs about unknown state
* Gate under `heuristic` flag
* Regenerate config schema
Kubernetes module was previously a bit messy, with lots of
unnecessarily nested options. Clean this up using filter_map and
find_map, with two major results:
1. `ctx_components` is now a Vec<KubeCtxComponent> instead of a
Vec<Option<KubeCtxComponent>>. This greatly simplified downstream
processing of these context components.
2. Instead of storing a partial computation of the namespace in
variables `kube_ns`, etc, compute them directly in the formatter
mapping. This is made simpler (read: actually doable) by change 1.
The `git_commit` module uses a `tag` variable in its format string,
which is not explained in the Variables section of this module.
Missing clarification of this `tag` variable is added to the
documentation of the `git_commit` module.
Fixes starship/4640
* Add Haxe support
* avoid unwrap
* fix doc formatting
* removed extra newline
* fixed formatter and linter issues
* fixed config file
* better version of detecting contents of .haxerc
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* removed openfl related defaults from detect_files
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* fixed formatting
* reworked reading .haxerc with fallback to haxe --version
* fixed formatting
* added fallback to executable for dev paths in .haxerc
* fixed linter issue
* added support for Windows paths
* use or_else
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* use shorter version with `?`
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* simplified regex check
removed check for "null" string
* fixed format
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
Instead of the remote address of 8.8.8.8 (Google DNS) in the crate
local_ipaddress use a reserved IPv4 address, that should never be
assigned.
Also forward the underlying error on failure.
Supersedes: #4614
Disables the display of notifications from cmd_duration on Linux if
none of DISPLAY, WAYLAND_DISPLAY, or MIR_SOCKET are set.
This prevents starship from attempting to create notifications in tty
environments, which was previously causing hangs.
* add username to azure module config
* add username to azure module config
* formatting with cargo fmt
* Handle parse failure on azureProfile.json
allow program to procede if unable to parse azure profile due to missing
keys from the JSON structure.
remove unused keys from struct
Code cleanup with suggestions from PR maintainer
Cargo clippy fixes
* feat(bug-report): ask for confirmation before opening issue
* Apply suggestions from code review
Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
* Fix#4481, config does not error when unrecognized properties are present
* cleanup: use stuct update syntax to improve readability
from review feedback
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* cleanup: renamed ValueDeserializer func w/ better name
* cleanup: added test to cover unknown key retry condition
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
This patch uses the which crate to resolve the starship path, replacing the
current_exe() mechanism.
Co-authored-by: Kevin Song <chips@ksong.dev>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
Co-authored-by: Dario Vladović <d.vladimyr@gmail.com>
* feat(preset): Add No Empty Icons preset
When toolset files are identified by the Starship module, the default format displays the toolset icon, and additional information.
When the toolset executables are not available, the additional information (like version number) is missing. Only the toolset icon is displayed.
The No Empty Icons preset changes the format configuration to not show the toolset icons if the variables are empty - presumably because the toolset is not installed or found.
Closes#3070
Related #3248
* Remove non-version-related modules from preset
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Add new module opa to preset
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Drop unnecessary inner conditional from format
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Remove commit_hash_length setting from preset
* Remove undesired modules
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* docs(config): Improve string and escaping information
* docs(config): Use literal strings
* docs(config): Use literal strings
* docs(config): Improve string value type description
* docs(config): Consistently use literal strings
like the documentation recommends and like `starship print-config` prints.
Resolves inconsistencies to format value on aws, container, elixir, gcloud, git_commit, git_state, git_status, kubernetes, nix_shell, openstack, python, singularity, which already uses literal strings.
Resolves inconsistency to status module pipestatus_format, which already uses literal string.
`$all` expanded list remains a non-literal multiline string for readability with escaped newlines.
* docs(config): Drop literal recommendation, describe escaped newlines
* feat(preset): Add powerline-only-symbols preset
Related to #2563 & #3544
* Modify symbols for pulumi and erlang
* Change some wording and add default notification
* Update name of preset
Co-authored-by: Kevin Song <chips@ksong.dev>
In the config `$all` has special meaning, as it is and contains the default value for `format`.
Using `$all` in the example for conditional format strings with multiple variables is thus potentially misleading and confusing.
Using a neutral variable `$combined` has no conflict with other meanings and is thus preferable.
* feat: added showing gradle version based on the gradle.properties file
* fix: wouldn't return version
* fix: forgot to remove "version=" from returned version"
* fix: ran rustfmt
* fix: test now actually tests for something
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* fix: the regex actually makes sense now
* fix: complete refactor of control flow
* Delete flake.nix
* changed order in which files are processed
Co-authored-by: BattleCh1cken <BattleCh1cken@Larkov.de>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* feat(guix_shell): Initial implementation (#3999)
* fix(guix_shell): Change guix nerd font icon to water buffalo emoji
* fix(guix_shell): Added guix_shell entries in preset files
* fix(guix_shell): Moved guix_shell config docs in to the correct place (alphabetically)
* feat(aws): add a fallback for `expiration`
* fix(aws): intermittent test failures
- extend the time range from `-2s,0s` to `-5s,+2s`
* fix: `docs/config/README.md` readability
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* feat: Open Policy Agent module (#1740)
* Format documentation
* Fix typo, `ropa` -> `rego`
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Update presets for OPA module
* Add extra space to OPA module symbol
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* docs(preset): update presets with Scala nerd font.
* dos(preset): add an extra space after Scala symbol.
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* feat(module): Add a meson devenv indicator
Adds a Meson Developer Environment indicator, if the MESON_DEVENV
variable is set. Inside a `meson devenv`, the prompt will include the
current Meson project name
This also contains a new Truncate utility function, which may be adapted for other modules in the future
* docs: Add Meson to presets
* Support formatting of pipestatus separator
* Format pipestatus separator with each pipestatus
* Add third exit code to pipestatus test
* Clean up pipestatus mapping
* Add comment that was removed
* Fixed distortion of double and single quotes
* Run dprint fmt
* Use single quotes to avoid backslash escapes
* Update docs/config/README.md
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
Fix typo in docs for Java identification.
The file is "deps.edn", not ".deps.edn" (with a dot at the beginning).
The code looks for the correct name, the typo is only in the docs.
* docs(config): add color palette to docs
* feat: add user-defined color palette
* fix: update config schema
* refactor: apply suggestions from code review
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* fix: update new test
* feat: add support for multiple palettes
* docs(config): update docs for multiple color palettes
* docs(config): fix formatting
* test: test overriding a predefined color with itself
* docs: mention palettes cannot reference themselves
* refactor: warn when using a nonexistent palette
* test: test retrieving a nonexistent color palette
* fix: fix issues with palette log messages
* fix: update config schema
* fix: skip serializing palette if none
* refactor: change nonexistent palette message to warning
* fix: update config schema
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* upgrade `gitoxide` to v0.21
This release comes with lenient configuration handling by default,
allowing to open repositories even their configuration values are
invalid (even for git), as long as there are viable defaults.
Furthermore this release adds the ability to open submodule repsitories.
Fixes https://github.com/starship/starship/issues/4266 and
fixes https://github.com/starship/starship/issues/4272
* Assure an object cache is set to speed up `commit.describe()`
Related to https://github.com/starship/starship/issues/4275 bringing
performance to spitting distance compared to git.
* Add starship preset command
* Use ValueEnum for preset command
* Generate ValueEnum struct in build.rs
* Use absolute paths and refactor codegen
* Use dunce to canonicalize path
* Use raw string literal in include_bytes!
* Use .cloned()
* Apply fixes
* Fix path escaping
* Removed error message if stdout is unavailable
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* test that we can match a multi-part file extension such as in foo.tar.gz
* now we can match multi-part file extensions like on foo.tar.gz
* add a test that a !ext is a negative match and over-rides any positive match
* test that negative extensions that don't match any file have no effect
* fail the match if any negative extensions exist
* cargo fmt
I'm not happy with this, in particular it's made the structures of has_any_positive_extension and has_no_negative_extension look different, and the logic in is_match is harder to follow
* placate clippy
* documentation for multi-part extensions and negative extensions
* get rid of an unnecessary .to_string() and comment the necessary but weird-looking invocations of .to_string_lossy().to_string()
* tests for negative matching of files and folders
* fail the match is any negative files/folders match
* document file/folder negative matching; be less prolix
* suppress Nodejs if Deno files are present (#2627)
* Revert "suppress Nodejs if Deno files are present (#2627)"
This reverts commit c1394fd7b37bb0bf06b1449e074020a2e16bfa04.
This was a terrible way of doing this, there's got to be a better way!
Have added configuration options to the k8s module to allow activating
the module only in directories that contains certain files or folders.
To ensure this is backwards compatible and because there are not really
any standard files or folders for Kubernetes I have set the defaults to
empty and will activate the module for all directories.
Have switched all vi/vim symbols to have the same prefix 'vim'. To
preserve backwards compatibility with existing configs I have added an
alias for the previous config name.
* add proper vi mode detection for fish shell
* update tests
* fix test
* update config-schema.json
* update docs
* add warning about symbols only supported in fish
* **deps:** update rust crate os_info to 3.8.2 ([#5870](https://github.com/starship/starship/issues/5870)) ([d421f63](https://github.com/starship/starship/commit/d421f63785f901caf222941cbfae7cb8c0feec74))
* replace all remaining paths referring to vuepress ([#5859](https://github.com/starship/starship/issues/5859)) ([d5861f9](https://github.com/starship/starship/commit/d5861f9f974147d307c319865890cbb3e50dbe5a))
* $gemset variable for Ruby module ([#5429](https://github.com/starship/starship/issues/5429)) ([938ea3c](https://github.com/starship/starship/commit/938ea3c40145af68d8e28b2ef0275531f1123202))
* **bash:** Support right prompt and transience ([#4902](https://github.com/starship/starship/issues/4902)) ([5ead13d](https://github.com/starship/starship/commit/5ead13d6aa6303c85c562f1b940048cc539667cd))
* **bash:** use PS0 for preexec hook ([#5735](https://github.com/starship/starship/issues/5735)) ([ae711c0](https://github.com/starship/starship/commit/ae711c0f332f4f24c843e59d6d5783e398e21b38))
* **direnv:** use JSON status with direnv >= 2.33.0 ([#5692](https://github.com/starship/starship/issues/5692)) ([482c7b7](https://github.com/starship/starship/commit/482c7b719fc304fcad5f3572c4551f8ff4179522))
* **docs:** move to vitepress ([#5785](https://github.com/starship/starship/issues/5785)) ([7485c90](https://github.com/starship/starship/commit/7485c90c9f7259c026a84dd0335f56860005315d))
* **install:** Add version option to install script ([f66bfd9](https://github.com/starship/starship/commit/f66bfd9435f215867681a699428bd882d8c63ce7))
* **install:** Add version option to install script ([#5728](https://github.com/starship/starship/issues/5728)) ([f66bfd9](https://github.com/starship/starship/commit/f66bfd9435f215867681a699428bd882d8c63ce7))
* **os:** add new os symbols ([#5849](https://github.com/starship/starship/issues/5849)) ([df65b21](https://github.com/starship/starship/commit/df65b2155f92c03d07cabbcee6c92104a878c963))
* **quarto:** Add Quarto module ([#5820](https://github.com/starship/starship/issues/5820)) ([0e49f04](https://github.com/starship/starship/commit/0e49f04a6b249090cf3703c5dac041a51e6bf530))
* **username:** add detect_env_vars as option ([#5833](https://github.com/starship/starship/issues/5833)) ([b8a812b](https://github.com/starship/starship/commit/b8a812b93207da992ff8ae9f8b955bfa1252072b))
### Bug Fixes
* **bash:** Handle Unbound Variables Errors in Bash ([#4972](https://github.com/starship/starship/issues/4972)) ([7093d5c](https://github.com/starship/starship/commit/7093d5cd84967edba93c9ed412b07519664f6356))
* **bash:** improve integration with bash-preexec ([#5734](https://github.com/starship/starship/issues/5734)) ([2aa711c](https://github.com/starship/starship/commit/2aa711ccc7096437e21149b18d1384534bfbcc57))
* **character:** also handle vi edit mode in pwsh ([#5775](https://github.com/starship/starship/issues/5775)) ([0891ec2](https://github.com/starship/starship/commit/0891ec27a40421cd742a853885731aed63f412aa))
* **direnv:** update to work with direnv v2.33 ([#5657](https://github.com/starship/starship/issues/5657)) ([cec111a](https://github.com/starship/starship/commit/cec111affdaf0a52f72c398f8307cf7e19c7dd8d))
* **git_branch:** fall back to "HEAD" when there is no current branch ([#5768](https://github.com/starship/starship/issues/5768)) ([6a96e84](https://github.com/starship/starship/commit/6a96e84a15e3ea598356e4fcad23ac4b2690dd1e))
* **nu:** continuation prompt not being displayed correctly ([#5851](https://github.com/starship/starship/issues/5851)) ([d308e91](https://github.com/starship/starship/commit/d308e918ee014f4ca9976683e79e819afd8160f7))
* refactor(modules): use whoami crate to get username ([#5669](https://github.com/starship/starship/issues/5669)) ([a83e107](https://github.com/starship/starship/commit/a83e10776ba37bd1ab439e5e4d0125a06e947728))
* **aws:** Adding the AWS SSO CLI env variable to profile list ([#5640](https://github.com/starship/starship/issues/5640)) ([6d96df3](https://github.com/starship/starship/commit/6d96df3c6828161bb9dc922fe45ef35a1ce33771))
* **direnv:** add new direnv module ([#5157](https://github.com/starship/starship/issues/5157)) ([e47bfba](https://github.com/starship/starship/commit/e47bfbabb9b7d6af12a29db9413a6ec03fba174b))
* **hostname:** add detect_env_vars as option ([#5196](https://github.com/starship/starship/issues/5196)) ([43b2d42](https://github.com/starship/starship/commit/43b2d42cd526e34c5f0290e7409fbd6d3a54e908))
* **kubernetes:** Add styling based on current context ([#4550](https://github.com/starship/starship/issues/4550)) ([6b444e0](https://github.com/starship/starship/commit/6b444e05c688f9b871d0fe4624cd5559eba1f95c))
* R lang packages version, remove .Rprofile from rlang detection ([#5588](https://github.com/starship/starship/issues/5588)) ([5267c46](https://github.com/starship/starship/commit/5267c464eb5e4b23e44cdb7c56919991f4f67ae3))
* **scanner:** add option not to follow symlinks ([#5325](https://github.com/starship/starship/issues/5325)) ([7b851fc](https://github.com/starship/starship/commit/7b851fc30e109213e911eec38460315872f1ae59))
* **shell:** allow distinguishing between pwsh and powershell ([#5478](https://github.com/starship/starship/issues/5478)) ([d7a34b4](https://github.com/starship/starship/commit/d7a34b45f88ced63bd79a582c14a6b2f8ebd9544))
### Bug Fixes
* **bash:** unbound variable error with STARSHIP_PREEXEC_READY ([#5438](https://github.com/starship/starship/issues/5438)) ([8168c21](https://github.com/starship/starship/commit/8168c21293de8118af1e95778b1eee8f26cd6d6a))
* **git:** prevent `core.fsmonitor` from executing external commands ([#3981](https://github.com/starship/starship/issues/3981)) ([03278e4](https://github.com/starship/starship/commit/03278e4de4f540cbd0e346e9df878c7e6798d757))
* **install:** do not use curl installed through snap ([#5442](https://github.com/starship/starship/issues/5442)) ([0e73817](https://github.com/starship/starship/commit/0e738175c57d5789350b996b69c5713aac03835e))
* **pastel-powerline:** remove `$path` from docker-context module format string ([#5534](https://github.com/starship/starship/issues/5534)) ([6abc83d](https://github.com/starship/starship/commit/6abc83decdf176842985b4daa5b09771c6b93415))
### Performance Improvements
* **git_status:** avoid running in bare repos ([#5581](https://github.com/starship/starship/issues/5581)) ([ac4a839](https://github.com/starship/starship/commit/ac4a83910357d69950ca304a3fb41d1d39bc3592))
* Skip unnecessary indirection in starship init zsh ([#5322](https://github.com/starship/starship/issues/5322)) ([5ca8daa](https://github.com/starship/starship/commit/5ca8daacd4ce936f97170f814a780b34bfaa486e))
* **pwsh:** Support vi command mode indicator ([#5049](https://github.com/starship/starship/issues/5049)) ([3180509](https://github.com/starship/starship/commit/318050976b58f032a17ff4d122d21cb63faf8e3b))
* **shlvl:** add repeat_offset for repeated symbol ([#5289](https://github.com/starship/starship/issues/5289)) ([3402f0e](https://github.com/starship/starship/commit/3402f0e82aab907a77f0967abb99d4cde512c069))
* update the nushell init file and make it valid module and overlay ([#5188](https://github.com/starship/starship/issues/5188)) ([470aeb0](https://github.com/starship/starship/commit/470aeb09a72936a66937d68f96165a977b5c213d))
### Bug Fixes
* **bash:** Clear out completed jobs before counting NUM_JOBS ([#5253](https://github.com/starship/starship/issues/5253)) ([0a05b5c](https://github.com/starship/starship/commit/0a05b5ca8b7f147ead6d575297ef9f34191193af))
* **rprompt:** remove lprompt modules from `$all` again ([#5067](https://github.com/starship/starship/issues/5067)) ([b9a4b08](https://github.com/starship/starship/commit/b9a4b08ac24805061c5faaef98ccbee7b018f5f0))
### Performance Improvements
* **git_status:** query git stash count via gitoxide ([#5238](https://github.com/starship/starship/issues/5238)) ([410f107](https://github.com/starship/starship/commit/410f107c722a2f07737d4be01960f2621bf418dd))
* **config:** Make print-config not panic without a config ([#5001](https://github.com/starship/starship/issues/5001)) ([ce7f984](https://github.com/starship/starship/commit/ce7f984932a97b4ad3cd6e6ece8e1c3b6022ba99))
* ensure nested style variables are processed during formatting ([e5cec9e](https://github.com/starship/starship/commit/e5cec9ea50963a45bb1c209abc747ee1983dcabd))
* **presets:** Added ($style) to format in module 'sudo' in Bracketed Segments Preset ([#5146](https://github.com/starship/starship/issues/5146)) ([1bd6db5](https://github.com/starship/starship/commit/1bd6db58307c1945c3b0cabec8d6663730394377))
* **snap:** Update snapcraft.yaml to add personal-files interface ([#5131](https://github.com/starship/starship/issues/5131)) ([b3ccc0f](https://github.com/starship/starship/commit/b3ccc0f05e451ada800d233613ef32756682249f))
* **style:** ensure nested style variables are processed during formatting ([#5120](https://github.com/starship/starship/issues/5120)) ([e5cec9e](https://github.com/starship/starship/commit/e5cec9ea50963a45bb1c209abc747ee1983dcabd))
* update of presets and default configuration to reflect changes in Nerd Fonts 3.0 ([#5162](https://github.com/starship/starship/issues/5162)) ([2558c45](https://github.com/starship/starship/commit/2558c4588b5bcc404df474c948de0b72b109be01))
* **aws:** add support for source_profile ([#3834](https://github.com/starship/starship/issues/3834)) ([d2801ac](https://github.com/starship/starship/commit/d2801ac44301dcef1f87ab5fd26abee36997f71d))
* **aws:** add support for source_profile ([#4859](https://github.com/starship/starship/issues/4859)) ([d2801ac](https://github.com/starship/starship/commit/d2801ac44301dcef1f87ab5fd26abee36997f71d))
* **aws:** Adds support for AWS_CREDENTIAL_EXPIRATION environment variable ([#5002](https://github.com/starship/starship/issues/5002)) ([74ce7fd](https://github.com/starship/starship/commit/74ce7fdbee071c28c77fd148d4ba02515f272d10))
* **custom:** add option to check if pwd is in a repo ([#4822](https://github.com/starship/starship/issues/4822)) ([d29ce7c](https://github.com/starship/starship/commit/d29ce7c45d4ea21a6e14ad308bd50cb0e61d1ef8))
* **fossil:** detection of Fossil check-outs in subdirectories ([#4910](https://github.com/starship/starship/issues/4910)) ([4bca74e](https://github.com/starship/starship/commit/4bca74eca29e159f0d6f27db432927012848408c))
* **fossil_branch:** fossil checkout database file name on windows ([#4978](https://github.com/starship/starship/issues/4978)) ([c07a21d](https://github.com/starship/starship/commit/c07a21d48abe4e01a96a2d1b641876207e8d02fb))
* **fossil_branch:** use proper fossil checkout database file name on windows ([c07a21d](https://github.com/starship/starship/commit/c07a21d48abe4e01a96a2d1b641876207e8d02fb))
* **gradle:** add support for unstable Gradle versions ([#5021](https://github.com/starship/starship/issues/5021)) ([f7fe41f](https://github.com/starship/starship/commit/f7fe41f9c6c455e8ced284ad2d55d2a51a5da748))
* **init:** avoid cygpath for starship binary path ([#4970](https://github.com/starship/starship/issues/4970)) ([0ad0465](https://github.com/starship/starship/commit/0ad0465a7a3296b3223693c655f370b7aae0d441))
* **java:** wrong version number when using Android Studio JDK ([#4966](https://github.com/starship/starship/issues/4966)) ([de7e948](https://github.com/starship/starship/commit/de7e94884bc309814f6af79d68d664efb513e093))
* **preset:** add output-flag to avoid encoding issues ([#4926](https://github.com/starship/starship/issues/4926)) ([5e78226](https://github.com/starship/starship/commit/5e78226a3fbe722331f6f0a1d352bbc48d38247f))
* **pulumi:** Fix formatting on pulumi module when using version ([#5038](https://github.com/starship/starship/issues/5038)) ([aef799b](https://github.com/starship/starship/commit/aef799bfb089c5d259354208a6bcd5a0b639888f))
* **config:** Adds support for --profile <custom profile name> ([#3467](https://github.com/starship/starship/issues/3467)) ([10433e3](https://github.com/starship/starship/commit/10433e31effb4040c47d02d565d1643bcf984fa6))
* **env_var:** Add support for env_var.VAR in format ([#4497](https://github.com/starship/starship/issues/4497)) ([5d4cb6f](https://github.com/starship/starship/commit/5d4cb6ff8f6bd1915aa2c16162950b270f1759b1))
* **hg_branch:** Add support for mercurial topics and find hg root dir ([#4771](https://github.com/starship/starship/issues/4771)) ([8d2256a](https://github.com/starship/starship/commit/8d2256ab1d0ba288fb6ba9b9248bc2210ca01059))
* **java:** Add `.sdkmanrc` for Java ([#4888](https://github.com/starship/starship/issues/4888)) ([07c2298](https://github.com/starship/starship/commit/07c2298965ee67300319c012bdf5fadbc8db4931))
* **logger:** delete old logs & avoid more dup logs ([#4348](https://github.com/starship/starship/issues/4348)) ([e47ea57](https://github.com/starship/starship/commit/e47ea57db21125372aeeae87ce555855a98adaab))
* **nix:** support new `nix shell` command ([#4724](https://github.com/starship/starship/issues/4724)) ([19fdf9b](https://github.com/starship/starship/commit/19fdf9bba59f6ae5a756b81d221a9dc3185208f5))
* **container:** reduce docker, podman and systemd confusion ([#4832](https://github.com/starship/starship/issues/4832)) ([85d683d](https://github.com/starship/starship/commit/85d683daf235854ffc356354c6b3ba7096de6193))
* **fish:** enable transient prompt when in vi mode ([#4826](https://github.com/starship/starship/issues/4826)) ([9ac924e](https://github.com/starship/starship/commit/9ac924eb3f0f8faa6da0375d92fc1dc22b8ba721))
* **git_commit:** fix potential test failure ([#4734](https://github.com/starship/starship/issues/4734)) ([27d167b](https://github.com/starship/starship/commit/27d167b7a202cd1da39a731813df155dacb4c81b))
* Improve regex for extracting gradle package version from gradle.properties ([#4759](https://github.com/starship/starship/issues/4759)) ([9093891](https://github.com/starship/starship/commit/9093891acbe2c86b1615c37386dadbb0cc632199))
* let-env warning when using nushell ([#4893](https://github.com/starship/starship/issues/4893)) ([e6c5571](https://github.com/starship/starship/commit/e6c5571fc9c1f47c711d5fcdd1799ced5b546454))
* **nodejs:** apply `style` even if node version is unavailable ([#4713](https://github.com/starship/starship/issues/4713)) ([e88484d](https://github.com/starship/starship/commit/e88484d5674b7c038346ff1c89089e535d2e2d6d))
* **package:** Improve regex for extracting gradle version from gradle.properties ([#4760](https://github.com/starship/starship/issues/4760)) ([9093891](https://github.com/starship/starship/commit/9093891acbe2c86b1615c37386dadbb0cc632199))
* add Haxe support ([#4395](https://github.com/starship/starship/issues/4395)) ([2766c78](https://github.com/starship/starship/commit/2766c78749e638282d1dee56f7afcc195c16c064))
* Add operating system module ([#4109](https://github.com/starship/starship/issues/4109)) ([3109943](https://github.com/starship/starship/commit/3109943822a15b22faaa6cdfda17ca9554bcd800))
* **aws:** add a fallback for `expiration` key ([#4455](https://github.com/starship/starship/issues/4455)) ([5a2c85d](https://github.com/starship/starship/commit/5a2c85d078c1a8c83cc055dd0e56033abb15c2bf))
* **azure:** add username to azure module config ([#4323](https://github.com/starship/starship/issues/4323)) ([6e15c00](https://github.com/starship/starship/commit/6e15c00238a06e92cf411a669590002eb22324e7))
* **bug-report:** ask for confirmation before opening issue ([#4543](https://github.com/starship/starship/issues/4543)) ([8bb9038](https://github.com/starship/starship/commit/8bb9038431cd369e953ca156ed09aabd7c2ba326))
* **init:** Use which-rs to resolve starship path ([cc2c8c4](https://github.com/starship/starship/commit/cc2c8c4a5450f2811612129abfbdc1aba12def91))
* **localip:** use reserved remote address ([#4648](https://github.com/starship/starship/issues/4648)) ([ddd54e9](https://github.com/starship/starship/commit/ddd54e9b20427b716e13d83884b4b0db03953210)), closes [#4614](https://github.com/starship/starship/issues/4614)
* **nu:** enable right prompt ([#4490](https://github.com/starship/starship/issues/4490)) ([a7abc0f](https://github.com/starship/starship/commit/a7abc0f4508b5357e44bc1d0a8b0ed363201824c)), closes [#3982](https://github.com/starship/starship/issues/3982)
* Open Policy Agent module ([#1740](https://github.com/starship/starship/issues/1740)) ([#4441](https://github.com/starship/starship/issues/4441)) ([865e68d](https://github.com/starship/starship/commit/865e68da3ad752a2bc85b923258f2dbd5287ada8))
* **package:** added showing gradle version based on the gradle.properties file ([#4432](https://github.com/starship/starship/issues/4432)) ([14ee81b](https://github.com/starship/starship/commit/14ee81b9c31047993217f060b57fb327a58c0d38))
* **preset:** Add No Empty Icons preset ([#4518](https://github.com/starship/starship/issues/4518)) ([1a3d51f](https://github.com/starship/starship/commit/1a3d51fe76c5a62d53533f5d14ceb4425d5a33a5))
* **aws:** enable when using .aws/credentials ([#4604](https://github.com/starship/starship/issues/4604)) ([c8ac877](https://github.com/starship/starship/commit/c8ac8777a593358868813254c662da5fcb9fe6c8))
* **buf:** broken icon on windows 10 ([#4689](https://github.com/starship/starship/issues/4689)) ([7341607](https://github.com/starship/starship/commit/7341607c294a633477005d777bd03b18522aabf4))
* **ci:** cache after selecting the toolchain ([#4619](https://github.com/starship/starship/issues/4619)) ([e4dbff0](https://github.com/starship/starship/commit/e4dbff0fc7e88f792b90703f03f83e31d401b90e))
* **container:** avoid detecting WSL as a systemd-container ([#4593](https://github.com/starship/starship/issues/4593)) ([b47a4fe](https://github.com/starship/starship/commit/b47a4fe51470a36116b5c941c6e07ac5730585ea))
* don't attempt to display cmd_duration notification if in TTY ([#4535](https://github.com/starship/starship/issues/4535)) ([0427863](https://github.com/starship/starship/commit/04278631687da388005f2c26f3da2115b9075bf5))
* **java:** Improved regex for Java version (starship[#4610](https://github.com/starship/starship/issues/4610)) ([#4616](https://github.com/starship/starship/issues/4616)) ([a9eb65e](https://github.com/starship/starship/commit/a9eb65ef35de948880cbf340ffbfe6af126e5e44))
* **nu:** remove -c parameter from `term size` ([#4477](https://github.com/starship/starship/issues/4477)) ([4999530](https://github.com/starship/starship/commit/49995301ce90a0f63b2d5f9cbb30021a0f08f6ff))
* **pwsh:** fix error log display on older versions of pwsh ([#4650](https://github.com/starship/starship/issues/4650)) ([ef83e7a](https://github.com/starship/starship/commit/ef83e7a0928231b02650b3554ccd5bf21164aaff))
* **status:** replace multiply with cross mark emoji ([#4461](https://github.com/starship/starship/issues/4461)) ([186d99e](https://github.com/starship/starship/commit/186d99e623d22fe9e2f7e52378f2ec4015f713d4))
* add user-defined color palette ([#4209](https://github.com/starship/starship/issues/4209)) ([d93074d](https://github.com/starship/starship/commit/d93074d0569db4bafb1788aa3f39136b734b5370))
* **fish:** Enable left and right transience ([#4204](https://github.com/starship/starship/issues/4204)) ([06281c2](https://github.com/starship/starship/commit/06281c268d74a85d5b28e953bea251a2115f5568))
* **module:** Add a meson devenv indicator ([#4389](https://github.com/starship/starship/issues/4389)) ([355800f](https://github.com/starship/starship/commit/355800f8147b1755a5289dc679e2147abd662daf))
* **status:** Support formatting of pipestatus separator ([#4264](https://github.com/starship/starship/issues/4264)) ([6e35dfa](https://github.com/starship/starship/commit/6e35dfa85aeebb3f714389a9286623dc0f60d799))
### Bug Fixes
* **buf:** fix spacing & harmonize docs with actual configuration ([#4450](https://github.com/starship/starship/issues/4450)) ([3d45236](https://github.com/starship/starship/commit/3d452367bdde22a2554cc74bee4d1adfee7e8e04))
* **git_commit:** only use exact match for tag by default ([#4281](https://github.com/starship/starship/issues/4281)) ([5984f08](https://github.com/starship/starship/commit/5984f0829ef5369e83c28108378fe0065a617b3c))
* Disable multithreading in `jwalk` (via `gitoxide`) as workaround for [#4251](https://github.com/starship/starship/issues/4251) ([#4258](https://github.com/starship/starship/issues/4258)) ([37b54f7](https://github.com/starship/starship/commit/37b54f7ac3ba53ea851b478501a96a7c4e188fc4))
* Add support for blink, hidden, and strikethrough styles. ([#4138](https://github.com/starship/starship/issues/4138)) ([aaab920](https://github.com/starship/starship/commit/aaab920f88015eb0a44e6514bf19b1db2b14829f))
* Add the ability to have some file extensions *prevent* a module from triggering ([#4043](https://github.com/starship/starship/issues/4043)) ([dd73447](https://github.com/starship/starship/commit/dd73447329e637ee207b1103ecb6a4bdbdc89324))
* Enable transience for Cmd and PowerShell ([#4143](https://github.com/starship/starship/issues/4143)) ([6e9c013](https://github.com/starship/starship/commit/6e9c013e60e59660cb7ae6289af5ed129ca85996))
* **git:** replace `git2` with `git-repository` ([#3883](https://github.com/starship/starship/issues/3883)) ([ac55a01](https://github.com/starship/starship/commit/ac55a01d0ffe907ef7af48c9597c0bca4dbd8c69))
* **k8s:** Add folder detection to the k8s module. ([#4157](https://github.com/starship/starship/issues/4157)) ([5c5969c](https://github.com/starship/starship/commit/5c5969c50b2490309b7ae9f7e6f5f75ea04a512d))
* **package:** support cargo workspace versions ([#4161](https://github.com/starship/starship/issues/4161)) ([0a1235e](https://github.com/starship/starship/commit/0a1235e27944f152ca195c32e7eef8985d475989))
* **status:** Add pipestatus_segment_format option to status module ([#4103](https://github.com/starship/starship/issues/4103)) ([6143848](https://github.com/starship/starship/commit/61438484bdc76601a185298f14337cfb4d5b4e0b))
### Bug Fixes
* **aws:** support official `AWS_SHARED_CREDENTIALS_FILE` variable ([#4242](https://github.com/starship/starship/issues/4242)) ([1390036](https://github.com/starship/starship/commit/13900368826cf1aca160fd650f19cecc1a047372))
* **timings:** count time spent on custom on 'when' command failure ([#4121](https://github.com/starship/starship/issues/4121)) ([aae1ed0](https://github.com/starship/starship/commit/aae1ed04babf4c7d8baaad670c076947d7200675))
* **rust:** avoid calling `rustup` in more conditions ([#4174](https://github.com/starship/starship/issues/4174)) ([d8ac940](https://github.com/starship/starship/commit/d8ac940098eb16417742723c627d0de864597410))
* **winget:** Add support for winget package manager ([#4042](https://github.com/starship/starship/issues/4042)) ([ef52f9e](https://github.com/starship/starship/commit/ef52f9e77ec66f5189a18acfdce399882c37fdd8))
### Bug Fixes
* **character:** Standadise Vim config names ([#4081](https://github.com/starship/starship/issues/4081)) ([6761938](https://github.com/starship/starship/commit/67619386cdd7537f0ab9af77e701409e97a87917))
* **install:** Have fixed a spacing issue in output ([#4082](https://github.com/starship/starship/issues/4082)) ([2ffe173](https://github.com/starship/starship/commit/2ffe1737f06db4ce89a21b2b5238f3ad76c94bca))
* Add support for Daml ([#4004](https://github.com/starship/starship/issues/4004)) ([3fe6cc0](https://github.com/starship/starship/commit/3fe6cc023cd52917ae60a4d06ee6f1f78baa19e7))
* **kubernetes:** add user alias ([#4008](https://github.com/starship/starship/issues/4008)) ([df5c2d8](https://github.com/starship/starship/commit/df5c2d8836622677460e34fa8082faa6b1a52835))
* **release:** add windows msi installers ([#4031](https://github.com/starship/starship/issues/4031)) ([89fd532](https://github.com/starship/starship/commit/89fd5320af248207e8b253790bd191d8daa88dbe))
### Bug Fixes
* escape text segments in meta variables ([#3563](https://github.com/starship/starship/issues/3563)) ([7d31bac](https://github.com/starship/starship/commit/7d31bac1cc3f39bd02f2e188e69283c566b816ed))
* **fish:** add proper vi mode detection for fish shell ([#3839](https://github.com/starship/starship/issues/3839)) ([1469763](https://github.com/starship/starship/commit/146976351ec804ab1594d5262a1e0dd2d2de4972))
* **install:** ignore tarfile ownership values when installing as root ([#4046](https://github.com/starship/starship/issues/4046)) ([1a91510](https://github.com/starship/starship/commit/1a91510beda1de2c3b149b7aacc0d76cf4652482))
* **nu:** don't use `cygpath` for starship binary path in init ([#4001](https://github.com/starship/starship/issues/4001)) ([9b52475](https://github.com/starship/starship/commit/9b52475e541f751e8c650587cd8c1615fe00b1d0))
* some typos ([e7c1976](https://github.com/starship/starship/commit/e7c19765282eb31daf85e5eba26e13828bc2f6c7))
@ -10,7 +10,7 @@ If you have any questions that aren't addressed in this document, please don't h
- **Module**: A component in the prompt giving information based on contextual information from your OS. For example, the `rust` module shows the version of Rust that is currently installed on your computer, if your current directory is a Rust project.
- **Segment**: Smaller sub-components that compose a module. For example, the `symbol` segment in the `rust` module contains the character that is shown before the version number (`🦀` by default).
- **Segment**: Smaller subcomponents that compose a module. For example, the `symbol` segment in the `rust` module contains the character that is shown before the version number (`🦀` by default).
To run a external command (e.g. to get the version of a tool) and to allow for mocking use the `context.exec_cmd` function. Here's a quick example:
To run an external command (e.g. to get the version of a tool) and to allow for mocking use the `context.exec_cmd` function. Here's a quick example:
```rust
use super::{Context, Module, ModuleConfig};
@ -127,7 +127,7 @@ STARSHIP_LOG=trace cargo run
## Linting
Starship source files are linted with [clippy](https://crates.io/crates/clippy). Clippy will be ran as part of CI. Linting errors will fail a build, so it is suggested that you run Clippy locally:
Starship source files are linted with [clippy](https://crates.io/crates/clippy). Clippy will be run as part of CI. Linting errors will fail a build, so it is suggested that you run Clippy locally:
If a module depends on output of another program, then that output should be added to the match statement in [`utils.rs`](src/utils.rs). The match has to be exactly the same as the call to `utils::exec_cmd()`, including positional arguments and flags. The array of arguments are joined by a `" "`, so `utils::exec_cmd("program", &["arg", "more_args"])` would match with the `program arg more_args` match statement.
If a module depends on output of another program, then that output should be added to the match statement in [`utils.rs`](src/utils.rs). The match has to be exactly the same as the call to `utils::exec_cmd()`, including positional arguments and flags. The array of arguments is joined by a `" "`, so `utils::exec_cmd("program", &["arg", "more_args"])` would match with the `program arg more_args` match statement.
If the program cannot be mocked (e.g. It performs some filesystem operations, either writing or reading files) then it has to added to the project's GitHub Actions workflow file([`.github/workflows/workflow.yml`](.github/workflows/workflow.yml)) and the test has to be marked with an `#[ignored]`. This ensures that anyone can run the test suite locally without needing to pre-configure their environment. The `#[ignored]` attribute is bypassed during CI runs in GitHub Actions.
@ -251,7 +251,7 @@ Changes to documentation can be viewed in a rendered state from the GitHub PR pa
(go to the CI section at the bottom of the page and look for "deploy preview", then
click on "details"). If you want to view changes locally as well, follow these steps.
After cloning the project, you can do the following to run the VuePress website on your local machine:
After cloning the project, you can do the following to run the VitePress website on your local machine:
1. `cd` into the `/docs` directory.
2. Install the project dependencies:
@ -266,7 +266,7 @@ After cloning the project, you can do the following to run the VuePress website
npm run dev
```
Once setup is complete, you can refer to VuePress documentation on the actual implementation here: <https://vuepress.vuejs.org/guide/>.
Once setup is complete, you can refer to VitePress documentation on the actual implementation here: <https://vitepress.dev/guide/getting-started>.
## Git/GitHub workflow
@ -292,7 +292,7 @@ everyone remember what they are. Don't worry: most of them are quite simple!
appropriate--this is a bare minimum).
- [ ] Add the variable to the appropriate location in the "Default Prompt
Format" section of the documentation
- [ ] Add an appropriate choice of options to each preset in `docs/presets/README.md`
- [ ] Add an appropriate choice of options to each preset in `docs/public/presets/toml`
- [ ] Update the config file schema by running `cargo run --features config-schema -- config-schema > .github/config-schema.json`
- [ ] Create configs structs/traits in `src/configs/<module>.rs` and add the
- A [Nerd Font](https://www.nerdfonts.com/) installed and enabled in your terminal (for example, try the [FiraCode Nerd Font](https://www.nerdfonts.com/font-downloads)).
- A [Nerd Font](https://www.nerdfonts.com/) installed and enabled in your terminal (for example, try the [FiraCode Nerd Font](https://www.nerdfonts.com/font-downloads)).
### Step 1. Install Starship
@ -215,15 +226,13 @@ Alternatively, install Starship using any of the following package managers:
description: Starship is the minimal, blazing fast, and extremely customizable prompt for any shell! Shows the information you need, while staying sleek and minimal. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, and PowerShell.
@ -163,9 +294,11 @@ in `format` is also supported in `right_format`. The `$all` variable will only c
not explicitly used in either `format` or `right_format`.
Note: The right prompt is a single line following the input location. To right align modules above
the input line in a multi-line prompt, see the [`fill` module](/config/#fill).
the input line in a multi-line prompt, see the [`fill` module](../config/#fill).
`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd.
`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd, nushell, bash.
Note: The [Ble.sh](https://github.com/akinomyoga/ble.sh) framework v0.4 or higher should be installed in order to use right prompt in bash.
### Example
@ -189,7 +322,7 @@ Produces a prompt like the following:
Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote).
Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`.
Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `'[∙](bright-black) '`.
Note: `continuation_prompt` should be set to a literal string without any variables.
@ -204,8 +337,8 @@ Note: Continuation prompts are only available in the following shells:
```toml
# ~/.config/starship.toml
# A continuation prompt that displays two filledin arrows
continuation_prompt = "▶▶"
# A continuation prompt that displays two filled-in arrows
continuation_prompt = '▶▶ '
```
## Style Strings
@ -217,6 +350,9 @@ Style strings are a list of words, separated by whitespace. The words are not ca
- `underline`
- `dimmed`
- `inverted`
- `blink`
- `hidden`
- `strikethrough`
- `bg:<color>`
- `fg:<color>`
- `<color>`
@ -236,3 +372,9 @@ A color specifier can be one of the following:
- A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png).
If multiple colors are specified for foreground/background, the last one in the string will take priority.
Not every style string will be displayed correctly by every terminal. In particular, the following known quirks exist:
- Many terminals disable support for `blink` by default.
- `hidden` is [not supported on iTerm](https://gitlab.com/gnachman/iterm2/-/issues/4564).
- `strikethrough` is not supported by the default macOS Terminal.app.
description: Starship is the minimal, blazing fast, and extremely customizable prompt for any shell! Shows the information you need, while staying sleek and minimal. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, and PowerShell.
@ -56,10 +58,10 @@ description: Starship is the minimal, blazing fast, and extremely customizable p
brew install starship
```
بإستخدام [Scoop](https://scoop.sh):
With [Winget](https://github.com/microsoft/winget-cli):
```powershell
scoop install starship
winget install starship
```
1. أضف ما يلي إلى ملف تكوين موجه الأوامر الخاص بك:
@ -120,13 +122,13 @@ description: Starship is the minimal, blazing fast, and extremely customizable p
#### Elvish
::: تحذير
::: warning
Only elvish v0.18 or higher is supported.
:::
أضف ما يلي إلى نهاية `~/.elvish/rc.elv`:
أضف ما يلي إلى نهاية الملف `~/.elvish/rc.elv`:
```sh
# ~/.elvish/rc.elv
@ -148,24 +150,26 @@ description: Starship is the minimal, blazing fast, and extremely customizable p
#### Nushell
::: تحذير
::: warning
This will change in the future. Only Nushell v0.61+ is supported.
This will change in the future. Only Nushell v0.78+ is supported.
:::
Add the following to to the end of your Nushell env file (find it by running `$nu.env-path` in Nushell):
Add the following to the end of your Nushell env file (find it by running `$nu.env-path` in Nushell):
```sh
mkdir ~/.cache/starship
starship init nu | save ~/.cache/starship/init.nu
starship init nu | save -f ~/.cache/starship/init.nu
```
And add the following to the end of your Nushell configuration (find it by running `$nu.config-path`):
```sh
source ~/.cache/starship/init.nu
use ~/.cache/starship/init.nu
```
#### Xonsh
أضف ما يلي إلى نهاية `~/.xonshrc`:
@ -179,7 +183,7 @@ description: Starship is the minimal, blazing fast, and extremely customizable p
#### Cmd
You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory:
عليك بإستخدام [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) مع Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory:
@ -8,6 +8,98 @@ The configurations in this section are subject to change in future releases of S
:::
## TransientPrompt in PowerShell
It is possible to replace the previous-printed prompt with a custom string. This is useful in cases where all the prompt information is not always needed. To enable this, run `Enable-TransientPrompt` in the shell session. To make it permanent, put this statement in your `$PROFILE`. Transience can be disabled on-the-fly with `Disable-TransientPrompt`.
By default, the left side of input gets replaced with `>`. To customize this, define a new function called `Invoke-Starship-TransientFunction`. For example, to display Starship's `character` module here, you would do
```powershell
function Invoke-Starship-TransientFunction {
&starship module character
}
Invoke-Expression (&starship init powershell)
Enable-TransientPrompt
```
## TransientPrompt and TransientRightPrompt in Cmd
Clink allows you to replace the previous-printed prompt with custom strings. This is useful in cases where all the prompt information is not always needed. To enable this, run `clink set prompt.transient <value>` where \<value\> can be one of:
- `always`: always replace the previous prompt
- `same_dir`: replace the previous prompt only if the working directory is same
- `off`: do not replace the prompt (i.e. turn off transience)
You need to do this only once. Make the following changes to your `starship.lua` to customize what gets displayed on the left and on the right:
- By default, the left side of input gets replaced with `>`. To customize this, define a new function called `starship_transient_prompt_func`. This function receives the current prompt as a string that you can utilize. For example, to display Starship's `character` module here, you would do
```lua
function starship_transient_prompt_func(prompt)
return io.popen("starship module character"
.." --keymap="..rl.getvariable('keymap')
):read("*a")
end
load(io.popen('starship init cmd'):read("*a"))()
```
- By default, the right side of input is empty. To customize this, define a new function called `starship_transient_rprompt_func`. This function receives the current prompt as a string that you can utilize. For example, to display the time at which the last command was started here, you would do
## TransientPrompt and TransientRightPrompt in Fish
It is possible to replace the previous-printed prompt with a custom string. This is useful in cases where all the prompt information is not always needed. To enable this, run `enable_transience` in the shell session. To make it permanent, put this statement in your `~/.config/fish/config.fish`. Transience can be disabled on-the-fly with `disable_transience`.
Note that in case of Fish, the transient prompt is only printed if the commandline is non-empty, and syntactically correct.
- By default, the left side of input gets replaced with a bold-green `❯`. To customize this, define a new function called `starship_transient_prompt_func`. For example, to display Starship's `character` module here, you would do
```fish
function starship_transient_prompt_func
starship module character
end
starship init fish | source
enable_transience
```
- By default, the right side of input is empty. To customize this, define a new function called `starship_transient_rprompt_func`. For example, to display the time at which the last command was started here, you would do
```fish
function starship_transient_rprompt_func
starship module time
end
starship init fish | source
enable_transience
```
## TransientPrompt and TransientRightPrompt in Bash
The [Ble.sh](https://github.com/akinomyoga/ble.sh) framework at v0.4 or higher allows you to replace the previous-printed prompt with custom strings. This is useful in cases where all the prompt information is not always needed. To enable this, put this in `~/.bashrc``bleopt prompt_ps1_transient=<value>`:
The \<value\> here is a colon-separated list of `always`, `same-dir` and `trim`. When `prompt_ps1_final` is empty and this option has a non-empty value, the prompt specified by `PS1` is erased on leaving the current command line. If the value contains a field `trim`, only the last line of multiline `PS1` is preserved and the other lines are erased. Otherwise, the command line will be redrawn as if `PS1=` is specified. When a field `same-dir` is contained in the value and the current working directory is different from the final directory of the previous command line, this option `prompt_ps1_transient` is ignored.
Make the following changes to your `~/.bashrc` to customize what gets displayed on the left and on the right:
- To customize what the left side of input gets replaced with, configure the `prompt_ps1_final` Ble.sh option. For example, to display Starship's `character` module here, you would do
- To customize what the right side of input gets replaced with, configure the `prompt_rps1_final` Ble.sh option. For example, to display the time at which the last command was started here, you would do
## Custom pre-prompt and pre-execution Commands in Cmd
Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements:
@ -121,7 +213,7 @@ You can also set a similar output with PowerShell by creating a function named `
Some shells support a right prompt which renders on the same line as the input. Starship can set the content of the right prompt using the `right_format` option. Any module that can be used in `format` is also supported in `right_format`. The `$all` variable will only contain modules not explicitly used in either `format` or `right_format`.
Note: The right prompt is a single line following the input location. To right align modules above the input line in a multi-line prompt, see the [`fill` module](/config/#fill).
Note: The right prompt is a single line following the input location. To right align modules above the input line in a multi-line prompt, see the [`fill` module](../config/#fill).
`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd.
`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd, nushell, bash.
Note: The [Ble.sh](https://github.com/akinomyoga/ble.sh) framework v0.4 or higher should be installed in order to use right prompt in bash.
### مثال
@ -157,7 +251,7 @@ Produces a prompt like the following:
Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote).
Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`.
Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `'[∙](bright-black) '`.
Note: `continuation_prompt` should be set to a literal string without any variables.
@ -173,7 +267,7 @@ Note: Continuation prompts are only available in the following shells:
# ~/.config/starship.toml
# A continuation prompt that displays two filled in arrows
continuation_prompt = "▶▶"
continuation_prompt = '▶▶ '
```
## Style Strings
@ -185,6 +279,9 @@ Style strings are a list of words, separated by whitespace. The words are not ca
- `underline`
- `dimmed`
- `inverted`
- `blink`
- `hidden`
- `strikethrough`
- `bg:<color>`
- `fg:<color>`
- `<color>`
@ -201,3 +298,9 @@ A color specifier can be one of the following:
- A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png).
If multiple colors are specified for foreground/background, the last one in the string will take priority.
Not every style string will be displayed correctly by every terminal. In particular, the following known quirks exist:
- Many terminals disable support for `blink` by default
- `hidden` is [not supported on iTerm](https://gitlab.com/gnachman/iterm2/-/issues/4564).
- `strikethrough` is not supported by the default macOS Terminal.app
## Why do I see `Executing command "..." timed out.` warnings?
Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout`key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings.
Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout`key](../config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings.
## I see symbols I don't understand or expect, what do they mean?
@ -72,7 +72,7 @@ You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs ca
env STARSHIP_LOG=trace starship module rust
```
If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame.
If starship is being slow you can try using the `timings` command to see if there is a particular module or command that is to blame.
This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output.
Finally if you find a bug you can use the `bug-report` command to create a Github issue.
Finally if you find a bug you can use the `bug-report` command to create a GitHub issue.
```sh
starship bug-report
@ -120,3 +120,11 @@ If Starship was installed using the install script, the following command will d
# Locate and delete the starship binary
sh -c 'rm "$(command -v 'starship')"'
```
## How do I install Starship without `sudo`?
The shell install script (`https://starship.rs/install.sh`) only attempts to use `sudo` if the target installation directory is not writable by the current user. The default installation diretory is the value of the `$BIN_DIR` environment variable or `/usr/local/bin` if `$BIN_DIR` is not set. If you instead set the installation directory to one that is writable by your user, you should be able to install starship without `sudo`. For example, `curl -sS https://starship.rs/install.sh | sh -s -- -b ~/.local/bin` uses the `-b` command line option of the install script to set the installation directory to `~/.local/bin`.
For a non-interactive installation of Starship, don't forget to add the `-y` option to skip the confirmation. Check the source of the installation script for a list of all supported installation options.
When using a package manager, see the documentation for your package manager about installing with or without `sudo`.
- تثبيت [Nerd Font](https://www.nerdfonts.com/) وتمكينه في موجه الأوامر الخاصة بك (على سبيل المثال، جرب [Fira Code Nerd Font](https://www.nerdfonts.com/font-downloads)).
- A [Nerd Font](https://www.nerdfonts.com/) installed and enabled in your terminal (for example, try the [FiraCode Nerd Font](https://www.nerdfonts.com/font-downloads)).
### Step 1. Install Starship
### الخطوة الأولى. تثبيت starship
Select your operating system from the list below to view installation instructions:
حدد نظام التشغيل الخاص بك من القائمة أدناه لعرض تعليمات التثبيت:
<details>
<summary>Android</summary>
Install Starship using any of the following package managers:
يمكنك تثبيت starship باستخدام احد ال package managers التالية:
### الخطوة الثانية. Set up your shell to use Starship
Configure your shell to initialize starship. Select yours from the list below:
لإعداد ال starship قم بإعداد ال shell الخاص بك. اختر ما يناسبك من هذه القائمة:
<details>
<summary>Bash</summary>
@ -280,7 +292,7 @@ eval "$(starship init bash)"
<details>
<summary>Cmd</summary>
You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Create a file at this path `%LocalAppData%\clink\starship.lua` with the following contents:
عليك بإستخدام [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) مع Cmd. قم بإنشاء ملف في المسار `%LocalAppData%\clink\starship.lua` و ضع فيه المحتوى التالي:
1. Tell your shell to use the starship binary as its prompt by modifying its init scripts
1. ثبت ملفات **starship** على جهازك
1. تنبيه موجه الأوامر بإن يقوم بجعل سطر الأوامر ل starship وذلك بتعديل كود الإبتداء
For most users, the instructions on [the main page](/guide/#🚀-installation) will work great. However, for some more specialized platforms, different instructions are needed.
For most users, the instructions on [the main page](../guide/#🚀-installation) will work great. لكن، من أجل الاستخدام المتقدم، هناك حاجة لتوجيهات أخرى.
There are so many platforms out there that they didn't fit into the main README.md file, so here are some installation instructions for other platforms from the community. Is yours not here? Please do add it here if you figure it out!
هناك العديد من الحالات التي لا تلبي المعلومات في ملف README.md احتياجها ولذلك هذه بعض إرشادات التثبيت الإضافية مقدمة من مجتمع starship. إذا كانت لديك ملاحظة وقمت بحلها ولم تجد هذا الحل لها ضمن الحلول التالية، الرجاء أضفها هنا!
## [Chocolatey](https://chocolatey.org)
### المتطلبات الأساسية
Head over to the [Chocolatey installation page](https://chocolatey.org/install) and follow the instructions to install Chocolatey.
إذهب إلى [ صفحة تثبيت Chocolatey ](https://chocolatey.org/install) و اتبع الإرشادات لتثبيت البرنامج.
### Installation
### التثبيت
```powershell
choco install starship
@ -29,7 +29,7 @@ choco install starship
pkg install getconf
```
### Installation
### التثبيت
```sh
curl -sS https://starship.rs/install.sh | sh -s -- --bin-dir /data/data/com.termux/files/usr/bin
Starship v0.45.0 is a release containing breaking changes, in preparation for the big v1.0.0. We have made some major changes around how configuration is done on the prompt, to allow for a greater degree of customization.
النسخة 0.45.0 سوف تستمر في تقديم تحديثات جذرية حتى الوصول للنسخة المستقرة 1.0.0. لقد قمنا بتغييرات رئيسية لكيفية إعداد سطر الأوامر، وذلك يسمح بطيف أكبر من قابلية التخصيص.
This guide is intended to walk you through the breaking changes.
هذا الدليل هو جولة خلال التغييرات الرئيسية التي قمنا بها.
## `prompt_order` has been replaced by a root-level `format`
## `prompt_order`تم استبداله بتنسيق root-level ``
Previously to v0.45.0, `prompt_order` would accept an array of module names in the order which they should be rendered by Starship.
@ -10,6 +10,18 @@ This preset changes the symbols for each module to use Nerd Font symbols.
[](./nerd-font)
## [No Nerd Fonts](./no-nerd-font.md)
This preset changes the symbols for several modules so that no Nerd Font symbols are used anywhere in the prompt.
::: tip
This preset will become the default preset [in a future release of starship](https://github.com/starship/starship/pull/3544).
:::
[Click to view No Nerd Font preset](./no-nerd-font)
## [Bracketed Segments](./bracketed-segments.md)
This preset changes the format of all the built-in modules to show their segment in brackets instead of using the default Starship wording ("via", "on", etc.).
@ -28,6 +40,12 @@ This preset hides the version of language runtimes. If you work in containers or
[](./no-runtimes)
## [No Empty Icons](./no-empty-icons.md)
This preset does not show icons if the toolset is not found.
[](./no-empty-icons.md)
## [Pure Prompt](./pure-preset.md)
This preset emulates the look and behavior of [Pure](https://github.com/sindresorhus/pure).
@ -39,3 +57,21 @@ This preset emulates the look and behavior of [Pure](https://github.com/sindreso
This preset is inspired by [M365Princess](https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/themes/M365Princess.omp.json). It also shows how path substitution works in starship.
[](./pastel-powerline)
## [Tokyo Night](./tokyo-night.md)
This preset is inspired by [tokyo-night-vscode-theme](https://github.com/enkia/tokyo-night-vscode-theme).
[](./tokyo-night)
## [Gruvbox Rainbow](./gruvbox-rainbow.md)
This preset is heavily inspired by [Pastel Powerline](./pastel-powerline.md), and [Tokyo Night](./tokyo-night.md).
[](./gruvbox-rainbow)
## [Jetpack](./jetpack.md)
This is a pseudo minimalist preset inspired by the [geometry](https://github.com/geometry-zsh/geometry) and [spaceship](https://github.com/spaceship-prompt/spaceship-prompt) prompts.
[](./jetpack)
This is a pseudo minimalist preset inspired by the [geometry](https://github.com/geometry-zsh/geometry) and [spaceship](https://github.com/spaceship-prompt/spaceship-prompt) prompts.
> Jetpack uses the terminal's color theme.

### Prerequisite
- Requires a shell with [`right-prompt`](https://starship.rs/advanced-config/#enable-right-prompt) support.
- [Jetbrains Mono](https://www.jetbrains.com/lp/mono/) is recommended.
If toolset files are identified the toolset icon is displayed. If the toolset is not found to determine its version number, it is not displayed. This preset changes the behavior to display the icon only if the toolset information can be determined.

description: Starship is the minimal, blazing fast, and extremely customizable prompt for any shell! Shows the information you need, while staying sleek and minimal. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, and PowerShell.
- A [Nerd Font](https://www.nerdfonts.com/) installed and enabled in your terminal.
### Quick Install
1. Install the **starship** binary:
#### Install Latest Version
With Shell:
```sh
curl -sS https://starship.rs/install.sh | sh
```
To update the Starship itself, rerun the above script. It will replace the current version without touching Starship's configuration.
#### Install via Package Manager
With [Homebrew](https://brew.sh/):
```sh
brew install starship
```
With [Winget](https://github.com/microsoft/winget-cli):
```powershell
winget install starship
```
1. Add the init script to your shell's config file:
#### Bash
`~/.bashrc` এর শেষে নিম্নলিখিত লাইন টি যোগ করুন:
```sh
# ~/.bashrc
eval "$(starship init bash)"
```
#### Fish
`~/.config/fish/config.fish` এর শেষে নিম্নলিখিত লাইন টি যোগ করুন:
```sh
# ~/.config/fish/config.fish
starship init fish | source
```
#### Zsh
`~/.zshrc` এর শেষে নিম্নলিখিত লাইন টি যোগ করুন:
```sh
# ~/.zshrc
eval "$(starship init zsh)"
```
#### Powershell
Add the following to the end of `Microsoft.PowerShell_profile.ps1`. You can check the location of this file by querying the `$PROFILE` variable in PowerShell. Typically the path is `~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1` or `~/.config/powershell/Microsoft.PowerShell_profile.ps1` on -Nix.
```sh
Invoke-Expression (&starship init powershell)
```
#### Ion
`~/.config/ion/initrc` এর শেষে নিম্নলিখিত লাইন টি যোগ করুন:
```sh
# ~/.config/ion/initrc
eval $(starship init ion)
```
#### Elvish
::: warning
Only elvish v0.18 or higher is supported.
:::
`~/.elvish/rc.elv` এর শেষে নিম্নলিখিত লাইন টি যোগ করুন:
```sh
# ~/.elvish/rc.elv
eval (starship init elvish)
```
#### Tcsh
`~/.tcshrc` এর শেষে নিম্নলিখিত লাইন টি যোগ করুন:
```sh
# ~/.tcshrc
eval `starship init tcsh`
```
#### Nushell
::: warning
This will change in the future. Only Nushell v0.78+ is supported.
:::
আপনার Nushell env ফাইলের (Nushell এ `$nu.env-path` কমান্ডটি রান করে ফাইলটি খুঁজে বের করুন) শেষে নিম্নলিখিত লাইনগুলি যোগ করুন:
```sh
mkdir ~/.cache/starship
starship init nu | save -f ~/.cache/starship/init.nu
```
এরপর আপনার Nushell কনফিগের (Nushell এ `$nu.config-path` কমান্ডটি রান করে ফাইলটি খুঁজে বের করুন) শেষে নিম্নলিখিত লাইনটি যোগ করুন:
```sh
use ~/.cache/starship/init.nu
```
#### Xonsh
`~/.xonshrc` এর শেষে নিম্নলিখিত লাইন টি যোগ করুন:
```sh
# ~/.xonshrc
execx($(starship init xonsh))
```
#### Cmd
আপনাকে Cmd এর সাথে [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) ব্যবহার করতে হবে । Add the following to a file `starship.lua` and place this file in Clink scripts directory:
While Starship is a versatile shell, sometimes you need to do more than edit `starship.toml` to get it to do certain things. This page details some of the more advanced configuration techniques used in starship.
::: warning
The configurations in this section are subject to change in future releases of Starship.
:::
## TransientPrompt in PowerShell
It is possible to replace the previous-printed prompt with a custom string. This is useful in cases where all the prompt information is not always needed. To enable this, run `Enable-TransientPrompt` in the shell session. To make it permanent, put this statement in your `$PROFILE`. Transience can be disabled on-the-fly with `Disable-TransientPrompt`.
By default, the left side of input gets replaced with `>`. To customize this, define a new function called `Invoke-Starship-TransientFunction`. For example, to display Starship's `character` module here, you would do
```powershell
function Invoke-Starship-TransientFunction {
&starship module character
}
Invoke-Expression (&starship init powershell)
Enable-TransientPrompt
```
## TransientPrompt and TransientRightPrompt in Cmd
Clink allows you to replace the previous-printed prompt with custom strings. This is useful in cases where all the prompt information is not always needed. To enable this, run `clink set prompt.transient <value>` where \<value\> can be one of:
- `always`: always replace the previous prompt
- `same_dir`: replace the previous prompt only if the working directory is same
- `off`: do not replace the prompt (i.e. turn off transience)
You need to do this only once. Make the following changes to your `starship.lua` to customize what gets displayed on the left and on the right:
- By default, the left side of input gets replaced with `>`. To customize this, define a new function called `starship_transient_prompt_func`. This function receives the current prompt as a string that you can utilize. For example, to display Starship's `character` module here, you would do
```lua
function starship_transient_prompt_func(prompt)
return io.popen("starship module character"
.." --keymap="..rl.getvariable('keymap')
):read("*a")
end
load(io.popen('starship init cmd'):read("*a"))()
```
- By default, the right side of input is empty. To customize this, define a new function called `starship_transient_rprompt_func`. This function receives the current prompt as a string that you can utilize. For example, to display the time at which the last command was started here, you would do
## TransientPrompt and TransientRightPrompt in Fish
It is possible to replace the previous-printed prompt with a custom string. This is useful in cases where all the prompt information is not always needed. To enable this, run `enable_transience` in the shell session. To make it permanent, put this statement in your `~/.config/fish/config.fish`. Transience can be disabled on-the-fly with `disable_transience`.
Note that in case of Fish, the transient prompt is only printed if the commandline is non-empty, and syntactically correct.
- By default, the left side of input gets replaced with a bold-green `❯`. To customize this, define a new function called `starship_transient_prompt_func`. For example, to display Starship's `character` module here, you would do
```fish
function starship_transient_prompt_func
starship module character
end
starship init fish | source
enable_transience
```
- By default, the right side of input is empty. To customize this, define a new function called `starship_transient_rprompt_func`. For example, to display the time at which the last command was started here, you would do
```fish
function starship_transient_rprompt_func
starship module time
end
starship init fish | source
enable_transience
```
## TransientPrompt and TransientRightPrompt in Bash
The [Ble.sh](https://github.com/akinomyoga/ble.sh) framework at v0.4 or higher allows you to replace the previous-printed prompt with custom strings. This is useful in cases where all the prompt information is not always needed. To enable this, put this in `~/.bashrc``bleopt prompt_ps1_transient=<value>`:
The \<value\> here is a colon-separated list of `always`, `same-dir` and `trim`. When `prompt_ps1_final` is empty and this option has a non-empty value, the prompt specified by `PS1` is erased on leaving the current command line. If the value contains a field `trim`, only the last line of multiline `PS1` is preserved and the other lines are erased. Otherwise, the command line will be redrawn as if `PS1=` is specified. When a field `same-dir` is contained in the value and the current working directory is different from the final directory of the previous command line, this option `prompt_ps1_transient` is ignored.
Make the following changes to your `~/.bashrc` to customize what gets displayed on the left and on the right:
- To customize what the left side of input gets replaced with, configure the `prompt_ps1_final` Ble.sh option. For example, to display Starship's `character` module here, you would do
- To customize what the right side of input gets replaced with, configure the `prompt_rps1_final` Ble.sh option. For example, to display the time at which the last command was started here, you would do
## Custom pre-prompt and pre-execution Commands in Cmd
Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements:
- To run a custom function right before the prompt is drawn, define a new function called `starship_preprompt_user_func`. This function receives the current prompt as a string that you can utilize. For example, to draw a rocket before the prompt, you would do
```lua
function starship_preprompt_user_func(prompt)
print("🚀")
end
load(io.popen('starship init cmd'):read("*a"))()
```
- To run a custom function right before a command is executed, define a new function called `starship_precmd_user_func`. This function receives the current commandline as a string that you can utilize. For example, to print the command that's about to be executed, you would do
```lua
function starship_precmd_user_func(line)
print("Executing: "..line)
end
load(io.popen('starship init cmd'):read("*a"))()
```
## Custom pre-prompt and pre-execution Commands in Bash
Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. However, Starship does give you limited ability to insert your own functions into the prompt-rendering procedure:
- To run a custom function right before the prompt is drawn, define a new function and then assign its name to `starship_precmd_user_func`. For example, to draw a rocket before the prompt, you would do
```bash
function blastoff(){
echo "🚀"
}
starship_precmd_user_func="blastoff"
```
- To run a custom function right before a command runs, you can use the [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). However, you **must** trap the DEBUG signal _before_ initializing Starship! Starship can preserve the value of the DEBUG trap, but if the trap is overwritten after starship starts up, some functionality will break.
## Custom pre-prompt and pre-execution Commands in PowerShell
PowerShell does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `powershell`. However, Starship does give you limited ability to insert your own functions into the prompt-rendering procedure:
Create a function named `Invoke-Starship-PreCommand`
```powershell
function Invoke-Starship-PreCommand {
$host.ui.Write("🚀")
}
```
## Change Window Title
Some shell prompts will automatically change the window title for you (e.g. to reflect your working directory). Fish even does it by default. Starship does not do this, but it's fairly straightforward to add this functionality to `bash`, `zsh`, `cmd` or `powershell`.
First, define a window title change function (identical in bash and zsh):
```bash
function set_win_title(){
echo -ne "\033]0; YOUR_WINDOW_TITLE_HERE \007"
}
```
You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices).
In `bash`, set this function to be the precmd starship function:
```bash
starship_precmd_user_func="set_win_title"
```
In `zsh`, add this to the `precmd_functions` array:
```bash
precmd_functions+=(set_win_title)
```
If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent.
For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`:
```bash
function set_win_title(){
echo -ne "\033]0; $(basename "$PWD") \007"
}
starship_precmd_user_func="set_win_title"
```
For Cmd, you can change the window title using the `starship_preprompt_user_func` function.
Some shells support a right prompt which renders on the same line as the input. Starship can set the content of the right prompt using the `right_format` option. Any module that can be used in `format` is also supported in `right_format`. The `$all` variable will only contain modules not explicitly used in either `format` or `right_format`.
Note: The right prompt is a single line following the input location. To right align modules above the input line in a multi-line prompt, see the [`fill` module](../config/#fill).
`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd, nushell, bash.
Note: The [Ble.sh](https://github.com/akinomyoga/ble.sh) framework v0.4 or higher should be installed in order to use right prompt in bash.
### Example
```toml
# ~/.config/starship.toml
# A minimal left prompt
format = """$character"""
# move the rest of the prompt to the right
right_format = """$all"""
```
Produces a prompt like the following:
```
▶ starship on rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s
```
## Continuation Prompt
Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote).
Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `'[∙](bright-black) '`.
Note: `continuation_prompt` should be set to a literal string without any variables.
Note: Continuation prompts are only available in the following shells:
- `bash`
- `zsh`
- `PowerShell`
### Example
```toml
# ~/.config/starship.toml
# A continuation prompt that displays two filled in arrows
continuation_prompt = '▶▶ '
```
## Style Strings
Style strings are a list of words, separated by whitespace. The words are not case sensitive (i.e. `bold` and `BoLd` are considered the same string). Each word can be one of the following:
- `bold`
- `italic`
- `underline`
- `dimmed`
- `inverted`
- `blink`
- `hidden`
- `strikethrough`
- `bg:<color>`
- `fg:<color>`
- `<color>`
- `none`
where `<color>` is a color specifier (discussed below). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. The order of words in the string does not matter.
The `none` token overrides all other tokens in a string if it is not part of a `bg:` specifier, so that e.g. `fg:red none fg:blue` will still create a string with no styling. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. It may become an error to use `none` in conjunction with other tokens in the future.
A color specifier can be one of the following:
- One of the standard terminal colors: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. You can optionally prefix these with `bright-` to get the bright version (e.g. `bright-white`).
- A `#` followed by a six-digit hexadecimal number. This specifies an [RGB color hex code](https://www.w3schools.com/colors/colors_hexadecimal.asp).
- A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png).
If multiple colors are specified for foreground/background, the last one in the string will take priority.
Not every style string will be displayed correctly by every terminal. In particular, the following known quirks exist:
- Many terminals disable support for `blink` by default
- `hidden` is [not supported on iTerm](https://gitlab.com/gnachman/iterm2/-/issues/4564).
- `strikethrough` is not supported by the default macOS Terminal.app
## How do I get command completion as shown in the demo GIF?
Completion support, or autocomplete, is provided by your shell of choice. In the case of the demo, the demo was done with [Fish Shell](https://fishshell.com/), which provides completions by default. If you use Z Shell (zsh), I'd suggest taking a look at [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions).
## Do top level `format` and `<module>.disabled` do the same thing?
Yes, they can both be used to disable modules in the prompt. If all you plan to do is disable modules, `<module>.disabled` is the preferred way to do so for these reasons:
- Disabling modules is more explicit than omitting them from the top level `format`
- Newly created modules will be added to the prompt as Starship is updated
## The docs say Starship is cross-shell. Why isn't my preferred shell supported?
The way Starship is built, it should be possible to add support for virtually any shell. The starship binary is stateless and shell agnostic, so as long as your shell supports prompt customization and shell expansion, Starship can be used.
Here's a small example getting Starship working with bash:
```sh
# Get the status code from the last command executed
STATUS=$?
# Get the number of jobs running.
NUM_JOBS=$(jobs -p | wc -l)
# Set the prompt to the output of `starship prompt`
The [Bash implementation](https://github.com/starship/starship/blob/master/src/init/starship.bash) built into Starship is slightly more complex to allow for advanced features like the [Command Duration module](https://starship.rs/config/#command-duration) and to ensure that Starship is compatible with pre-installed Bash configurations.
For a list of all flags accepted by `starship prompt`, use the following command:
```sh
starship prompt --help
```
The prompt will use as much context as is provided, but no flags are "required".
## How do I run Starship on Linux distributions with older versions of glibc?
If you get an error like "_version 'GLIBC_2.18' not found (required by starship)_" when using the prebuilt binary (for example, on CentOS 6 or 7), you can use a binary compiled with `musl` instead of `glibc`:
```sh
curl -sS https://starship.rs/install.sh | sh -s -- --platform unknown-linux-musl
```
## Why do I see `Executing command "..." timed out.` warnings?
Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout`key](../config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings.
## I see symbols I don't understand or expect, what do they mean?
If you see symbols that you don't recognise you can use `starship explain` to explain the currently showing modules.
## Starship is doing something unexpected, how can I debug it?
You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs can be very verbose so it is often useful to use the `module` command if you are trying to debug a particular module, for example, if you are trying to debug the `rust` module you could run the following command to get the trace logs and output from the module.
```sh
env STARSHIP_LOG=trace starship module rust
```
If starship is being slow you can try using the `timings` command to see if there is a particular module or command that is to blame.
```sh
env STARSHIP_LOG=trace starship timings
```
This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output.
Finally if you find a bug you can use the `bug-report` command to create a GitHub issue.
```sh
starship bug-report
```
## Why don't I see a glyph symbol in my prompt?
The most common cause of this is system misconfiguration. Some Linux distros in particular do not come with font support out-of-the-box. You need to ensure that:
- Your locale is set to a UTF-8 value, like `de_DE.UTF-8` or `ja_JP.UTF-8`. If `LC_ALL` is not a UTF-8 value, [you will need to change it](https://www.tecmint.com/set-system-locales-in-linux/).
- You have an emoji font installed. Most systems come with an emoji font by default, but some (notably Arch Linux) do not. You can usually install one through your system's package manager--[noto emoji](https://www.google.com/get/noto/help/emoji/) is a popular choice.
- You are using a [Nerd Font](https://www.nerdfonts.com/).
To test your system, run the following commands in a terminal:
```sh
echo -e "\xf0\x9f\x90\x8d"
echo -e "\xee\x82\xa0"
```
The first line should produce a [snake emoji](https://emojipedia.org/snake/), while the second should produce a [powerline branch symbol (e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs).
If either symbol fails to display correctly, your system is still misconfigured. Unfortunately, getting font configuration correct is sometimes difficult. Users on the Discord may be able to help. If both symbols display correctly, but you still don't see them in starship, [file a bug report!](https://github.com/starship/starship/issues/new/choose)
## How do I uninstall Starship?
Starship is just as easy to uninstall as it is to install in the first place.
1. Remove any lines in your shell config (e.g. `~/.bashrc`) used to initialize Starship.
1. Delete the Starship binary.
If Starship was installed using a package manager, please refer to their docs for uninstallation instructions.
If Starship was installed using the install script, the following command will delete the binary:
```sh
# Locate and delete the starship binary
sh -c 'rm "$(command -v 'starship')"'
```
## How do I install Starship without `sudo`?
The shell install script (`https://starship.rs/install.sh`) only attempts to use `sudo` if the target installation directory is not writable by the current user. The default installation diretory is the value of the `$BIN_DIR` environment variable or `/usr/local/bin` if `$BIN_DIR` is not set. If you instead set the installation directory to one that is writable by your user, you should be able to install starship without `sudo`. For example, `curl -sS https://starship.rs/install.sh | sh -s -- -b ~/.local/bin` uses the `-b` command line option of the install script to set the installation directory to `~/.local/bin`.
For a non-interactive installation of Starship, don't forget to add the `-y` option to skip the confirmation. Check the source of the installation script for a list of all supported installation options.
When using a package manager, see the documentation for your package manager about installing with or without `sudo`.
**আপনার টার্মিনাল এর জন্য একটি সহজ, প্রচণ্ড দ্রুত এবং অশেষভাবে কাস্টমাইজ করার মতো সুবিধাসম্পন্ন একটি প্রম্প্ট!**
- **দ্রুত:** দ্রুত - সত্যি সত্যিই _অনেক_ দ্রুত! 🚀
- **কাস্টমাইজ করার সুবিধা:** প্রম্পটের প্রতিটি দিক কনফিগ করুন মন মত ।
- **ব্যতিক্রমহীন:** যেকোনো অপারেটিং সিস্টেম ও শেলে কাজ করে ।
- **চালাক:** এক নজরে দরকারি সকল তথ্য দেখা যায় ।
- **ফিচার সমৃদ্ধ:** আপনার প্রিয় সকল টুল ব্যবহার করতে পারবেন ।
- **সহজ:** অনায়াসে ইন্সটল করুন – মিনিটের মধ্যে ব্যবহার শুরু করে দিন ।
<palign="center">
<ahref="https://starship.rs/config/"><strong>Starship এর ডকুমেন্টেশন ঘুরে দেখুন ▶</strong></a>
</p>
<aname="🚀-installation"></a>
## 🚀 ইন্সটল
### পূর্বশর্ত
- আপনার থেকে টার্মিনালে একটি [Nerd Font](https://www.nerdfonts.com/) ব্যবহার করতে হবে (উদাহরণস্বরূপ আপনি [FiraCode Nerd Font](https://www.nerdfonts.com/font-downloads) টি ব্যবহার করতে পারেন) ।
### ধাপ ১. Starship ইন্সটল করুন
ইনস্টলেশন নির্দেশিকা দেখতে নিচের তালিকা থেকে আপনার অপারেটিং সিস্টেম বাছাই করুন:
<details>
<summary>অ্যান্ড্রয়েড</summary>
নিম্নলিখিত প্যাকেজ ম্যানেজার গুলোর মধ্যে থেকে যেকোনো একটি ব্যবহার করে Starship ইন্সটল করুন:
আপনার সিস্টেম এর জন্য লেটেস্ট সংস্করণটি [রিলিজ সেকশনে](https://github.com/starship/starship/releases/latest) থাকা MSI-ইন্সটলার ব্যবহার করে ইন্সটল করুন ।
নিম্নলিখিত প্যাকেজ ম্যানেজার গুলোর মধ্যে থেকে যেকোনো একটি ব্যবহার করে Starship ইন্সটল করুন:
### ধাপ ২. Starship ব্যবহার করার জন্য আপনার শেল প্রস্তুত করুন
Starship চালু করতে আপনার শেল কে ঠিক মতো কনফিগার করুন । নিম্নলিখিত তালিকা থেকে আপনার শেল বাছাই করুন:
<details>
<summary>Bash</summary>
`~/.bashrc` এর শেষে নিম্নলিখিত লাইন টি যোগ করুন:
```sh
eval "$(starship init bash)"
```
</details>
<details>
<summary>Cmd</summary>
আপনাকে Cmd এর সাথে [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) ব্যবহার করতে হবে । `%LocalAppData%\clink\starship.lua` ফাইল টি তৈরি করে তার মধ্যে নিম্নলিখিত লাইন টি যোগ করুন:
```lua
load(io.popen('starship init cmd'):read("*a"))()
```
</details>
<details>
<summary>Elvish</summary>
`~/.elvish/rc.elv` এর শেষে নিম্নলিখিত লাইন টি যোগ করুন:
```sh
eval (starship init elvish)
```
বিঃদ্রঃ শুধুমাত্র Elvish v0.18+ কাজ করবে ।
</details>
<details>
<summary>Fish</summary>
`~/.config/fish/config.fish` এর শেষে নিম্নলিখিত লাইন টি যোগ করুন:
```fish
starship init fish | source
```
</details>
<details>
<summary>Ion</summary>
`~/.config/ion/initrc` এর শেষে নিম্নলিখিত লাইন টি যোগ করুন:
```sh
eval $(starship init ion)
```
</details>
<details>
<summary>Nushell</summary>
আপনার Nushell env ফাইলের (Nushell এ `$nu.env-path` কমান্ডটি রান করে ফাইলটি খুঁজে বের করুন) শেষে নিম্নলিখিত লাইনগুলি যোগ করুন:
```sh
mkdir ~/.cache/starship
starship init nu | save -f ~/.cache/starship/init.nu
```
এরপর আপনার Nushell কনফিগের (Nushell এ `$nu.config-path` কমান্ডটি রান করে ফাইলটি খুঁজে বের করুন) শেষে নিম্নলিখিত লাইনটি যোগ করুন:
```sh
use ~/.cache/starship/init.nu
```
বিঃদ্রঃ শুধুমাত্র Nushell v0.78+ কাজ করবে ।
</details>
<details>
<summary>PowerShell</summary>
আপনার PowerShell কনফিগের (PowerShell এ `$PROFILE` কমান্ডটি রান করে ফাইলটি খুঁজে বের করুন) শেষে নিম্নলিখিত লাইনটি যোগ করুন:
```powershell
Invoke-Expression (&starship init powershell)
```
</details>
<details>
<summary>Tcsh</summary>
`~/.tcshrc` এর শেষে নিম্নলিখিত লাইন টি যোগ করুন:
```sh
eval `starship init tcsh`
```
</details>
<details>
<summary>Xonsh</summary>
`~/.xonshrc` এর শেষে নিম্নলিখিত লাইন টি যোগ করুন:
```python
execx($(starship init xonsh))
```
</details>
<details>
<summary>Zsh</summary>
`~/.zshrc` এর শেষে নিম্নলিখিত লাইন টি যোগ করুন:
```sh
eval "$(starship init zsh)"
```
</details>
### ধাপ ৩. Starship কনফিগার করুন
নতুন একটি শেল চালু করুন, এরপর আপনি আপনার সুন্দর নতুন শেল প্রম্প্ট দেখতে পাবেন । পূর্ব নির্ধারিত কনফিগ যদি ভালো লেগে থাকে, তাহলে উপভোগ করুন!
আপনি যদি Starship কে নিজের মতো করে কাস্টমাইজ করতে চান:
- **[কনফিগারেশন](https://starship.rs/config/)** – আপনার নিজের ইচ্ছা মতো নিজের প্রম্প্টকে পরিবর্তন করতে শিখুন
- **[অন্যদের তৈরি কনফিগ](https://starship.rs/presets/)** – অন্যদের তৈরি করা সুন্দর কনফিগ দেখে অনুপ্রাণিত হন
## 🤝 নিজে অবদান রাখুন
আমরা সবসময় **সকল দক্ষতা স্তরের** অবদানকারীদের খুঁজছি! আপনি যদি সহজ ভাবে এই প্রোজেক্টে অবদান রাখতে চান তাইলে ["good first issue"](https://github.com/starship/starship/labels/🌱%20good%20first%20issue) গুলির সমাধান করার চেষ্টা করতে পারেন ।
আপনি যদি ইংরেজি ছাড়া অন্য কোন ভাষায় সাবলীল হন, তাহলে আপনি আমাদের ডকুমেন্টেশন অনুবাদে এবং আপ-টু-ডেট রাখতে সহায়তা করতে পারেন, আমরা খুবই কৃতজ্ঞ হব । যদি এক্ষেত্রে সাহায্য করতে চান, তাহলে [Starship Crowdin](https://translate.starship.rs/) পেইজ এ গিয়ে আপনার অনুবাদ গুলি যোগ করতে পারবেন ।
আপনি যদি Starship এ অবদান রাখতে আগ্রহী হন, অনুগ্রহ করে আমাদের অবদান রাখার [নির্দেশিকা ও নিয়মকানুন](https://github.com/starship/starship/blob/master/CONTRIBUTING.md) দেখে নিবেন । এছাড়াও, নির্দ্বিধায় আমাদের [Discord](https://discord.gg/8Jzqu3T) সার্ভারে এসে হাই বলে যান । 👋
## 💭 অনুপ্রেরণা
অনুগ্রহ করে Starship এর পূর্ববর্তী এইসব প্রোজেক্ট থেকে ঘুরে আসুন, যারা Starship তৈরিতে অনেক অনুপ্রেরণা দিয়েছে । 🙏
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** – A ZSH prompt for astronauts.
- **[denysdovhan/robbyrussell-node](https://github.com/denysdovhan/robbyrussell-node)** – Cross-shell robbyrussell theme written in JavaScript.
- **[reujab/silver](https://github.com/reujab/silver)** – A cross-shell customizable powerline-like prompt with icons.
## ❤️ স্পনসর
[একজন স্পনসর হয়ে](https://github.com/sponsors/starship) এই প্রোজেক্টটিকে আর্থিক ভাবে সহায়তা করুন । আপনার নাম অথবা লোগো নিম্নে দেখা যাবে আপনার ওয়েবসাইট এর লিঙ্ক সহ ।
1. Tell your shell to use the starship binary as its prompt by modifying its init scripts
For most users, the instructions on [the main page](../guide/#🚀-installation) will work great. However, for some more specialized platforms, different instructions are needed.
There are so many platforms out there that they didn't fit into the main README.md file, so here are some installation instructions for other platforms from the community. Is yours not here? Please do add it here if you figure it out!
## [Chocolatey](https://chocolatey.org)
### পূর্বশর্ত
Head over to the [Chocolatey installation page](https://chocolatey.org/install) and follow the instructions to install Chocolatey.
### ইন্সটল
```powershell
choco install starship
```
## [termux](https://termux.com)
### পূর্বশর্ত
```sh
pkg install getconf
```
### ইন্সটল
```sh
curl -sS https://starship.rs/install.sh | sh -s -- --bin-dir /data/data/com.termux/files/usr/bin
```
## [Funtoo Linux](https://www.funtoo.org/Welcome)
### ইন্সটল
On Funtoo Linux, starship can be installed from [core-kit](https://github.com/funtoo/core-kit/tree/1.4-release/app-shells/starship) via Portage:
```sh
emerge app-shells/starship
```
## [Nix](https://nixos.wiki/wiki/Nix)
### Getting the Binary
#### Imperatively
```sh
nix-env -iA nixos.starship
```
#### Declarative, single user, via [home-manager](https://github.com/nix-community/home-manager)
Enable the `programs.starship` module in your `home.nix` file, and add your settings
```nix
{
programs.starship = {
enable = true;
# Configuration written to ~/.config/starship.toml
settings = {
# add_newline = false;
# character = {
# success_symbol = "[➜](bold green)";
# error_symbol = "[➜](bold red)";
# };
# package.disabled = true;
};
};
}
```
then run
```sh
home-manager switch
```
#### Declarative, system-wide, with NixOS
Add `pkgs.starship` to `environment.systemPackages` in your `configuration.nix`, then run
Starship v0.45.0 is a release containing breaking changes, in preparation for the big v1.0.0. We have made some major changes around how configuration is done on the prompt, to allow for a greater degree of customization.
This guide is intended to walk you through the breaking changes.
## `prompt_order` has been replaced by a root-level `format`
Previously to v0.45.0, `prompt_order` would accept an array of module names in the order which they should be rendered by Starship.
Starship v0.45.0 instead accepts a `format` value, allowing for customization of the prompt outside of the modules themselves.
**Example pre-v0.45.0 configuration**
```toml
prompt_order = [
"username",
"hostname",
"directory",
"git_branch",
"git_commit",
"git_state",
"git_status",
"cmd_duration",
"custom",
"line_break",
"jobs",
"battery",
"time",
"character",
]
```
**Example v0.45.0 configuration**
```toml
format = """\
$username\
$hostname\
$directory\
$git_branch\
$git_commit\
$git_state\
$git_status\
$cmd_duration\
$custom\
$line_break\
$jobs\
$battery\
$time\
$character\
"""
```
## Module `prefix` and `suffix` have been replaced by `format`
Previously to v0.45.0, some modules would accept `prefix` and/or `suffix` in order to stylize the way that modules are rendered.
Starship v0.45.0 instead accepts a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output.
**Example pre-v0.45.0 configuration**
```toml
[cmd_duration]
prefix = "took "
```
**Example v0.45.0 configuration**
```toml
[cmd_duration]
# $duration – The command duration (e.g. "15s")
# $style – The default style of the module (e.g. "bold yellow")
format = "took [$duration]($style) "
```
### Affected Modules
#### Character
| Removed Property | Replacement |
| ----------------------- | ---------------- |
| `symbol` | `success_symbol` |
| `use_symbol_for_status` | `error_symbol` |
| `style_success` | `success_symbol` |
| `style_failure` | `error_symbol` |
**Changes to the Default Configuration**
```diff
[character]
-- symbol = "❯"
-- error_symbol = "✖"
-- use_symbol_for_status = true
-- vicmd_symbol = "❮"
++ success_symbol = "[❯](bold green)"
++ error_symbol = "[❯](bold red)"
++ vicmd_symbol = "[❮](bold green)"
```
Previously, the `use_symbol_for_status` property was used to configure the prompt to show the `error_symbol` when the last command resulted in a non-zero status code.
With the release of v0.45.0, we now always use `error_symbol` after non-zero status codes, unifying `use_symbol_for_status` and `error_symbol` properties.
To configure the prompt to use the older `use_symbol_for_status = true` configuration, add the following to your config file:
```toml
[character]
error_symbol = "[✖](bold red)"
```
_Note:_ The `character` element automatically adds a space after, so unlike the other `format` strings, we specifically do not add one in the above examples.
#### Command Duration
| Removed Property | Replacement |
| ---------------- | ----------- |
| `prefix` | `format` |
**Changes to the Default Configuration**
```diff
[cmd_duration]
-- prefix = "took "
++ format = "took [$duration]($style) "
```
#### Directory
| Removed Property | Replacement |
| ---------------- | ----------- |
| `prefix` | `format` |
**Changes to the Default Configuration**
```diff
[directory]
-- prefix = "in "
++ format = "[$path]($style)[$read_only]($read_only_style) "
```
#### Environment Variable
| Removed Property | Replacement |
| ---------------- | ----------- |
| `prefix` | `format` |
| `suffix` | `format` |
**Changes to the Default Configuration**
```diff
[env_var]
-- prefix = ""
-- suffix = ""
++ format = "with [$env_value]($style) "
```
#### Git Commit
| Removed Property | Replacement |
| ---------------- | ----------- |
| `prefix` | `format` |
| `suffix` | `format` |
**Changes to the Default Configuration**
```diff
[git_commit]
-- prefix = "("
-- suffix = ")"
++ format = '[\($hash\)]($style) '
```
#### Git Status
| Removed Property | Replacement |
| ----------------- | ----------- |
| `prefix` | `format` |
| `suffix` | `format` |
| `show_sync_count` | `format` |
**Changes to the Default Configuration**
```diff
[git_status]
-- prefix = "["
-- suffix = "]"
-- show_sync_count = false
++ format = '([\[$all_status$ahead_behind\]]($style) )'
```
Previously, the `show_sync_count` property was used to configure the prompt to show the number of commits the branch was ahead or behind the remote branch.
With the release of v0.45.0, this has been replaced with three separate properties, `ahead`, `behind`, and `diverged`.
To configure the prompt to use the older `show_sync_count = true` configuration, set the following to your config file:
Here is a collection of community-submitted configuration presets for Starship. If you have a preset to share, please [submit a PR](https://github.com/starship/starship/edit/master/docs/presets/README.md) updating this file! 😊
To get details on how to use a preset, simply click on the image.
## [Nerd Font Symbols](./nerd-font.md)
This preset changes the symbols for each module to use Nerd Font symbols.
[](./nerd-font)
## [No Nerd Fonts](./no-nerd-font.md)
This preset changes the symbols for several modules so that no Nerd Font symbols are used anywhere in the prompt.
::: tip
This preset will become the default preset [in a future release of starship](https://github.com/starship/starship/pull/3544).
:::
[Click to view No Nerd Font preset](./no-nerd-font)
## [Bracketed Segments](./bracketed-segments.md)
This preset changes the format of all the built-in modules to show their segment in brackets instead of using the default Starship wording ("via", "on", etc.).
[](./bracketed-segments)
## [Plain Text Symbols](./plain-text.md)
This preset changes the symbols for each module into plain text. Great if you don't have access to Unicode.
[](./plain-text)
## [No Runtime Versions](./no-runtimes.md)
This preset hides the version of language runtimes. If you work in containers or virtualized environments, this one is for you!
[](./no-runtimes)
## [No Empty Icons](./no-empty-icons.md)
This preset does not show icons if the toolset is not found.
[](./no-empty-icons.md)
## [Pure Prompt](./pure-preset.md)
This preset emulates the look and behavior of [Pure](https://github.com/sindresorhus/pure).
[](./pure-preset)
## [Pastel Powerline](./pastel-powerline.md)
This preset is inspired by [M365Princess](https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/themes/M365Princess.omp.json). It also shows how path substitution works in starship.
[](./pastel-powerline)
## [Tokyo Night](./tokyo-night.md)
This preset is inspired by [tokyo-night-vscode-theme](https://github.com/enkia/tokyo-night-vscode-theme).
[](./tokyo-night)
## [Gruvbox Rainbow](./gruvbox-rainbow.md)
This preset is heavily inspired by [Pastel Powerline](./pastel-powerline.md), and [Tokyo Night](./tokyo-night.md).
[](./gruvbox-rainbow)
## [Jetpack](./jetpack.md)
This is a pseudo minimalist preset inspired by the [geometry](https://github.com/geometry-zsh/geometry) and [spaceship](https://github.com/spaceship-prompt/spaceship-prompt) prompts.
[](./jetpack)
This preset changes the format of all the built-in modules to show their segment in brackets instead of using the default Starship wording ("via", "on", etc.).

This is a pseudo minimalist preset inspired by the [geometry](https://github.com/geometry-zsh/geometry) and [spaceship](https://github.com/spaceship-prompt/spaceship-prompt) prompts.
> Jetpack uses the terminal's color theme.

### Prerequisite
- Requires a shell with [`right-prompt`](https://starship.rs/advanced-config/#enable-right-prompt) support.
- [Jetbrains Mono](https://www.jetbrains.com/lp/mono/) is recommended.
If toolset files are identified the toolset icon is displayed. If the toolset is not found to determine its version number, it is not displayed. This preset changes the behavior to display the icon only if the toolset information can be determined.

This preset is inspired by [M365Princess](https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/themes/M365Princess.omp.json). It also shows how path substitution works in starship.

### পূর্বশর্ত
- A [Nerd Font](https://www.nerdfonts.com/) installed and enabled in your terminal (the example uses Caskaydia Cove Nerd Font)
It is possible to replace the previous-printed prompt with a custom string. This is useful in cases where all the prompt information is not always needed. To enable this, run `Enable-TransientPrompt` in the shell session. To make it permanent, put this statement in your `$PROFILE`. Transience can be disabled on-the-fly with `Disable-TransientPrompt`.
By default, the left side of input gets replaced with `>`. To customize this, define a new function called `Invoke-Starship-TransientFunction`. For example, to display Starship's `character` module here, you would do
```powershell
function Invoke-Starship-TransientFunction {
&starship module character
}
Invoke-Expression (&starship init powershell)
Enable-TransientPrompt
```
## TransientPrompt and TransientRightPrompt in Cmd
Clink allows you to replace the previous-printed prompt with custom strings. This is useful in cases where all the prompt information is not always needed. To enable this, run `clink set prompt.transient <value>` where \<value\> can be one of:
- `always`: always replace the previous prompt
- `same_dir`: replace the previous prompt only if the working directory is same
- `off`: do not replace the prompt (i.e. turn off transience)
You need to do this only once. Make the following changes to your `starship.lua` to customize what gets displayed on the left and on the right:
- By default, the left side of input gets replaced with `>`. To customize this, define a new function called `starship_transient_prompt_func`. This function receives the current prompt as a string that you can utilize. For example, to display Starship's `character` module here, you would do
```lua
function starship_transient_prompt_func(prompt)
return io.popen("starship module character"
.." --keymap="..rl.getvariable('keymap')
):read("*a")
end
load(io.popen('starship init cmd'):read("*a"))()
```
- By default, the right side of input is empty. To customize this, define a new function called `starship_transient_rprompt_func`. This function receives the current prompt as a string that you can utilize. For example, to display the time at which the last command was started here, you would do
## TransientPrompt and TransientRightPrompt in Fish
It is possible to replace the previous-printed prompt with a custom string. This is useful in cases where all the prompt information is not always needed. To enable this, run `enable_transience` in the shell session. To make it permanent, put this statement in your `~/.config/fish/config.fish`. Transience can be disabled on-the-fly with `disable_transience`.
Note that in case of Fish, the transient prompt is only printed if the commandline is non-empty, and syntactically correct.
- By default, the left side of input gets replaced with a bold-green `❯`. To customize this, define a new function called `starship_transient_prompt_func`. For example, to display Starship's `character` module here, you would do
```fish
function starship_transient_prompt_func
starship module character
end
starship init fish | source
enable_transience
```
- By default, the right side of input is empty. To customize this, define a new function called `starship_transient_rprompt_func`. For example, to display the time at which the last command was started here, you would do
```fish
function starship_transient_rprompt_func
starship module time
end
starship init fish | source
enable_transience
```
## TransientPrompt and TransientRightPrompt in Bash
The [Ble.sh](https://github.com/akinomyoga/ble.sh) framework at v0.4 or higher allows you to replace the previous-printed prompt with custom strings. This is useful in cases where all the prompt information is not always needed. To enable this, put this in `~/.bashrc``bleopt prompt_ps1_transient=<value>`:
The \<value\> here is a colon-separated list of `always`, `same-dir` and `trim`. When `prompt_ps1_final` is empty and this option has a non-empty value, the prompt specified by `PS1` is erased on leaving the current command line. If the value contains a field `trim`, only the last line of multiline `PS1` is preserved and the other lines are erased. Otherwise, the command line will be redrawn as if `PS1=` is specified. When a field `same-dir` is contained in the value and the current working directory is different from the final directory of the previous command line, this option `prompt_ps1_transient` is ignored.
Make the following changes to your `~/.bashrc` to customize what gets displayed on the left and on the right:
- To customize what the left side of input gets replaced with, configure the `prompt_ps1_final` Ble.sh option. For example, to display Starship's `character` module here, you would do
- To customize what the right side of input gets replaced with, configure the `prompt_rps1_final` Ble.sh option. For example, to display the time at which the last command was started here, you would do
## Custom pre-prompt and pre-execution Commands in Cmd
Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements:
@ -121,7 +213,7 @@ You can also set a similar output with PowerShell by creating a function named `
Some shells support a right prompt which renders on the same line as the input. Starship can set the content of the right prompt using the `right_format` option. Any module that can be used in `format` is also supported in `right_format`. The `$all` variable will only contain modules not explicitly used in either `format` or `right_format`.
Note: The right prompt is a single line following the input location. To right align modules above the input line in a multi-line prompt, see the [`fill` module](/config/#fill).
Note: The right prompt is a single line following the input location. To right align modules above the input line in a multi-line prompt, see the [`fill` module](../config/#fill).
`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd.
`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd, nushell, bash.
Note: The [Ble.sh](https://github.com/akinomyoga/ble.sh) framework v0.4 or higher should be installed in order to use right prompt in bash.
### نموونە
@ -157,7 +251,7 @@ Produces a prompt like the following:
Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote).
Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`.
Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `'[∙](bright-black) '`.
Note: `continuation_prompt` should be set to a literal string without any variables.
@ -173,7 +267,7 @@ Note: Continuation prompts are only available in the following shells:
# ~/.config/starship.toml
# A continuation prompt that displays two filled in arrows
continuation_prompt = "▶▶"
continuation_prompt = '▶▶ '
```
## Style Strings
@ -185,6 +279,9 @@ Style strings are a list of words, separated by whitespace. The words are not ca
- `بنهێڵ`
- `کاڵ کراو`
- `پێچەوانە کراو`
- `blink`
- `hidden`
- `strikethrough`
- `bg:<color>`
- `fg:<color>`
- `<color>`
@ -201,3 +298,9 @@ A color specifier can be one of the following:
- A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png).
If multiple colors are specified for foreground/background, the last one in the string will take priority.
Not every style string will be displayed correctly by every terminal. In particular, the following known quirks exist:
- Many terminals disable support for `blink` by default
- `hidden` is [not supported on iTerm](https://gitlab.com/gnachman/iterm2/-/issues/4564).
- `strikethrough` is not supported by the default macOS Terminal.app
## Why do I see `Executing command "..." timed out.` warnings?
Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout`key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings.
Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout`key](../config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings.
## I see symbols I don't understand or expect, what do they mean?
@ -72,7 +72,7 @@ You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs ca
env STARSHIP_LOG=trace starship module rust
```
If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame.
If starship is being slow you can try using the `timings` command to see if there is a particular module or command that is to blame.
This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output.
Finally if you find a bug you can use the `bug-report` command to create a Github issue.
Finally if you find a bug you can use the `bug-report` command to create a GitHub issue.
```sh
starship bug-report
@ -120,3 +120,11 @@ If Starship was installed using the install script, the following command will d
# Locate and delete the starship binary
sh -c 'rm "$(command -v 'starship')"'
```
## How do I install Starship without `sudo`?
The shell install script (`https://starship.rs/install.sh`) only attempts to use `sudo` if the target installation directory is not writable by the current user. The default installation diretory is the value of the `$BIN_DIR` environment variable or `/usr/local/bin` if `$BIN_DIR` is not set. If you instead set the installation directory to one that is writable by your user, you should be able to install starship without `sudo`. For example, `curl -sS https://starship.rs/install.sh | sh -s -- -b ~/.local/bin` uses the `-b` command line option of the install script to set the installation directory to `~/.local/bin`.
For a non-interactive installation of Starship, don't forget to add the `-y` option to skip the confirmation. Check the source of the installation script for a list of all supported installation options.
When using a package manager, see the documentation for your package manager about installing with or without `sudo`.
- A [Nerd Font](https://www.nerdfonts.com/) installed and enabled in your terminal (for example, try the [FiraCode Nerd Font](https://www.nerdfonts.com/font-downloads)).
### Step 1. Install Starship
@ -211,15 +222,13 @@ Alternatively, install Starship using any of the following package managers:
@ -5,7 +5,7 @@ To install starship, you need to do two things:
1. Get the **starship** binary onto your computer
1. Tell your shell to use the starship binary as its prompt by modifying its init scripts
For most users, the instructions on [the main page](/guide/#🚀-installation) will work great. However, for some more specialized platforms, different instructions are needed.
For most users, the instructions on [the main page](../guide/#🚀-installation) will work great. However, for some more specialized platforms, different instructions are needed.
There are so many platforms out there that they didn't fit into the main README.md file, so here are some installation instructions for other platforms from the community. Is yours not here? Please do add it here if you figure it out!
@ -15,7 +15,7 @@ There are so many platforms out there that they didn't fit into the main README.
Head over to the [Chocolatey installation page](https://chocolatey.org/install) and follow the instructions to install Chocolatey.
### Installation
### دامەزراندن
```powershell
choco install starship
@ -29,7 +29,7 @@ choco install starship
pkg install getconf
```
### Installation
### دامەزراندن
```sh
curl -sS https://starship.rs/install.sh | sh -s -- --bin-dir /data/data/com.termux/files/usr/bin
This preset changes the format of all the built-in modules to show their segment in brackets instead of using the default Starship wording ("via", "on", etc.).
@ -28,6 +40,12 @@ This preset changes the symbols for each module into plain text. Great if you do
[](./no-runtimes)
## [No Empty Icons](./no-empty-icons.md)
This preset does not show icons if the toolset is not found.
[](./no-empty-icons.md)
## [Pure Prompt](./pure-preset.md)
ئەم پێش ڕێکخستنە لاسایی شێواز و ڕەفتاری [Pure](https://github.com/sindresorhus/pure) دەکاتەوە.
@ -39,3 +57,21 @@ This preset changes the symbols for each module into plain text. Great if you do
This preset is inspired by [M365Princess](https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/themes/M365Princess.omp.json). It also shows how path substitution works in starship.
[](./pastel-powerline)
## [Tokyo Night](./tokyo-night.md)
This preset is inspired by [tokyo-night-vscode-theme](https://github.com/enkia/tokyo-night-vscode-theme).
[](./tokyo-night)
## [Gruvbox Rainbow](./gruvbox-rainbow.md)
This preset is heavily inspired by [Pastel Powerline](./pastel-powerline.md), and [Tokyo Night](./tokyo-night.md).
[](./gruvbox-rainbow)
## [Jetpack](./jetpack.md)
This is a pseudo minimalist preset inspired by the [geometry](https://github.com/geometry-zsh/geometry) and [spaceship](https://github.com/spaceship-prompt/spaceship-prompt) prompts.
[](./jetpack)
This is a pseudo minimalist preset inspired by the [geometry](https://github.com/geometry-zsh/geometry) and [spaceship](https://github.com/spaceship-prompt/spaceship-prompt) prompts.
> Jetpack uses the terminal's color theme.

### Prerequisite
- Requires a shell with [`right-prompt`](https://starship.rs/advanced-config/#enable-right-prompt) support.
- [Jetbrains Mono](https://www.jetbrains.com/lp/mono/) is recommended.
If toolset files are identified the toolset icon is displayed. If the toolset is not found to determine its version number, it is not displayed. This preset changes the behavior to display the icon only if the toolset information can be determined.

tagline: Minimale, super schnelle und unendlich anpassbare Prompt für jede Shell!
actionText: Loslegen →
actionLink: ./guide/
layout: home
hero:
image: /logo.svg
text:
tagline: Der minimalistische, super schnelle und unendlich anpassbare Prompt für jede Shell!
actions:
-
theme: brand
text: Loslegen →
link: ./de-DE/guide/
features:
-
title: Kompatibel
details: Läuft mit den beliebtesten Shells auf den beliebtesten Betriebssystemen. Überall einsetzbar!
-
title: Rust-Powered
details: Bringt die Schnelligkeit und Zuverlässigkeit von Rust in deine Shell-Prompt.
details: Bringt die Schnelligkeit und Sicherheit von Rust in deine Shell-Prompt.
-
title: Individualisierbar
details: Jedes noch so kleine Detail kann nach Deinen Wünschen angepasst werden, um die Eingabeaufforderung so minimal oder funktionsreich zu gestalten, wie Du es möchtest.
description: Starship ist eine minimale, super schnelle, und extrem anpassbare Prompt für jede Shell! Sie zeigt die Information, die man benötigt an, während sie schnell und minimal bleibt. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, and PowerShell.
description: Starship ist eine minimale, super schnelle, und extrem anpassbare Prompt für jede Shell! Sie zeigt die Information, die man benötigt an, während sie schnell und minimal bleibt. Schnell-Installation verfügbar für Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, und PowerShell.
- Eine [Nerd Font](https://www.nerdfonts.com/) installiert und aktiviert in Ihrem Terminal.
- Eine [Nerd Font](https://www.nerdfonts.com/) installiert und aktiviert in deinem Terminal.
### Schnellinstallation
@ -45,7 +47,7 @@ description: Starship ist eine minimale, super schnelle, und extrem anpassbare P
curl -sS https://starship.rs/install.sh | sh
```
Um Starship selbst zu aktualisieren, lasse das Skript oben nochmal laufen. Es wird die vorhandene Version ersetzen, ohne die Konfiguration von Starship zu berühren.
Führe das Skript oben erneut aus, um Starship selbst zu aktualisieren. Die vorhandene Version wird ersetzt, ohne dass deine Starship-Konfiguration verloren geht.
#### Installation mithilfe eines Paket-Managers
@ -56,13 +58,13 @@ description: Starship ist eine minimale, super schnelle, und extrem anpassbare P
brew install starship
```
Mit [scoop](https://scoop.sh):
Mit [Winget](https://github.com/microsoft/winget-cli):
```powershell
scoop install starship
winget install starship
```
1. Führe den init Befehl zum Start der Shell aus:
1. Füge das init-Skript zur Konfigurationsdatei deiner Shell hinzu:
#### Bash
@ -89,7 +91,7 @@ description: Starship ist eine minimale, super schnelle, und extrem anpassbare P
#### Zsh
Füge dies ans Ende von `~/.zshrc`:
Trage folgendes am Ende der `~/.zshrc` ein:
```sh
# ~/.zshrc
@ -100,7 +102,7 @@ description: Starship ist eine minimale, super schnelle, und extrem anpassbare P
#### Powershell
Füge das folgende zum Ende von `Microsoft.PowerShell_profile.ps1` hinzu. Sie können den Speicherort dieser Datei überprüfen, indem Sie die `$PROFILE` Variable in PowerShell abfragen. Normalerweise ist der Pfad `~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1` oder `~/.config/powershell/Microsoft.PowerShell_profile.ps1` auf -Nix.
Füge das Folgende ans Ende von `Microsoft.PowerShell_profile.ps1` an. Du kannst den Speicherort dieser Datei überprüfen, indem du die `$PROFILE` Variable in PowerShell abfragst. Normalerweise ist der Pfad `~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1` oder `~/.config/powershell/Microsoft.PowerShell_profile.ps1` auf -Nix.
```sh
Invoke-Expression (&starship init powershell)
@ -122,7 +124,7 @@ description: Starship ist eine minimale, super schnelle, und extrem anpassbare P
::: warning
Only elvish v0.18 or higher is supported.
Es wird nur elvish v0.18 oder höher unterstützt.
:::
@ -150,22 +152,24 @@ description: Starship ist eine minimale, super schnelle, und extrem anpassbare P
::: warning
This will change in the future. Only Nushell v0.61+ is supported.
Das wird sich in Zukunft ändern. Nur Nushell v0.78+ wird unterstützt.
:::
Add the following to to the end of your Nushell env file (find it by running `$nu.env-path` in Nushell):
Füge folgendes zum Ende deiner Nushell env Datei hinzu (finde sie, indem du `$nu.env-path` in Nushell ausführst):
```sh
mkdir ~/.cache/starship
starship init nu | save ~/.cache/starship/init.nu
starship init nu | save -f ~/.cache/starship/init.nu
```
And add the following to the end of your Nushell configuration (find it by running`$nu.config-path`):
Und füge folgendes am Ende deiner Nushell-Konfiguration hinzu (du findest diese, indem du folgenden Befehl in Nushell ausführst`$nu.config-path`):
```sh
source ~/.cache/starship/init.nu
use ~/.cache/starship/init.nu
```
#### Xonsh
Füge folgendes an das Ende von `~/.xonshrc` hinzu:
@ -179,7 +183,7 @@ description: Starship ist eine minimale, super schnelle, und extrem anpassbare P
#### ⌘ Cmd
You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory:
Du musst [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) mit Cmd verwenden. Trage folgendes in eine neue Datei namens `starship.lua` hinzu und lege diese Datei im Clink Scripts Verzeichnis ab:
Auch wenn Starship eine vielseitige Shell ist, reichen manche Konfigurationen in der `starship.toml` nicht aus, um erweiterte Einstellungen vorzunehmen. Diese Seite beschreibt einige fortgeschrittene Konfigurationen für Starship.
Auch wenn Starship eine vielseitige Shell ist, reichen manche Konfigurationen in der `starship.toml` nicht aus, um manche Sachen zu erreichen. Diese Seite beschreibt einige fortgeschrittene Konfigurationen für Starship.
::: warning
@ -8,6 +8,98 @@ Die hier beschriebenen Konfigurationen werden sich mit kommenden Updates von Sta
:::
## TransientPrompt in PowerShell
Es ist möglich, die zuvor geprintete Prompt mit einem benutzerdefinierten String zu ersetzen. Das ist in Fällen nützlich, in denen nicht immer die ganze Information der Prompt gebraucht wird. Führe `Enable-TransientPrompt` in deiner Shell-Session aus, um dieses Verhalten zu aktivieren. Füge das Statement in dein `$PROFILE` ein, um diese Funktion dauerhaft zu aktivieren. Transience can be disabled on-the-fly with `Disable-TransientPrompt`.
By default, the left side of input gets replaced with `>`. To customize this, define a new function called `Invoke-Starship-TransientFunction`. For example, to display Starship's `character` module here, you would do
```powershell
function Invoke-Starship-TransientFunction {
&starship module character
}
Invoke-Expression (&starship init powershell)
Enable-TransientPrompt
```
## TransientPrompt and TransientRightPrompt in Cmd
Clink allows you to replace the previous-printed prompt with custom strings. Das ist in Fällen nützlich, in denen nicht immer die ganze Information der Prompt gebraucht wird. To enable this, run `clink set prompt.transient <value>` where \<value\> can be one of:
- `always`: always replace the previous prompt
- `same_dir`: replace the previous prompt only if the working directory is same
- `off`: do not replace the prompt (i.e. turn off transience)
You need to do this only once. Make the following changes to your `starship.lua` to customize what gets displayed on the left and on the right:
- By default, the left side of input gets replaced with `>`. To customize this, define a new function called `starship_transient_prompt_func`. This function receives the current prompt as a string that you can utilize. For example, to display Starship's `character` module here, you would do
```lua
function starship_transient_prompt_func(prompt)
return io.popen("starship module character"
.." --keymap="..rl.getvariable('keymap')
):read("*a")
end
load(io.popen('starship init cmd'):read("*a"))()
```
- By default, the right side of input is empty. To customize this, define a new function called `starship_transient_rprompt_func`. This function receives the current prompt as a string that you can utilize. For example, to display the time at which the last command was started here, you would do
## TransientPrompt and TransientRightPrompt in Fish
Es ist möglich, die zuvor geprintete Prompt mit einem benutzerdefinierten String zu ersetzen. Das ist in Fällen nützlich, in denen nicht immer die ganze Information der Prompt gebraucht wird. To enable this, run `enable_transience` in the shell session. To make it permanent, put this statement in your `~/.config/fish/config.fish`. Transience can be disabled on-the-fly with `disable_transience`.
Note that in case of Fish, the transient prompt is only printed if the commandline is non-empty, and syntactically correct.
- By default, the left side of input gets replaced with a bold-green `❯`. To customize this, define a new function called `starship_transient_prompt_func`. For example, to display Starship's `character` module here, you would do
```fish
function starship_transient_prompt_func
starship module character
end
starship init fish | source
enable_transience
```
- By default, the right side of input is empty. To customize this, define a new function called `starship_transient_rprompt_func`. For example, to display the time at which the last command was started here, you would do
```fish
function starship_transient_rprompt_func
starship module time
end
starship init fish | source
enable_transience
```
## TransientPrompt and TransientRightPrompt in Bash
The [Ble.sh](https://github.com/akinomyoga/ble.sh) framework at v0.4 or higher allows you to replace the previous-printed prompt with custom strings. This is useful in cases where all the prompt information is not always needed. To enable this, put this in `~/.bashrc``bleopt prompt_ps1_transient=<value>`:
The \<value\> here is a colon-separated list of `always`, `same-dir` and `trim`. When `prompt_ps1_final` is empty and this option has a non-empty value, the prompt specified by `PS1` is erased on leaving the current command line. If the value contains a field `trim`, only the last line of multiline `PS1` is preserved and the other lines are erased. Otherwise, the command line will be redrawn as if `PS1=` is specified. When a field `same-dir` is contained in the value and the current working directory is different from the final directory of the previous command line, this option `prompt_ps1_transient` is ignored.
Make the following changes to your `~/.bashrc` to customize what gets displayed on the left and on the right:
- To customize what the left side of input gets replaced with, configure the `prompt_ps1_final` Ble.sh option. For example, to display Starship's `character` module here, you would do
- To customize what the right side of input gets replaced with, configure the `prompt_rps1_final` Ble.sh option. For example, to display the time at which the last command was started here, you would do
## Custom pre-prompt and pre-execution Commands in Cmd
Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements:
@ -57,7 +149,7 @@ eval $(starship init bash)
set +o functrace
```
## Custom pre-prompt and pre-execution Commands in PowerShell
## Benutzerdefinierte Pre-Prompt- und Pre-Execution-Befehle in PowerShell
PowerShell does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `powershell`. Starship bietet daher die begrenzte Möglichkeit, eigene Funktionen in das prompt rendering Verfahren einzufügen:
@ -121,7 +213,7 @@ You can also set a similar output with PowerShell by creating a function named `
Some shells support a right prompt which renders on the same line as the input. Starship can set the content of the right prompt using the `right_format` option. Any module that can be used in `format` is also supported in `right_format`. The `$all` variable will only contain modules not explicitly used in either `format` or `right_format`.
Note: The right prompt is a single line following the input location. To right align modules above the input line in a multi-line prompt, see the [`fill` module](/config/#fill).
Note: The right prompt is a single line following the input location. To right align modules above the input line in a multi-line prompt, see the [`fill` module](../config/#fill).
`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd.
`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd, nushell, bash.
Note: The [Ble.sh](https://github.com/akinomyoga/ble.sh) framework v0.4 or higher should be installed in order to use right prompt in bash.
### Beispiel
@ -157,7 +251,7 @@ Produces a prompt like the following:
Einige Shells unterstützen einen speziellen Fortsetzungsprompt zusätzlich zum normalen Prompt. Dieser Prompt wird anstelle des normalen Prompts ausgegeben, wenn der Benutzer ein unvollständiges Kommando eingegeben hat (etwa wie eine einzelne linke Klammer oder ein einzelnes Anführungszeichen).
Starship kann das Aussehen des Fortsetzungs-Prompts mit der `continuation_prompt` Option einstellen. The default prompt is `"[∙](bright-black) "`.
Starship kann das Aussehen des Fortsetzungs-Prompts mit der `continuation_prompt` Option einstellen. The default prompt is `'[∙](bright-black) '`.
Hinweis: Die `continuation_prompt` Anweisung sollte auf einen literalen String ohne Variablen gesetzt werden.
@ -173,22 +267,25 @@ Hinweis: Fortsetzungs-Prompts sind nur für folgende Shells verfügbar:
# ~/.config/starship.toml
# Ein Fortsetzungs-Prompt der 2 ausgefüllte Pfeile darstellt
continuation_prompt = "▶▶"
continuation_prompt = '▶▶ '
```
## Style-Strings
Style-String sind Wortlisten, getrennt durch Leerzeichen. Die Wörter haben keine Groß- und Kleinschreibung (z.B. `bold` und `BoLd` werden als dieselbe Zeichenkette betrachtet). Jedes Wort kann eines der folgenden sein:
Stil-Zeichenketten sind eine Liste von Wörtern, getrennt durch Leerzeichen. Die Wörter haben keine Groß- und Kleinschreibung (z.B. `bold` und `BoLd` werden als dieselbe Zeichenkette betrachtet). Jedes Wort kann eines der folgenden sein:
- `bold`
- `italic`
- `underline`
- `dimmed`
- `fett`
- `kursiv`
- `unterstrichen`
- `gedimmt`
- `invertiert`
- `blink`
- `hidden`
- `strikethrough`
- `bg:<color>`
- `fg:<color>`
- `<color>`
- `none`
- `keins`
wobei `<color>` eine Farbspezifikation ist (siehe unten). `fg:<color>` und `<color>` tun derzeit dasselbe, das kann sich in Zukunft aber ändern. `inverted` tauscht Hinter- und Vordergrundfarben. Die Reihenfolge der Wörter in der Liste spielt keine Rolle.
@ -201,3 +298,9 @@ Eine Farbspezifikation kann wie folgt aussehen:
- Eine Zahl zwischen 0-255. Dies ergibt einen [8-bit ANSI-Farbcode](https://i.stack.imgur.com/KTSQa.png).
Wenn mehrere Farben für Vordergrund oder Hintergrund angegeben werden, hat die letzte Farbe der Zeichenkette Priorität.
Not every style string will be displayed correctly by every terminal. In particular, the following known quirks exist:
- Many terminals disable support for `blink` by default
- `hidden` is [not supported on iTerm](https://gitlab.com/gnachman/iterm2/-/issues/4564).
- `strikethrough` is not supported by the default macOS Terminal.app
## Why do I see `Executing command "..." timed out.` warnings?
Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout`key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings.
Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout`key](../config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings.
## I see symbols I don't understand or expect, what do they mean?
@ -72,7 +72,7 @@ You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs ca
env STARSHIP_LOG=trace starship module rust
```
If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame.
If starship is being slow you can try using the `timings` command to see if there is a particular module or command that is to blame.
This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output.
Finally if you find a bug you can use the `bug-report` command to create a Github issue.
Finally if you find a bug you can use the `bug-report` command to create a GitHub issue.
```sh
starship bug-report
@ -120,3 +120,11 @@ Wenn Starship mit Hilfe des Installationsscripts installiert wurde, entfernt der
# Locate and delete the starship binary
sh -c 'rm "$(command -v 'starship')"'
```
## How do I install Starship without `sudo`?
The shell install script (`https://starship.rs/install.sh`) only attempts to use `sudo` if the target installation directory is not writable by the current user. The default installation diretory is the value of the `$BIN_DIR` environment variable or `/usr/local/bin` if `$BIN_DIR` is not set. If you instead set the installation directory to one that is writable by your user, you should be able to install starship without `sudo`. For example, `curl -sS https://starship.rs/install.sh | sh -s -- -b ~/.local/bin` uses the `-b` command line option of the install script to set the installation directory to `~/.local/bin`.
For a non-interactive installation of Starship, don't forget to add the `-y` option to skip the confirmation. Check the source of the installation script for a list of all supported installation options.
When using a package manager, see the documentation for your package manager about installing with or without `sudo`.
**Minimale, super schnelle und unendlich anpassbare Prompt für jede Shell!**
**Der minimalistische, super schnelle und unendlich anpassbare Prompt für jede Shell!**
- **Schnell:** sie ist schnell –_sehr, sehr_ schnell! 🚀
- **Konfigurierbar:** konfiguriere jedes Detail der Prompt.
@ -169,7 +180,7 @@
### Voraussetzungen
- Eine [Nerd Schriftart](https://www.nerdfonts.com/) installiert und im Terminal aktiviert (zum Beispiel [Fira Code Nerd Font](https://www.nerdfonts.com/font-downloads)).
- Eine [Nerd Font](https://www.nerdfonts.com/), installiert und in deinem Terminal aktiviert (versuche es zum Beispiel mal mit der [FiraCode Nerd Font](https://www.nerdfonts.com/font-downloads)).
### Schritt 1. Installiere Starship
@ -215,15 +226,13 @@ Alternatively, install Starship using any of the following package managers:
### Schritt 2. Richte deine Shell für die Nutzung von Starship ein
Konfigurieren deine Shell um Starship zu initialisieren. Wähle dafür deine Shell aus der Liste aus:
Konfiguriere deine Shell, um Starship automatisch zu starten. Wähle dafür deine Shell aus der Liste aus:
<details>
<summary>Bash</summary>
@ -280,7 +292,7 @@ eval "$(starship init bash)"
<details>
<summary>⌘ Cmd</summary>
You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Create a file at this path `%LocalAppData%\clink\starship.lua` with the following contents:
Du musst [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) mit Cmd verwenden. Erstelle eine Datei in diesem Pfad `%LocalAppData%\clink\starship.lua` mit dem folgenden Inhalt:
```lua
load(io.popen('starship init cmd'):read("*a"))()
@ -326,27 +338,27 @@ eval $(starship init ion)
<details>
<summary>Nushell</summary>
Add the following to the end of your Nushell env file (find it by running `$nu.env-path` in Nushell):
Füge folgendes zum Ende deiner Nushell env Datei hinzu (finde sie, indem du `$nu.env-path` in Nushell ausführst):
```sh
mkdir ~/.cache/starship
starship init nu | save ~/.cache/starship/init.nu
starship init nu | save -f ~/.cache/starship/init.nu
```
And add the following to the end of your Nushell configuration (find it by running`$nu.config-path`):
Und füge Folgendes am Ende deiner Nushell-Konfiguration hinzu (finde sie, indem du folgenden Befehl in Nushell ausführst`$nu.config-path`):
```sh
source ~/.cache/starship/init.nu
use ~/.cache/starship/init.nu
```
Note: Only Nushell v0.61+ is supported
Beachte: Nushell wird erst ab v0.78+ unterstützt
</details>
<details>
<summary>PowerShell</summary>
Add the following to the end of your PowerShell configuration (find it by running`$PROFILE`):
Füge Folgendes am Ende deiner PowerShell-Konfiguration hinzu (finde sie, indem du folgenden Befehl ausführst`$PROFILE`):
@ -399,27 +411,31 @@ Falls du Starship weiter anpassen möchtest:
## 🤝 Mitwirken
Wir laden Leute **aller Erfahrungsstufen** herzlich ein mitzumachen! Falls du dich mit dem Projekt vertaut machen willst, versuche ein [good first issue](https://github.com/starship/starship/labels/🌱%20good%20first%20issue).
Wir sind immer auf der Suche nach Helfern **jeder Erfahrungsstufe**! Probleme mit dem Label [„Good first issues“](https://github.com/starship/starship/labels/🌱%20good%20first%20issue) sind der beste Weg, um dich mit dem Projekt vertraut zu machen.
Wenn du eine andere Sprache flüssig sprichts, würden wir uns sehr freuen wenn du helfen würdest die Dokumentation in anderen Sprachen auf dem aktuellsten Stand zu halten. Hier kannst du bei der Übersetzung helfen [Starship Crowdin](https://translate.starship.rs/).
Falls du an Starship mitwirken willst, wirf bitte einen Blick auf den [Contributing Guide](https://github.com/starship/starship/blob/master/CONTRIBUTING.md). Schau auch gerne auf unserem [Discord server](https://discord.gg/8Jzqu3T) vorbei. 👋
Falls du an Starship mitwirken willst, wirf bitte einen Blick auf den [Leitfaden zum Mitwirken](https://github.com/starship/starship/blob/master/CONTRIBUTING.md). Schau auch gerne auf unserem [Discord-Server](https://discord.gg/8Jzqu3T) vorbei. 👋
## 💭 Inspiriert durch
Checkt bitte diese älteren Projekte, die das Entstehen von Starhip inspiriert haben. 🙏
Schaut euch bitte auch die Projekte an, die die Entstehung von Starship inspiriert haben. 🙏
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** –A ZSH prompt for astronauts.
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** –Eine ZSH Prompt für Astronauten.
- **[denysdovhan/robbyrussell-node](https://github.com/denysdovhan/robbyrussell-node)** – Cross-shell robbyrussell theme written in JavaScript.
- **[denysdovhan/robbyrussell-node](https://github.com/denysdovhan/robbyrussell-node)** – Cross-Shell robbyrussell Thema geschrieben in JavaScript.
- **[reujab/silver](https://github.com/reujab/silver)** – A cross-shell customizable powerline-like prompt with icons.
- **[reujab/silber](https://github.com/reujab/silver)** – Eine cross-shell anpassbare Powerline-Prompt mit Icons.
## ❤️ Sponsoren
Unterstütze dieses Projekt, indem du [ein Sponsor wirst](https://github.com/sponsors/starship). Dein Name und Logo wird hier mit einem Link zu deiner Website erscheinen.
Um Starship zu installieren, musst du zwei Dinge tun:
1. Holen Sie sich das **starship** Binary auf Ihren Computer
1. Sagen Sie ihrer Shell, dass sie das Starship-Binary als Prompt benutzt, indem sie die Initialisierungs-Skripte ändern
1. Lade die **starship** Datei auf den Computer herunter
1. Weise deine Shell an die Starship Datei als Eingabeaufforderung zu nutzen, indem du eines der Initialisierungs-Skripte benutzt
Die Anweisungen auf [der Hauptseite](/guide/#🚀-installation) werden für die meisten Benutzer gut funktionieren. Für einige speziellere Plattformen werden jedoch andere Anweisungen benötigt.
For most users, the instructions on [the main page](../guide/#🚀-installation) will work great. Für einige speziellere Plattformen wird jedoch eine speziellere Anleitung benötigt.
Es gibt so viele Plattformen, dass sie nicht in das Haupt-README passen, also hier einige Installationsanweisungen für andere Plattformen von der Community. Ist Ihre nicht hier? Bitte fügen Sie es hier hinzu, wenn Sie es herausfinden!
Es gibt sehr viele Plattformen, sodass diese nicht alle in die Hauptanleitung passen, aus diesem Grund sind hier ein paar Installationsanweisungen für ein paar Plattformen von der Community. Ist deine Platform nicht dabei? Dann füge bitte deine hinzu, sobald du herausgefunden hast wie man starship mit dieser benutzt!
## [Chocolatey](https://chocolatey.org)
### Voraussetzungen
Gehen Sie zur [Chocolatey's Installations-Seite](https://chocolatey.org/install) und folge den Anweisungen um Chocolatey zu installieren.
Gehe zur [Chocolatey's Installations-Seite](https://chocolatey.org/install) und folge den Anweisungen um Chocolatey zu installieren.
On Funtoo Linux, starship can be installed from [core-kit](https://github.com/funtoo/core-kit/tree/1.4-release/app-shells/starship) via Portage:
Unter Funtoo Linux kann starship von [core-kit](https://github.com/funtoo/core-kit/tree/1.4-release/app-shells/starship) über Portage installiert werden:
```sh
emerge app-shells/starship
@ -57,13 +57,13 @@ nix-env -iA nixos.starship
#### Deklarativ, Einzel-Benutzer, über [home-manager](https://github.com/nix-community/home-manager)
Aktivieren Sie das Modul `programs.starship` in Ihrer `home.nix`-Datei und fügen Sie Ihre Einstellungen hinzu
Aktiviere das Modul `programs.starship` in deiner `home.nix`-Datei und füge deine Einstellungen hinzu
```nix
{
programs.starship = {
enable = true;
# Configuration written to ~/.config/starship.toml
# Konfiguration die nach ~/.config/starship.toml geschrieben wird
settings = {
# add_newline = false;
@ -78,7 +78,7 @@ Aktivieren Sie das Modul `programs.starship` in Ihrer `home.nix`-Datei und füge
}
```
und führen Sie dann folgendes aus
führe danach folgendes aus
```sh
home-manager switch
@ -86,7 +86,7 @@ home-manager switch
#### Deklarativ, systemweit, mit NixOS
Fügen Sie `pkgs.starship` zu `environment.systemPackages` in Ihrer `configuration.nix` hinzu, und führen Sie folgendes aus
Füge`pkgs.starship` zu der Sektion `environment.systemPackages` in deiner `configuration.nix` hinzu, und führe folgenden Befehl aus
@ -10,6 +10,18 @@ This preset changes the symbols for each module to use Nerd Font symbols.
[](./nerd-font)
## [No Nerd Fonts](./no-nerd-font.md)
This preset changes the symbols for several modules so that no Nerd Font symbols are used anywhere in the prompt.
::: tip
This preset will become the default preset [in a future release of starship](https://github.com/starship/starship/pull/3544).
:::
[Click to view No Nerd Font preset](./no-nerd-font)
## [Bracketed Segments](./bracketed-segments.md)
This preset changes the format of all the built-in modules to show their segment in brackets instead of using the default Starship wording ("via", "on", etc.).
@ -28,14 +40,38 @@ This preset hides the version of language runtimes. If you work in containers or
[](./no-runtimes)
## [No Empty Icons](./no-empty-icons.md)
This preset does not show icons if the toolset is not found.
[](./no-empty-icons.md)
## [Pure Prompt](./pure-preset.md)
This preset emulates the look and behavior of [Pure](https://github.com/sindresorhus/pure).
Diese Voreinstellung emuliert das Aussehen und das Verhalten von [Pure](https://github.com/sindresorhus/pure).
[](./pure-preset)
[](./pure-preset)
## [Pastel Powerline](./pastel-powerline.md)
This preset is inspired by [M365Princess](https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/themes/M365Princess.omp.json). It also shows how path substitution works in starship.
[](./pastel-powerline)
## [Tokyo Night](./tokyo-night.md)
This preset is inspired by [tokyo-night-vscode-theme](https://github.com/enkia/tokyo-night-vscode-theme).
[](./tokyo-night)
## [Gruvbox Rainbow](./gruvbox-rainbow.md)
Diese Voreinstellung ist stark inspiriert von [Pastel Powerline](./pastel-powerline.md), and [Tokyo Night](./tokyo-night.md).
[](./gruvbox-rainbow)
## [Jetpack](./jetpack.md)
This is a pseudo minimalist preset inspired by the [geometry](https://github.com/geometry-zsh/geometry) and [spaceship](https://github.com/spaceship-prompt/spaceship-prompt) prompts.
[](./jetpack)
Some files were not shown because too many files have changed in this diff
Show More