Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

ANSI escape sequences in custom prompt cause visual artifact ('m' character) during syntax error recoloring

Aperta
#5,196 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
csharp, powershell
Ambito
cli

Direzione di ricerca

Start by reproducing the issue with the supplied PowerShell prompt function, an opening quote, and the stated PSReadLine environment. Trace the real-time syntax-error prompt recoloring and how ANSI escape sequences affect character offsets. Done means the prompt delimiter recolors without leaving an orphaned “m” or overwriting the “>” character.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
N/A
Summary

ANSI escape sequences returned by a custom prompt function cause character offset miscalculations during real-time syntax-error prompt recoloring, leaving an orphaned 'm' character or overwriting the prompt delimiter.

Screenshot
Image Image
Environment data
PS Version: 7.6.5
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.4.5
PSReadLine EditMode: Windows
OS: 10.0.26100.1 (WinBuild.160101.0800)
BufferWidth: 120
BufferHeight: 30
Steps to reproduce
  1. Start PowerShell with the following prompt function:

    function prompt {
        "`e[1;33mPS `e[1;34m$pwd`e[1;32m$('>' * ($nestedPromptLevel + 1)) `e[0m"
    }
    
  2. Type an opening quotation mark (" or ').

Expected behavior

The prompt delimiter (>) recolors cleanly to indicate an incomplete/syntax error state without visual artifacts.

Actual behavior

An orphaned m (from the trailing \e[0m SGR sequence) is printed at the end of the prompt or overwrites the > character.

Lingua principale
C#
Stelle
4.4k
Fork
341
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PowerShell/PSReadLine

Tutte le issue di PowerShell/PSReadLine

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.