Files
ELYTerminal/assets/shell-integration/pwsh/elyterminal.ps1
T
ZacharyZhang-NY c2da9dd667
CI / platforms (windows-latest) (push) Failing after 8s
CI / macos (push) Failing after 9m9s
CI / platforms (ubuntu-24.04) (push) Canceled after 0s
T05: fish search path, PowerShell policy and load failure, encoded OSC 7 paths, kept exit status, install read errors
2026-10-14 12:39:47 -04:00

16 lines
684 B
PowerShell

# ELYTerminal: wrap the prompt to report folder and title.
$global:ElyPrompt = $function:prompt
function global:prompt {
$text = & $global:ElyPrompt
$folder = $executionContext.SessionState.Path.CurrentLocation
if ($folder.Provider.Name -eq 'FileSystem') {
$parts = $folder.ProviderPath.Replace('\', '/') -split '/'
$path = ($parts | ForEach-Object { [Uri]::EscapeDataString($_) }) -join '/'
if (-not $path.StartsWith('/')) { $path = "/$path" }
$leaf = (Split-Path -Leaf $folder.ProviderPath) -replace '\p{Cc}', ''
$esc, $bel = [char]27, [char]7
[Console]::Write("$esc]7;file://$path$bel$esc]2;$leaf$bel")
}
$text
}