Replies: 3 comments 7 replies
-
I've been thinking about this and src/init/starship.ps1 probably needs to be modified to change the window title. No big a deal IMHO. |
Beta Was this translation helpful? Give feedback.
-
I'd start with the current working directory; I believe that's what Powershell does by default. Obviously other scripts/apps can change the title as well but that shouldn't concern us. It would be a nice bonus to make it configurable as i can definitely imagine some people wanting it to mimic the prompt itself. (which in turn is exactly what would make it configurable to begin with?) |
Beta Was this translation helpful? Give feedback.
-
In powershell you can use for now function SetWindowTitle {
$host.UI.RawUI.WindowTitle = $PWD # always set to the path, as an example.
}
# Starship must come first
starship init powershell | iex
$oldPrompt = $function:prompt
function prompt {
$null = SetWindowTitle
& $oldPrompt
} (stolen from zoxide) Also akin to zoxide for $PWD chnages only this will work:
|
Beta Was this translation helpful? Give feedback.
-
As per the documentation, one needs to define the logic of setting the window title before launching Starship. However, The documentation only mentions the *nix family of shells.
In Powershell the way to do this AFAIK is the following:
However, I'm not too sure about the equivelant of the precmd commands in this case. Is this somethign Starship needs to do/support or am i missing something in my
$PROFILE
file to be set before Starship launches?Beta Was this translation helpful? Give feedback.
All reactions