warp icon indicating copy to clipboard operation
warp copied to clipboard

Add toggle: Rich Input submit on Ctrl+Enter (vs Enter)

Open cbeaulieu-gt opened this issue 6 months ago • 7 comments

Summary

Add a user-facing toggle in Settings → Agents → Third Party Agents that switches the Rich Input editor's submit binding from Enter (default, current behavior) to Ctrl+Enter. When the toggle is on, Enter inserts a newline and Ctrl+Enter submits.

Motivation

Multi-line composition is awkward when Enter always submits — users who want to draft longer prompts to a CLI agent benefit from the IDE-style Ctrl+Enter submit convention.

Acceptance Criteria

  • [ ] New boolean setting submit_on_ctrl_enter (working name) declared in the AI settings group (app/src/settings/ai.rs) with default: false (preserves current behavior), sync_to_cloud: Globally, and an appropriate toml_path under agents.*.
  • [ ] Toggle rendered in CLIAgentWidget (app/src/settings_view/ai_page.rs ~L6206) following the existing ShouldRenderCLIAgentToolbar pattern (label, AISettingsPageAction::Toggle* variant, SwitchStateHandle).
  • [ ] Rich Input editor's keybinding layer reads the setting at submit time: when false → Enter submits (current); when true → Enter inserts newline, Ctrl+Enter submits.
  • [ ] Setting persists across app restarts via the standard settings sync path.
  • [ ] Screenshot of the toggle in the settings pane AND a screenshot/video of Ctrl+Enter submitting in the Rich Input attached to the PR before merge.

Out of Scope

  • Generalized keybinding remapping UI.
  • Changing the submit binding for non-Rich-Input editors (regular terminal input, command palette, etc.).
  • Per-agent override.

Implementation Notes

Explore pass already mapped the surface:

  • Settings schema pattern: app/src/settings/ai.rs:715+ (define_settings_group!)
  • Settings UI: app/src/settings_view/ai_page.rs:6206-6350 (CLIAgentWidget, AISubpage::ThirdPartyCLIAgents)
  • Existing reference toggle: ShouldRenderCLIAgentToolbar at L6233
  • Submit handling: app/src/ai/blocklist/input_model.rs:558 (handle_input_buffer_submitted)
  • Enter keybinding lives in the Rich Input view (app/src/ai/blocklist/block/view_impl/input.rs and parent container) — implementer needs to locate the exact dispatch site.

🤖 Generated by Claude Code on behalf of @cbeaulieu-gt

cbeaulieu-gt avatar May 23 '26 01:05 cbeaulieu-gt

@cbeaulieu-gt

Here's what I found while triaging this issue:

This looks like an actionable feature request. Current Rich Input behavior submits on Enter, and I did not find an existing setting that switches submission to Ctrl+Enter while making Enter insert a newline.

Maintainer details

I concluded that add a synced Third Party CLI Agents setting that makes Rich Input submit with Ctrl+Enter instead of Enter..

Triage summary

This is an actionable enhancement request for CLI agent Rich Input: add a user-facing setting that changes the submit shortcut from Enter to Ctrl+Enter, with Enter inserting a newline when enabled.

Evidence

  • The requested behavior is scoped to Third Party CLI Agents / Rich Input and includes concrete acceptance criteria.
  • Current code routes an open CLI agent Rich Input session through the Enter submit path, while Ctrl+Enter is emitted as a separate input event and does not submit the CLI agent prompt.
  • The AI settings group and Third Party CLI Agents settings widget already contain adjacent synced Rich Input toggles, which are the likely home for the new setting and UI.

Likely implementation area

  • Add a synced boolean setting under the Third Party CLI Agents settings group.
  • Render a toggle beside the existing Rich Input-related CLI agent settings.
  • Update CLI agent Rich Input key handling so the setting controls whether Enter submits or inserts a newline, and whether Ctrl+Enter submits.
  • Add focused tests for both setting states and menu-selection edge cases where Enter should still accept the highlighted menu item.

Duplicate check

I checked open issues across the repository and recently closed issues. There are related issues about CLI-agent keybindings and newline behavior, but I did not find two or more existing issues that request this same Rich Input submit-toggle behavior.

This is my automated analysis and may be incorrect. A maintainer will verify the details.

Powered by Oz

warp-for-oss[bot] avatar May 23 '26 01:05 warp-for-oss[bot]

@advait-m Tagging you on the issue. Thought the discussion was better here.

As for how to handle the Shift+Enter vs Ctrl+Enter, these are my own observations.. i personally leaned towards ctrl only because you are probably less likely to be holding the ctrl key during regular typing, whereas the shift key is obviously used, so the odds of accidentally doing a shift+enter is higher than a ctrl+enter.

cbeaulieu-gt avatar May 25 '26 00:05 cbeaulieu-gt

@advait-m Tagging you on the issue. Thought the discussion was better here.

As for how to handle the Shift+Enter vs Ctrl+Enter, these are my own observations.. i personally leaned towards ctrl only because you are probably less likely to be holding the ctrl key during regular typing, whereas the shift key is obviously used, so the odds of accidentally doing a shift+enter is higher than a ctrl+enter.

Yeah, starting with ctrl-enter here makes sense to me - can see if we have requests for shift-enter later!

advait-m avatar May 26 '26 21:05 advait-m

This issue has been labeled ready-to-implement and is open for contributions involving code changes. If you'd like to tackle it, feel free to open a pull request against this issue. You can also comment @oz-agent on this issue to have the bot draft an implementation PR automatically.

warp-for-oss[bot] avatar May 26 '26 21:05 warp-for-oss[bot]

Marked as ready-to-implement!

advait-m avatar May 26 '26 21:05 advait-m

Great. So for now well support only Ctrl+Enter and this will behave the same on all Windows/MacOs/Linux systems.

cbeaulieu-gt avatar May 26 '26 22:05 cbeaulieu-gt

Implemented in https://github.com/warpdotdev/warp/pull/11721. Settings field with default off + UI toggle, per @advait-m and @cbeaulieu-gt's settled design.

mvanhorn avatar May 27 '26 00:05 mvanhorn