Ghostty Shift+Enter (CSI 27;2;13~) is inserted as text and jumps to buffer start
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 52/100
Línea de trabajo
Start by reading the input parser and internal/action/defaults_other.go, where the issue says the Alt-[ binding causes the cursor jump. Trace how terminal key sequences become key events, then check the parser's tests for similar CSI sequences. Done means CSI 27;<modifier>;<keycode>~ is decoded into the corresponding key and modifiers, with Shift+Enter handled without inserting sequence text or moving the cursor to the buffer start.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
Pressing Shift+Enter in micro under Ghostty inserts the literal text 27;2;13~ and jumps the cursor to the beginning of the buffer.
Environment
- micro 2.0.15 (
6a62575b), latest release - Ghostty 1.3.1 (Arch
ghostty 1.3.1-arch2.1), Linux/Wayland,TERM_PROGRAM=ghostty - tcell
github.com/micro-editor/tcell/v2 v2.0.13(fromgo.mod)
Steps to reproduce
- Open micro in Ghostty.
- Press Shift+Enter.
Actual: the cursor jumps to the start of the buffer and 27;2;13~ is inserted as text.
Expected: a newline is inserted, or the key is ignored.
Root cause
Ghostty encodes Shift+Enter with the xterm modifyOtherKeys sequence:
CSI 27 ; 2 ; 13 ~ -> \x1b[27;2;13~
tcell does not decode CSI 27;…~, so ESC [ matches the Alt-[ binding (DiffPrevious|CursorStart in internal/action/defaults_other.go) and moves the cursor to the top of the buffer; the rest of the sequence (27;2;13~) is inserted as runes.
I reproduced this through a pty with micro 2.0.15:
| input | result |
|---|---|
\r (CR) |
inserts a newline |
\n (LF) |
treated as Ctrl-J → PlayMacro, no visible effect |
\x1b[27;2;13~ |
cursor jumps to start, 27;2;13~ inserted |
Workarounds
- Ghostty:
keybind = shift+enter=text:\rsends CR, which micro treats as Enter. - micro: add
"Ctrl-J": "InsertNewline"tobindings.jsonand let Ghostty keep sendingtext:\n.
Suggested fix
Decode xterm modifyOtherKeys (CSI 27 ; <modifier> ; <keycode> ~) in the input parser and map it to the corresponding key plus modifiers, so Shift+Enter can be bound normally (or defaults to InsertNewline). Other TUI projects have had to add the same handling for Ghostty.
- Lenguaje dominante
- Go
- Estrellas
- 29.8k
- Forks
- 1.4k
- Merge medio
- 1 d 12 h
- PR fusionados (30 d)
- 2
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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.
Más de micro-editor/micro
-
feature syntax
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
micro-editor/micro#4289 ·
Los mantenedores suelen responder en 3 días
-
Also bind alt-click for multi-cursorsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertofeature
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
micro-editor/micro#4260 ·
Los mantenedores suelen responder en 3 días
-
XML syntax highlighting breaks if empty tag contains whitespace before closePosiblemente ocupada @justadityaraj la tomó hace 56 días. Abiertobug syntax
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
micro-editor/micro#4213 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
micro-editor/micro#3553 · 5 comentarios ·
Los mantenedores suelen responder en 3 días
-
syntax
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
micro-editor/micro#2969 · 3 comentarios · 1 reacción ·
Los mantenedores suelen responder en 3 días
Todos los issues de micro-editor/micro
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
kubeflow/semantic-operator#52 ·
Los mantenedores suelen responder en 10 días
-
enhancement help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
PramodBasavarajMenasi/siftwise#52 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
dragonflydb/dragonfly-operator#619 ·
Los mantenedores suelen responder en 2 días
-
非流式 /v1/chat/completions 经 Responses 转换时丢失 reasoning_content(vLLM 上游 summary 为空、思考在 content 中)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
lazygit is not RustAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100