Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional format strings fail for shell $indicator #5885

Open
SPiCaRiA opened this issue Mar 26, 2024 · 0 comments
Open

Conditional format strings fail for shell $indicator #5885

SPiCaRiA opened this issue Mar 26, 2024 · 0 comments
Labels
🐛 bug Something isn't working as expected.

Comments

@SPiCaRiA
Copy link

Bug Report

pkg_version:1.17.1
branch:
commit_hash:
build_time:2024-01-02 18:29:33 +00:00
build_env:rustc 1.75.0 (82e1608df 2023-12-21) (Homebrew),

Generated bug report:

Current Behavior

I'm setting zsh_indicator to empty string because it is my default interactive shell and I only want the shell indicator to show when not in Zsh. Therefore I tried the conditional format string on $indicator:

zsh_indicator = ''
format = '([$indicator]($style) )'

But this basically hides all indicators no matter which shell I'm using.

Screenshot 2024-03-26 at 10 30 23

Expected Behavior

When I switch to Bash, the value of $indicator will be $bash_indicator and thus not none if I'm understanding it correctly. Expect to see:

# In Zsh
❯ bash
bsh ❯ # In Bash

Possible Solution

Environment

  • Starship version: 1.17.1
  • zsh version: zsh 5.9 (x86_64-apple-darwin23.0)
  • Operating system: Mac OS 14.3.1
  • Terminal emulator: kitty 0.33.0 created by Kovid Goyal
  • Git Commit Hash:
  • Branch/Tag:
  • Rust Version: rustc 1.75.0 (82e1608df 2023-12-21) (Homebrew)
  • Rust channel: release
  • Build Time: 2024-01-02 18:29:33 +00:00

Relevant Shell Configuration

<unknown config>

Starship Configuration

format = '$all'

[character]
# Use pure's prompt color
success_symbol = '[❯](bold #f968be)'
vimcmd_symbol = '[❮](bold #f968be)'

[shell]
disabled = false
style = '#f968be'
zsh_indicator = ''
# Remove the space after (e.g. Bash: "bsh ❯" -> "bsh❯", Zsh: " ❯" -> "❯")
format = '([$indicator]($style) )'
@SPiCaRiA SPiCaRiA added the 🐛 bug Something isn't working as expected. label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working as expected.
Projects
None yet
Development

No branches or pull requests

1 participant