T05: fish search path, PowerShell policy and load failure, encoded OSC 7 paths, kept exit status, install read errors
This commit is contained in:
6 files changed
+230
-110
No files matched your search
@@ -1,13 +1,15 @@
|
||||
# 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') {
|
||||
$path = $folder.ProviderPath.Replace('\', '/').Replace('%', '%25')
|
||||
$parts = $folder.ProviderPath.Replace('\', '/') -split '/'
|
||||
$path = ($parts | ForEach-Object { [Uri]::EscapeDataString($_) }) -join '/'
|
||||
if (-not $path.StartsWith('/')) { $path = "/$path" }
|
||||
$leaf = Split-Path -Leaf $folder.ProviderPath
|
||||
$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")
|
||||
}
|
||||
& $global:ElyPrompt
|
||||
$text
|
||||
}
|
||||
Reference in new issue
Block a user