PyREPL: ESC key in isearch mode has ambiguous prefix delay
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 77.2k
- Forks
- 35.9k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
Bug report
Bug description:
This issue was noted from #145398. A bare Esc press in isearch mode (Ctrl-R) does not exit search. Instead, the first Esc appears to do nothing, only after pressing Esc a second time does isearch end.
To reproduce:
- Press
Ctrl-Rin PyREPL to enter isearch. - Press
Esconce to exit isearch.
- Expected: isearch ends immediately.
- Actual: nothing happens. Press
Escagain, isearch ends.
This is because BaseEventQueue.push() treats \x1b (ESC) as a prefix of longer escape sequences (arrows, function keys, etc.). When a single Esc is received, the event queue holds it and waits for the next byte to decide whether it’s a standalone Esc or the start of a longer sequence. If no further byte arrives, the Esc event is never delivered, and isearch remains active.
Apart from isearch mode, this behavior affects normal mode as well, where Esc also has a delay before it is recognized.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Windows
Linked PRs
- gh-154731
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Start with BaseEventQueue.push() and the escape-sequence definitions in Lib/_pyrepl/unix_eventqueue.py and Lib/_pyrepl/windows_eventqueue.py. Review linked PR gh-154731 and the existing PyREPL event handling before making changes. Done means a bare Esc exits isearch immediately and is recognized without the current delay in normal mode.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- cli
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 25/100