Unexpected backslash with OSC 9;9 prompt
See original GitHub issuePrerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
- Configure OSC 9;9 for PowerShell and add custom prompt in
$PROFILE
following https://learn.microsoft.com/en-us/windows/terminal/tutorials/new-tab-same-directory#powershell-powershellexe-or-pwshexe:
function prompt {
$loc = $executionContext.SessionState.Path.CurrentLocation;
$out = "PS $loc$('>' * ($nestedPromptLevel + 1)) ";
if ($loc.Provider.Name -eq "FileSystem") {
$out += "$([char]27)]9;9;`"$($loc.ProviderPath)`"$([char]27)\"
}
return $out
}
- Type a single quote
'
or a dot.
Expected behavior
PS> '
Actual behavior
PS>\'
Error details
No response
Environment data
PS /home/yen/tmp/PowerShell> $PSVersionTable
Name Value
---- -----
PSVersion 7.4.0-preview.3
PSEdition Core
GitCommitId 7.4.0-preview.3
OS Linux 6.3.8-arch1-1 PowerShell/PowerShell#1 SMP PREEMPT_DYNAMIC Wed, 14 Jun 2023 20:10:31 +0000
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
I can also reproduce the issue with PowerShell 7.3.4 on Windows 10 22H2.
Visuals
This is captured with Konsole 23.04.2 and tmux 3.3a. I can reproduce the same issue with PowerShell 7.3.4 on Windows 10 22H2.
Issue Analytics
- State:
- Created 3 months ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Syntax error while using backslash in Jenkinsfile
And I got an error WorkflowScript: 4: unexpected char: '\' . How can I use path with whitespace on it without using backslash?...
Read more >Distinguish local and remote terminals
Tutorial on using colors to quickly distinguish terminal windows with active SSH sessions from local sessions.
Read more >Groovy syntax not working with backslashes
When I try to build this command on a Jenkins pipeline give me an error about this syntax. Even before I do this...
Read more >Clink v1.5.1
Name Default * Description
autosuggest.enable False *
clink.promptfilter True Enable prompt filtering by Lua scripts.
lua.break_on_error False Breaks into Lua debugger on Lua errors.
Read more >Getting Started
Our comprehensive services guide provides an overview of our resources and how you can use them. Cluster computing: OSC offers three supercomputer clusters...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Unfortunately, we don’t own that doc.
I can reproduce the issue after moving the prompt function to
$PROFILE
. We will investigate it.