starship: Prompt hangs and uses high CPU usage
Current Behavior
When running starship prompt, it hangs and leads to high CPU usage.
Expected Behavior
It should show the prompt and not use high amounts of CPU.
Additional context/Screenshots
Possible Solution
Environment
- Starship version: 1.10.0
- bash version: GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu) Copyright © 2019 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
- Operating system: Ubuntu 20.04
- Terminal emulator: vscode 1.70.1
- Git Commit Hash:
- Branch/Tag: master
- Rust Version: rustc 1.63.0 (4b91a6ea7 2022-08-08)
- Rust channel: release
- Build Time: 2022-08-14 20:13:29 +00:00
Relevant Shell Configuration
eval "$(starship init bash)"
nightly() {
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain nightly
}
Starship Configuration
[time]
disabled = false
format = '[\[ $time \]]($style) '
time_format = "%T"
[nodejs]
disabled = true
[git_status]
disabled = true
[cmd_duration]
min_time = 500
format = "took [$duration](bold yellow)"
[battery]
disabled = true
[git_metrics]
disabled = false
[lua]
disabled = true
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 7
- Comments: 17 (11 by maintainers)
Commits related to this issue
- feat: add `fs-jwalk-single-threaded` feature to specifically decouple `jwalk` from rayon It has been an issue in https://github.com/starship/starship/issues/4251 apparently and rayon interactions can... — committed to Byron/gitoxide by Byron 2 years ago
- feat: add `fs-jwalk-single-threaded` feature to specifically decouple `jwalk` from rayon It has been an issue in https://github.com/starship/starship/issues/4251 apparently and rayon interactions can... — committed to Byron/gitoxide by Byron 2 years ago
- Disable multithreading in `jwalk` (via `gitoxide`) as workaround for #4251 Even though that theoretically makes some filesystem iterations slower, I don't think it matters much for typical repositori... — committed to Byron/starship by Byron 2 years ago
- Disable multithreading in `jwalk` (via `gitoxide`) as workaround for #4251 Even though that theoretically makes some filesystem iterations slower, I don't think it matters much for typical repositori... — committed to Byron/starship by Byron 2 years ago
- Disable multithreading in `jwalk` (via `gitoxide`) as workaround for #4251 Even though that theoretically makes some filesystem iterations slower, I don't think it matters much for typical repositori... — committed to Byron/starship by Byron 2 years ago
- fix: Disable multithreading in `jwalk` (via `gitoxide`) as workaround for #4251 (#4258) Disable multithreading in `jwalk` (via `gitoxide`) as workaround for #4251 — committed to starship/starship by Byron 2 years ago
- reproduce https://github.com/starship/starship/issues/4251 — committed to Byron/reproduce-rayon-hang by Byron 2 years ago
- fix: Disable multithreading in `jwalk` (via `gitoxide`) as workaround for #4251 (#4258) Disable multithreading in `jwalk` (via `gitoxide`) as workaround for #4251 — committed to Indyandie/starship by Byron 2 years ago
@davidkna I managed to reproduce the issue with a minimal example after all and created https://github.com/rayon-rs/rayon/issues/967 in response.
export STARSHIP_NUM_THREADS=6does seem to fix it.It looks like I can trigger it by setting
STARSHIP_NUM_THREADS=1.I can reproduce this with an empty git repo.
Step to reproduce
mkdir foocd foogit initEnvironment
Starship Configuration
A PR for
starshipwas submitted which fixes this issue.I will link the respective
jwalkissue here once I can reproduce it there with a minimal example.