Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Nov 6, 2025

This PR supersedes #8556 to land the requested fixes because the original branch is on a fork and is not pushable from this environment.

Related GitHub Issue

Closes: #8555

Description

This PR introduces a new toggle in the settings under the "UI" section that allows users to switch between two input behaviors in the chat prompt editor:

  • Enter = newline, Shift+Enter / Ctrl+Enter = send
  • Enter = send, Shift+Enter = newline (current default)

The change is implemented by listening to the keydown event in the prompt input component and conditionally intercepting the Enter key based on the user’s preference, which is stored via VS Code’s configuration API.

This addresses user pain points around accidental submissions, ergonomic fatigue from holding Shift, and conflicts with input method workflows.

Test Procedure

  • Send a message normally in the chat input
  • Enable the feature
  • Be happy that when you press enter, you receive a new line, and when you press ctrl+enter, the message is sent.
  • Disable the feature
  • Be happy that everything is back to default behavior.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

The settings panel
image

Didn't send the message after pressing enter:
image

Did send it when pressing ctrl+enter
image

Documentation Updates

  • This implementation does not introduce any new hardcoded keybindings beyond using standard modifier combinations (Shift+Enter, Ctrl+Enter), which are already common in chat interfaces.
  • It would be ideal if there are documentation written to allow users to understand how to change the setting, but I think it is very intuitive
  • I do not have time to write docs for this feature

Additional Notes

Get in Touch

Discord: lmtr0


Important

Adds a toggle for switching input behaviors in chat prompt editor, with platform-aware key handling and i18n updates.

  • Behavior:
    • Adds a toggle in settings under "UI" for switching input behaviors in chat prompt editor.
    • Implements keydown event handling in ChatTextArea.tsx to intercept Enter key based on user preference.
    • Default behavior: Enter sends message; Shift+Enter adds newline.
    • New option: Enter adds newline; Ctrl+Enter sends message.
  • Settings:
    • Adds requireCtrlEnterToSend to global-settings.ts and ClineProvider.ts.
    • Updates SettingsView.tsx and UISettings.tsx to include new toggle.
  • i18n:
    • Updates various locale files to include translations for new feature.
  • Tests:
    • Adds tests in ChatTextArea.spec.tsx for new keyboard handling behavior.
  • Utils:
    • Adds platform.ts for platform detection and key combination utilities.

This description was created by Ellipsis for 8571f3b. You can customize this summary. It will automatically update as commits are pushed.

@hannesrudolph hannesrudolph mentioned this pull request Nov 6, 2025
6 tasks
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Nov 6, 2025
@roomote
Copy link

roomote bot commented Nov 6, 2025

Rooviewer Clock   Follow along on Roo Cloud

Re-review complete. The previously identified issue has been resolved.

Issues resolved:

  • Fix JSON structure in Italian settings - missing description field for collapseThinking
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@dosubot dosubot bot added the UI/UX UI/UX related or focused label Nov 6, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Nov 6, 2025
"label": "Comprimi i messaggi di pensiero per impostazione predefinita",
"description": "Se abilitato, i blocchi di pensiero verranno compressi per impostazione predefinita finché non interagisci con essi"
"label": "Comprimi i messaggi di pensiero per impostazione predefinita"
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The collapseThinking object is missing its description field, which breaks the JSON structure. This will cause i18n lookups to fail when users try to view this setting in Italian.

Suggested change
},
"collapseThinking": {
"label": "Comprimi i messaggi di pensiero per impostazione predefinita",
"description": "Se abilitato, i blocchi di pensiero verranno compressi per impostazione predefinita finché non interagisci con essi"
},

Fix it with Roo Code or mention @roomote and request a fix.

"label": "Comprimi i messaggi di pensiero per impostazione predefinita",
"description": "Se abilitato, i blocchi di pensiero verranno compressi per impostazione predefinita finché non interagisci con essi"
"label": "Comprimi i messaggi di pensiero per impostazione predefinita"
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The collapseThinking object is missing its description field, which breaks the JSON structure. This will cause i18n lookups to fail when users try to view this setting in Italian.

Suggested change
},
"collapseThinking": {
"label": "Comprimi i messaggi di pensiero per impostazione predefinita",
"description": "Se abilitato, i blocchi di pensiero verranno compressi per impostazione predefinita finché non interagisci con essi"
},

Fix it with Roo Code or mention @roomote and request a fix.

@hannesrudolph hannesrudolph force-pushed the fix/ctrl-enter-send-8556 branch from 58c93eb to 31ab4be Compare November 6, 2025 16:18
…tform key renders in Settings; clean ChatView lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files. UI/UX UI/UX related or focused

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Chat: Ctrl Enter Send

3 participants