Shift+Enter can't insert a newline
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 78/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Domaine
- cli
Piste de recherche
Localisez l’appel de rendu de Ink et examinez la manière dont le cycle de vie de l’entrée du terminal est géré ; l’issue identifie l’activation de kittyKeyboard et le parser existant isNewlineShortcutKey comme points d’entrée pertinents. Activez le protocole de clavier kitty, préservez le comportement de Ctrl+J et Enter, et gérez le nettoyage du protocole à la sortie et lors des signaux. Vérifiez avec cmd dans un terminal utilisant le protocole kitty en saisissant AAA, Shift+Enter, BBB et Enter, puis confirmez que Ctrl+J insère toujours un retour à la ligne.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Summary
Shift+Enter submits the prompt instead of inserting a newline, so multi-line prompts are impossible without knowing the undocumented Ctrl+J fallback. The input parser already accepts the enhanced Shift+Enter sequences; the app never activates the kitty keyboard protocol, so capable terminals keep sending a bare CR.
Expected Behavior
Enter submits, Shift+Enter inserts a newline — as the help panel states: "Shift+Enter / Alt+Enter → Insert a newline". tui.input.newLine already defaults to ["shift+enter","ctrl+j"] .
Actual Behavior
Shift+Enter behaves exactly like Enter: the prompt submits immediately. Only Ctrl+J inserts a newline.
Cause: the build bundles ink 7.1.0 but never sets kittyKeyboard , and contains no protocol push ( \x1b[>1u ). The parser does accept the encoded sequence ( isNewlineShortcutKey handles \x1b[13;2u , \x1b[27;2;13~ and peers), so only the activation is missing.
Steps to reproduce the issue
- Run cmd in a kitty-protocol terminal (WezTerm here; it needs enable_kitty_keyboard = true ).
- Type AAA , press Shift+Enter, type BBB , press Enter.
- Observed: submits on Shift+Enter, only AAA is sent. Expected: two lines.
Pushing \x1b[>1u around the binary from a zsh wrapper makes Shift+Enter send \x1b[13;2u and work correctly, which confirms the terminal and parser are fine.
Command Code Version
1.53.1
Operating System
Arch Linux 7.2.4-arch1-2 / Hyprland 0.56.2 (Wayland)
Terminal/IDE
WezTerm 20260716-195552-76b606ec
Shell
zsh 5.9.2
Session file (optional)
No response
Fix prompt (optional)
Enable the kitty keyboard protocol in the Ink render call — Ink supports it since 6.7.0:
render(<App />, { kittyKeyboard: { mode: 'enabled' } });
Use 'enabled' , not 'auto' (auto-detection fails under tmux). Pop with \x1b[<u on exit and in signal handlers. The parser already handles the sequences, so no parser change is needed. Keep Ctrl+J as the universal fallback and document that WezTerm needs enable_kitty_keyboard = true .
Check: cmd → AAA → Shift+Enter → BBB → Enter must show two lines; Ctrl+J must still insert a newline and Enter must still submit.
Additional context
No response
- Langage dominant
- Aucune donnée de langage
- Étoiles
- 4k
- Forks
- 350
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de CommandCodeAI/command-code
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
CommandCodeAI/command-code#855 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
CommandCodeAI/command-code#655 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
CommandCodeAI/command-code#608 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 70/100
CommandCodeAI/command-code#893 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
CommandCodeAI/command-code#892 ·
Toutes les issues de CommandCodeAI/command-code
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
qgis/QGIS-Documentation#11275 ·
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
milvus-io/birdwatcher#545 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
-
area:tools bug good first issue help wanted priority:P2
Difficulté 2/5 1-3 heures Accessibilité débutants 90/100
TaewoooPark/Motifcode#14 ·
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
newrelic-experimental/preflight#793 · 1 commentaire ·