Unexpected backslash with OSC 9;9 prompt

オープン
#3,719 コメント 10 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
csharp, powershell
領域
cli

調査の方向性

Start by reproducing the issue with the custom prompt in $PROFILE, OSC 9;9, and the stated PowerShell versions. Compare the handling of a typed single quote or dot with the expected console output; done means the prompt no longer inserts an unexpected backslash.

索引モデルが issue の本文から書いたものです。

説明

Issue-Bug
Prerequisites
Steps to reproduce
  1. 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
}
  1. 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.

主要言語
C#
スター
4.4k
フォーク
341
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PowerShell/PSReadLine のほかの issue

PowerShell/PSReadLine の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。