How can I use the shell integration features with Starship? #22568

Closed
opened 2026-01-31 08:17:15 +00:00 by claunia · 3 comments
Owner

Originally created by @eggbean on GitHub (Nov 17, 2024).

I use starship on Bash, Z-shell, cmd and PowerShell. I have enabled the shell integration features in my Windows Terminal configuration, but I cannot use them as there is no documentation on how to to use them with starship for all the shells I mentioned.

https://learn.microsoft.com/en-us/windows/terminal/tutorials/shell-integration

https://github.com/starship/starship

Originally created by @eggbean on GitHub (Nov 17, 2024). I use starship on Bash, Z-shell, cmd and PowerShell. I have enabled the shell integration features in my Windows Terminal configuration, but I cannot use them as there is no documentation on how to to use them with starship for all the shells I mentioned. https://learn.microsoft.com/en-us/windows/terminal/tutorials/shell-integration https://github.com/starship/starship
claunia added the Needs-TriageNeeds-Tag-Fix labels 2026-01-31 08:17:15 +00:00
Author
Owner

@j4james commented on GitHub (Nov 17, 2024):

Starship has an open issue tracking support for shell integration here: https://github.com/starship/starship/issues/5463

@j4james commented on GitHub (Nov 17, 2024): Starship has an open issue tracking support for shell integration here: https://github.com/starship/starship/issues/5463
Author
Owner

@eggbean commented on GitHub (Nov 17, 2024):

@j4james Thanks. I'll have a look at that. I just realised that there are actually some marks on the scrollbar which correspond with the prompt input lines, so it looks like Starship already has built-in support for that part. I just have to figure out how to use it and see what else is involved with shell integration. Cheers.

@eggbean commented on GitHub (Nov 17, 2024): @j4james Thanks. I'll have a look at that. I just realised that there are actually some marks on the scrollbar which correspond with the prompt input lines, so it looks like Starship already has built-in support for that part. I just have to figure out how to use it and see what else is involved with shell integration. Cheers.
Author
Owner

@bgshacklett commented on GitHub (Jan 21, 2025):

https://learn.microsoft.com/en-us/windows/terminal/tutorials/new-tab-same-directory has an example of enabling a subset of integration from Starship, which can likely be extrapolated for further use cases:

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)
}
@bgshacklett commented on GitHub (Jan 21, 2025): https://learn.microsoft.com/en-us/windows/terminal/tutorials/new-tab-same-directory has an example of enabling a subset of integration from Starship, which can likely be extrapolated for further use cases: ```pwsh 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) } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22568