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

bash right prompt doesn't work #5860

Closed
roland-5 opened this issue Mar 21, 2024 · 3 comments
Closed

bash right prompt doesn't work #5860

roland-5 opened this issue Mar 21, 2024 · 3 comments
Labels
🐛 bug Something isn't working as expected.

Comments

@roland-5
Copy link

Current Behavior

Right prompt work for fish and nushell, but not for bash. In changelog for 1.18 version there is this change bash: Support right prompt and transience and in docs for right prompt there is this line Note: The [Ble.sh](https://github.com/akinomyoga/ble.sh) framework should be installed in order to use right prompt in bash. I installed ble-sh but right prompt for bash doesn't work and ble-sh delete my color for host and user, making them white.

Expected Behavior

Did I misunderstand this or with version 1.18 we can set right prompt for bash with ble-sh like we can with fish or nushell?

Additional context/Screenshots

ps_20240321194536

Possible Solution

Environment

  • Starship version: 1.18.0
  • bash version: GNU bash, version 5.2.26(1)-release (x86_64-pc-linux-gnu)
    Copyright (C) 2022 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: Arch Linux Rolling Release
  • Terminal emulator: alacritty 0.13.1 (fe2a3c56)
  • Git Commit Hash:
  • Branch/Tag: v1.18.0
  • Rust Version: rustc 1.76.0 (07dca489a 2024-02-04) (Arch Linux rust 1:1.76.0-2)
  • Rust channel: release
  • Build Time: 2024-03-21 15:56:12 +00:00

Relevant Shell Configuration

# Add this lines at the top of .bashrc:
[[ $- == *i* ]] && source /usr/share/blesh/ble.sh --noattach

# your bashrc settings come here...
if [[ -r /usr/share/bash-completion/bash_completion ]]; then
  . /usr/share/bash-completion/bash_completion
fi

eval "$(starship init bash)"

# Add this line at the end of .bashrc:
[[ ${BLE_VERSION-} ]] && ble-attach

Starship Configuration

# Configure the format of the prompt from left to right
format = """
$username\
$hostname\
$directory\
$git_branch\
$git_commit\
$git_state\
$git_status\
$package\
$lua\
$rust\
$typst\
$character"""

# move the rest of the prompt to the right side of the screen
right_format = """
$shell\
$localip\
$cmd_duration\
$time"""

# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'

# Add a new line before the start of the prompt
add_newline = false

command_timeout = 600

# A continuation prompt that displays two filled in arrows
continuation_prompt = '▶▶ '

[character]
error_symbol = '[✗](bold red)'

[cmd_duration]
format = '[$duration]($style)/'

[directory]
read_only = ' 🔒'

[git_branch]
format = '[$symbol$branch(:$remote_branch)]($style) '

[hostname]
disabled = false
ssh_only = false
format = '[$hostname]($style) $ssh_symbol'
style = '#808080 bold'

[line_break]
disabled = true

[localip]
ssh_only = true
format = '[{$localipv4}]($style) '
disabled = false

[lua]
format = '[$symbol($version)]($style) '

[package]
format = '[$symbol$version]($style) '

[rust]
format = '[$symbol($version)]($style) '

[shell]
fish_indicator = '󰈺'
bash_indicator = '_'
nu_indicator = '󰆚'
style = 'cyan bold'
disabled = false

[time]
disabled = false
format = '[$time]($style)'
use_12hr = false
time_format = '%H:%M'
utc_time_offset = 'local'
time_range = '-'

[typst]
format = '[$symbol($version )]($style)'

[username]
disabled = false
format = '[$user]($style)[@](bold #4c4c4c)'
style_root = 'red bold'
style_user = '#808080 bold'
show_always = true
@roland-5 roland-5 added the 🐛 bug Something isn't working as expected. label Mar 21, 2024
@davidkna
Copy link
Member

davidkna commented Mar 21, 2024

It should perhaps be documented better, but the ble.sh features require ble.sh v0.4+, which would require blesh-git instead of blesh if you are using the AUR.

@roland-5
Copy link
Author

Git version did the trick. Thank you.

Love Starship. <3

@loganmancuso
Copy link

Had the same problem in my setup, documenting more explicitly here. You will need to reload your session to apply the changes.

git clone --recursive --depth 1 --shallow-submodules https://github.com/akinomyoga/ble.sh.git
make -C ble.sh install PREFIX=~/.local
echo 'source ~/.local/share/blesh/ble.sh' >> ~/.bashrc

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

3 participants