Feature request: emit a distinct CSI-u sequence for Ctrl+Enter in terminal blocks
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript
- Ambito
- cli
Direzione di ricerca
Inizia in frontend/app/view/term/term-model.ts, all’interno di handleTerminalKeydown(), e confronta la gestione esistente di Shift+Enter con il caso Ctrl+Enter richiesto. Verifica i byte grezzi per Enter, Shift+Enter, Ctrl+Enter e Alt+Enter, confermando che il comportamento esistente di Enter rimanga invariato e che la nuova sequenza funzioni sulle piattaforme indicate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Feature description
Please add terminal-block handling for Ctrl+Enter so WaveTerm emits a distinct key sequence instead of collapsing it to the same byte as Enter/newline.
A practical default would be to send the CSI-u representation for Ctrl+Enter:
ESC [ 13 ; 5 u
or, as a JavaScript string:
"\x1b[13;5u"
This would let terminal applications distinguish Ctrl+Enter from plain Enter and Shift+Enter.
Why this matters
Many interactive terminal applications and coding/chat CLIs support configurable input behavior such as:
Enterinserts a newlineCtrl+Entersubmits/sends the message
This is useful for multi-line prompts in AI/coding tools and other REPL-like terminal UIs.
Today, WaveTerm can already special-case modified Enter keys. PR #2523 added related handling for Shift+Enter newline support in frontend/app/view/term/term-model.ts. This request is the analogous missing case for Ctrl+Enter.
Current behavior
Testing in WaveTerm with a raw byte reader shows:
Enter -> 0a
Shift+Enter -> 0a
Ctrl+Enter -> 0a
Alt+Enter -> 1b 0a
So Enter, Shift+Enter, and Ctrl+Enter are indistinguishable to the program running inside the terminal. Alt+Enter is distinguishable because it carries an ESC prefix.
Expected behavior
Ctrl+Enter should produce a distinct sequence, for example:
Ctrl+Enter -> 1b 5b 31 33 3b 35 75
which is:
\x1b[13;5u
Terminal applications that understand CSI-u can then bind ctrl+enter separately from enter.
Suggested implementation
In frontend/app/view/term/term-model.ts, inside handleTerminalKeydown(), add a Ctrl:Enter branch near the existing Shift:Enter branch:
if (keyutil.checkKeyPressed(waveEvent, "Ctrl:Enter")) {
this.sendDataToController("\x1b[13;5u");
event.preventDefault();
event.stopPropagation();
return false;
}
This mirrors the existing approach used for Shift:Enter, but sends a standard CSI-u modified-key sequence instead of a newline byte.
Validation
After applying this locally, the raw-byte test becomes:
Enter -> 0a
Shift+Enter -> 0a
Ctrl+Enter -> 1b 5b 31 33 3b 35 75
Alt+Enter -> 1b 0a
With that output, applications such as Pi can configure:
{
"tui.input.newLine": ["enter", "shift+enter", "ctrl+j"],
"tui.input.submit": ["ctrl+enter"]
}
and get the intended behavior without local WaveTerm binary patching.
Related work
- #2523 added terminal input improvements, including
Shift+Enternewline support. - This request extends the same terminal-block keydown handling pattern to
Ctrl+Enter.
Acceptance criteria
-
Ctrl+Enterin a terminal block emits\x1b[13;5uor another documented distinct Ctrl+Enter sequence. -
EnterandShift+Enterbehavior remains unchanged. - The behavior works on Linux, macOS, and Windows where the browser/Electron key event exposes
Ctrl+Enter. - The behavior is documented if WaveTerm has terminal key handling documentation.
- Lingua principale
- Go
- Stelle
- 22.3k
- Fork
- 1.1k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di wavetermdev/waveterm
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
wavetermdev/waveterm#3481 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
wavetermdev/waveterm#3435 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
wavetermdev/waveterm#3432 ·
-
enhancement triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
wavetermdev/waveterm#3431 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
wavetermdev/waveterm#3428 ·
Tutte le issue di wavetermdev/waveterm
Issue simili
-
kind/bug needs-triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
matrixorigin/matrixone#29223 ·
-
needs-acceptance wg/data-plane-networking
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
vllm-project/semantic-router#4024 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
alexgorbatchev/dotfiles#107 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100