`ListView` prediction breaks `RevertLine()`

Abierto
#5,047 3 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
csharp
Área
cli

Línea de trabajo

Reproduce the problem in a pwsh -NoProfile session using the Ctrl+R handler and ListView prediction settings described above. Trace the interaction between RevertLine(), Insert(), and ListView prediction rendering. Done means pressing Ctrl+R replaces foo with Inserted Text rather than appending to it, with relevant tests updated or added if the repository provides coverage for this behavior.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
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: 361
BufferHeight: 96
Steps to reproduce

In a pwsh -NoProfile session, run the following:

Set-PSReadLineKeyHandler -Chord "Ctrl+r" -ScriptBlock {
    [Microsoft.PowerShell.PSConsoleReadLine]::RevertLine()
    [Microsoft.PowerShell.PSConsoleReadLine]::Insert("Inserted Text")
}

Set-PSReadLineOption -PredictionViewStyle ListView

Then, type foo (without pressing the enter key) and press Ctrl+R.

Expected behavior

Pressing Ctrl+R should replace foo by Inserted Text in the prompt.

Actual behavior

Pressing Ctrl+R adds Inserted Text to the existing foo: the end result is fooInserted Text in the prompt.

Lenguaje dominante
C#
Estrellas
4.4k
Forks
341
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de PowerShell/PSReadLine

Todos los issues de PowerShell/PSReadLine

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.