Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Complete function completes common ANSI escape sequence in completion items

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

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

評価

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

調査の方向性

Start by tracing PSReadLine's Complete logic using the supplied Register-ArgumentCompleter reproduction, focusing on how the common prefix is derived from ListItemText. Verify that ANSI escape sequences are not inserted into the completed command arguments, while normal completion text still works as expected.

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

説明

Needs-Triage :mag:
Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.
Exception report
From https://github.com/carapace-sh/carapace/issues/997#issuecomment-3566731943

PSReadLine's `Complete` logic attempts to auto-complete the input with the "common prefix" of all available matches on the first `<TAB>`. While the actual `CompletionText` differ, Carapace prepends the same ANSI escape codes to the `ListItemText` of every entry to ensure styling. The `Complete` function _correctly_ identifies this ANSI sequence as the shared prefix and prints it to the prompt.
Screenshot
Image
Environment data
PS Version: 7.5.4
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.4.5
PSReadLine EditMode: Windows
OS: 10.0.26100.7306 (WinBuild.160101.0800)
BufferWidth: 158
BufferHeight: 25
Steps to reproduce
Set-PSReadLineKeyHandler -Chord Tab -Function Complete
Register-ArgumentCompleter -Native -ScriptBlock {
    param($wordToComplete, $commandAst, $cursorPosition)
    @(
        [System.Management.Automation.CompletionResult]::new("aa", "`e[2maa", [System.Management.Automation.CompletionResultType]::ParameterValue, "1"),
        [System.Management.Automation.CompletionResult]::new("bb", "`e[2mbb", [System.Management.Automation.CompletionResultType]::ParameterValue, "2")
    )
} -CommandName 'bash'
Expected behavior

Completion should not include ANSI escape sequence

Actual behavior

Escape sequence is completed as part of the arguments

bash ^[[2m
主要言語
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 を短くまとめたダイジェスト。