starship / starship

β˜„πŸŒŒοΈ The minimal, blazing-fast, and infinitely customizable prompt for any shell!
https://starship.rs
ISC License
45.33k stars 1.97k forks source link

Powershell prompt will not change after editing starship.toml #6292

Open Lupus47 opened 1 month ago

Lupus47 commented 1 month ago

Current Behavior

The prompt will not update when changes are made to the starship.toml file, and the default prompt is used.

Expected Behavior

The prompt to update when I save the starship.toml file and reload the $PROFILE or open a new PowerShell Tab in Windows Terminal.

Additional context/Screenshots

Possible Solution

Environment

pwsh:
function Invoke-Starship-TransientFunction {
    &starship module character
}

$ENV:STARSHIP_CONFIG = "$HOME\nickt\.config\starship.toml"

Enable-TransientPrompt

Invoke-Expression (&starship init powershell)

Starship Configuration

"$schema" = 'https://starship.rs/config-schema.json'

format = """
[ξ‚Ά](color_orange)\
$os\
$username\
[ξ‚°](bg:color_yellow fg:color_orange)\
$directory\
[ξ‚°](fg:color_yellow bg:color_aqua)\
$git_branch\
$git_status\
[ξ‚°](fg:color_aqua bg:color_blue)\
$c\
$rust\
$golang\
$nodejs\
$php\
$java\
$kotlin\
$haskell\
$python\
[ξ‚°](fg:color_blue bg:color_bg3)\
$docker_context\
$conda\
[ξ‚°](fg:color_bg3 bg:color_bg1)\
$time\
[ξ‚΄ ](fg:color_bg1)\
$line_break$character"""

palette = 'gruvbox_dark'

[palettes.gruvbox_dark]
color_fg0 = '#fbf1c7'
color_bg1 = '#3c3836'
color_bg3 = '#665c54'
color_blue = '#458588'
color_aqua = '#689d6a'
color_green = '#98971a'
color_orange = '#d65d0e'
color_purple = '#b16286'
color_red = '#cc241d'
color_yellow = '#d79921'

[os]
disabled = false
style = "bg:color_orange fg:color_fg0"

[os.symbols]
Windows = "󰍲"
Ubuntu = "σ°•ˆ"
SUSE = "οŒ”"
Raspbian = "󰐿"
Mint = "σ°£­"
Macos = "󰀡"
Manjaro = "οŒ’"
Linux = "󰌽"
Gentoo = "󰣨"
Fedora = "σ°£›"
Alpine = "οŒ€"
Amazon = "ο‰°"
Android = ""
Arch = "󰣇"
Artix = "󰣇"
EndeavourOS = "ο†—"
CentOS = "οŒ„"
Debian = "󰣚"
Redhat = "󱄛"
RedHatEnterprise = "󱄛"

[username]
show_always = true
style_user = "bg:color_orange fg:color_fg0"
style_root = "bg:color_orange fg:color_fg0"
format = '[ $user ]($style)'

[directory]
style = "fg:color_fg0 bg:color_yellow"
format = "[ $path ]($style)"
truncation_length = 3
truncation_symbol = "…/"

[directory.substitutions]
"Documents" = "σ°ˆ™ "
"Downloads" = "ο€™ "
"Music" = "󰝚 "
"Pictures" = "ο€Ύ "
"Developer" = "󰲋 "

[git_branch]
symbol = ""
style = "bg:color_aqua"
format = '[[ $symbol $branch ](fg:color_fg0 bg:color_aqua)]($style)'

[git_status]
style = "bg:color_aqua"
format = '[[($all_status$ahead_behind )](fg:color_fg0 bg:color_aqua)]($style)'

[nodejs]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[c]
symbol = " "
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[rust]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[golang]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[php]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[java]
symbol = "ξ‰– "
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[kotlin]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[haskell]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[python]
symbol = "ξ˜†"
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[docker_context]
symbol = ""
style = "bg:color_bg3"
format = '[[ $symbol( $context) ](fg:#83a598 bg:color_bg3)]($style)'

[conda]
style = "bg:color_bg3"
format = '[[ $symbol( $environment) ](fg:#83a598 bg:color_bg3)]($style)'

[time]
disabled = false
time_format = "%R"
style = "bg:color_bg1"
format = '[[  $time ](fg:color_fg0 bg:color_bg1)]($style)'

[line_break]
disabled = false

[character]
disabled = false
success_symbol = '[](bold fg:color_green)'
error_symbol = '[](bold fg:color_red)'
vimcmd_symbol = '[](bold fg:color_green)'
vimcmd_replace_one_symbol = '[](bold fg:color_purple)'
vimcmd_replace_symbol = '[](bold fg:color_purple)'
vimcmd_visual_symbol = '[](bold fg:color_yellow)'
davidkna commented 1 month ago

$ENV:STARSHIP_CONFIG = "$HOME\nickt\.config\starship.toml" seems unusual. If nickt is your username, it should already be included in $HOME.

Please confirm that the correct starship config file is picked up by opening it via starship config, or consulting the starship output when $ENV:STARSHIP_LOG='trace'.

In addition, Enable-TransientPrompt is only possible after starship is sourced.

Lupus47 commented 1 month ago

The $HOME issue fixed it. Also how exactly do I source starship to enable transient prompt?

davidkna commented 1 month ago

Like this, just swapping the statements around:

Invoke-Expression (&starship init powershell)

Enable-TransientPrompt
Lupus47 commented 1 month ago

Thanks!