Created
June 10, 2024 09:16
-
-
Save oldtune/b111dca4f099c85fe1841b62482e726f to your computer and use it in GitHub Desktop.
Powershell + Starship duplicate tab using CWD (Current working directory)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Invoke-Starship-PreCommand { | |
$loc = $executionContext.SessionState.Path.CurrentLocation; | |
$prompt = "$([char]27)]9;12$([char]7)" | |
if ($loc.Provider.Name -eq "FileSystem") | |
{ | |
$prompt += "$([char]27)]9;9;`"$($loc.ProviderPath)`"$([char]27)\" | |
} | |
$host.ui.Write($prompt) | |
} | |
$ENV:STARSHIP_CONFIG = "$HOME\example\non\default\path\starship.toml" | |
Invoke-Expression (&starship init powershell) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment