Skip to content

Swap Enter/Shift+Enter in agents prompt editor#199

Open
aletc1 wants to merge 1 commit into21st-dev:mainfrom
aletc1:claude/vibrant-gates-8bad30
Open

Swap Enter/Shift+Enter in agents prompt editor#199
aletc1 wants to merge 1 commit into21st-dev:mainfrom
aletc1:claude/vibrant-gates-8bad30

Conversation

@aletc1
Copy link
Copy Markdown

@aletc1 aletc1 commented Apr 17, 2026

Summary

Swap the submit/newline keys in the shared AgentsMentionsEditor:

  • Enter → insert a newline (default contenteditable behavior)
  • Shift+Enter → submit
  • Opt+Shift+Enter → force-submit (stop current stream, bypass queue, send immediately)

Applies to both the new-workspace ("What do you want to get done?") input and the active-chat input, since both render the same editor.

Closes #197

Why

Multi-line prompts were easy to accidentally send with a stray Enter. Making Enter a newline and requiring a modifier to submit matches the pattern users already expect from other chat UIs for longer-form composition.

Changes

  • src/renderer/features/agents/mentions/agents-mentions-editor.tsx — flipped the shiftKey check in the Enter branch of the editor's onKeyDown handler (the core one-line behavior change). Plain Enter now falls through to the native contenteditable newline; dropdown (@ mention / / slash) handling is unchanged.
  • Updated comments in chat-input-area.tsx, active-chat.tsx, and new-chat-form.tsx so any "Opt+Enter" / "press Enter to send" references now say "Opt+Shift+Enter" / "press Shift+Enter to send".

IME composition (isComposing) guard is preserved — composing in CJK IMEs still commits on Enter without submitting.

Test plan

  • New workspace: select a project, type text, press Enter → newline; press Shift+Enter → submits multi-line prompt
  • Active chat: same Enter/Shift+Enter behavior
  • Mentions / slash: typing @ then Enter still selects mention; typing / then Enter still selects command
  • Force-submit: during an in-flight stream, Opt+Shift+Enter stops the stream and sends immediately
  • IME: commit a CJK composition with Enter — composition commits, no submit

🤖 Generated with Claude Code

Enter now inserts a newline and Shift+Enter submits (Opt+Shift+Enter
force-submits). Applies to both the new-workspace prompt and the
active-chat input, since they share AgentsMentionsEditor. Multi-line
prompts are much easier to compose without an accidental send.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve the prompt input (What do you want to get done?)

1 participant