PSReadLine doesn't respect cursor position when using `cmd+k` or `cmd+l` on macOS

Abierto
#4,074 5 comentarios 0 reacciones 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
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
csharp, macos, powershell
Área
cli

Línea de trabajo

Reproduce the behavior using Set-PSReadLineKeyHandler, the null prompt, Clear-Host, and typing after moving the cursor to position 5,5 on macOS. Start by tracing the cursor-position handling between the key handler and subsequent input; done means typed text remains at position 5,5 instead of returning to 1,1.

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

Descripción

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

https://github.com/user-attachments/assets/7b4612e4-e6ae-4fb5-b24d-b9aeefcdd429

Environment data
PS Version: 7.4.2
PS HostName: ConsoleHost
PSReadLine Version: 2.3.5
PSReadLine EditMode: Emacs
OS: Darwin Dans-MacBook-Pro.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:14:38 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6020 arm64
BufferWidth: 80
BufferHeight: 24
Steps to reproduce
  1. Set the following key handler
Set-PSReadlineKeyHandler -Chord 'Control+a' -ScriptBlock {
  [Console]::SetCursorPosition(5, 5)
}
  1. Set prompt to null
function prompt { "`0" }
  1. Clear screen. Your cursor should now be in the top left corner
Clear-Host
  1. Hit Ctrl+a. Your cursor should now be at position 5,5

  2. Type Write-Output

Expected behavior

The shell would display Write-Output starting at position 5,5

Actual behavior

The cursor moves back to position 1,1 and displays Write-Output there

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.