Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Cursor position needs to be adjusted in some uncommon cases when rendering in screen reader mode

Ouverte
#4,912 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
45/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
csharp
Domaine
accessibility, cli

Piste de recherche

Start with the screen reader rendering flow described in the issue and review the original discussion in PR #4854. Reproduce the cursor-at-d example by pasting defghi into abcdef, then verify that the terminal displays abcdefghidef rather than abcghidef.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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

N/A

Environment data
PS Version: 7.5.2
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.4.3-beta3
PSReadLine EditMode: Windows
OS: 10.0.26100.1 (WinBuild.160101.0800)
BufferWidth: 150
BufferHeight: 40
Steps to reproduce

In Screen Reader mode, the way rendering works is to first calculate the common prefix between the last rendered string and the current string, and then move cursor (as needed) to the position of commonPrefixLength to erase the rest of the previous rendering and write the diff part from the current string.

There could be a problem when user moves the cursor and then inserts (or select-then-delete) a sequence of characters.

One example:

  • Previous line is abcdef, cursor is at the letter d
  • Press ctrl+v to paste defghi

In this case, the new buffer is abcdefghidef, and commonPrefixLength == previousBuffer.Length, but the cursor is still at the first letter d when code flow reaches here. Then writting out the new diff ghidef will result in abcghidef displayed in terminal.

When execution reaches the screen reader rendering, _current is already changed -- it no longer reflects where the cursor is at. This uncommon scenario is tricky, and it potentially could affect the commonPrefixLength != previousBuffer.Length case.

The original discussion is at https://github.com/PowerShell/PSReadLine/pull/4854#discussion_r2286301586

Expected behavior

Cursor position needs to be adjusted in those cases. For the specific example described above, the result text on terminal should be abcdefghidef.

Actual behavior

For the example described above, the result text on terminal should be abcghidef.

Langage dominant
C#
Étoiles
4.4k
Forks
341
Métriques de merge des PR
Aucune PR mergée en 30 j

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de PowerShell/PSReadLine

Toutes les issues de PowerShell/PSReadLine

Issues similaires

Plus d'issues C#

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.