Skip to content

Commit

Permalink
fix(elvish): use $pwd for logical-path (starship#3534)
Browse files Browse the repository at this point in the history
The `$PWD` environment variable used by starship is not updated on startup by `elvish`. `elvish` also provides a separate `$pwd` variable that does get updated and seems to be be a better indicator for the current logical path.
  • Loading branch information
davidkna authored and Perniciosius committed Feb 21, 2022
1 parent 620677c commit 2ffa137
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/init/starship.elv
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ set edit:after-command = [ $@edit:after-command $starship-after-command-hook~ ]
# Install starship
set edit:prompt = {
var cmd-duration = (printf "%.0f" (* $edit:command-duration 1000))
::STARSHIP:: prompt --jobs=$num-bg-jobs --cmd-duration=$cmd-duration --status $cmd-status-code
::STARSHIP:: prompt --jobs=$num-bg-jobs --cmd-duration=$cmd-duration --status=$cmd-status-code --logical-path=$pwd
}

set edit:rprompt = {
var cmd-duration = (printf "%.0f" (* $edit:command-duration 1000))
::STARSHIP:: prompt --right --jobs=$num-bg-jobs --cmd-duration=$cmd-duration --status $cmd-status-code
::STARSHIP:: prompt --right --jobs=$num-bg-jobs --cmd-duration=$cmd-duration --status=$cmd-status-code --logical-path=$pwd
}

0 comments on commit 2ffa137

Please sign in to comment.