Skip to content

Fix Ctrl-A in multiline terminal prompts#10362

Open
sdaveas wants to merge 1 commit into
warpdotdev:masterfrom
sdaveas:fix-ctrl-a-multiline-prompt
Open

Fix Ctrl-A in multiline terminal prompts#10362
sdaveas wants to merge 1 commit into
warpdotdev:masterfrom
sdaveas:fix-ctrl-a-multiline-prompt

Conversation

@sdaveas
Copy link
Copy Markdown

@sdaveas sdaveas commented May 7, 2026

Description

Fixes terminal input Ctrl-A behavior for multiline prompts. Terminal input now opts into a line-start behavior where Ctrl-A first moves to the start of the current prompt line, and pressing it again from column 0 moves to the start of the previous prompt line. Other editor surfaces keep the existing current-line behavior.

This intentionally leaves Ctrl-E unchanged for now, with a TODO to revisit terminal-style line-end behavior separately.

Linked Issue

#10763

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Screenshots / Videos

warp-ctrl-a-recording

Testing

  • cargo fmt --check
  • cargo test -p warp test_move_to_line_start_previous_line_when_at_start
  • cargo test -p warp test_terminal_input_line_start_moves_to_previous_line_when_at_start
  • cargo clippy --workspace --exclude warp_completer --all-targets --tests -- -D warnings
  • cargo clippy -p warp_completer --all-targets --tests -- -D warnings

Validation was run on the remote laptop because the local laptop cannot build Warp without the full Xcode Metal toolchain.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-BUG-FIX: Fixed Ctrl-A behavior in multiline terminal prompts to move by prompt line.

Co-Authored-By: Warp agent@warp.dev

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented May 7, 2026

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @sdaveas on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label May 7, 2026
@sdaveas
Copy link
Copy Markdown
Author

sdaveas commented May 7, 2026

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label May 7, 2026
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented May 7, 2026

The cla-bot has been summoned, and re-checked this pull request!

@sdaveas sdaveas marked this pull request as ready for review May 8, 2026 09:57
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 8, 2026

@sdaveas

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I reviewed this pull request and requested human review from: @kevinyang372.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Use terminal-specific line-start behavior so Ctrl-A first moves to the current prompt line start, then steps to the previous line when already at column zero.

Co-Authored-By: Warp <agent@warp.dev>
Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR adds a configurable editor line-start behavior and opts terminal input into moving to the previous prompt line when MoveToLineStart is invoked from column 0. The default behavior remains unchanged for other editor surfaces, and the added tests cover the editor option and terminal input path.

Concerns

  • No blocking correctness or security concerns found in the changed lines.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot requested a review from kevinyang372 May 8, 2026 10:02
@sdaveas sdaveas force-pushed the fix-ctrl-a-multiline-prompt branch from 9253ed2 to ab46317 Compare May 8, 2026 10:02
@kevinyang372 kevinyang372 requested review from vkodithala and removed request for kevinyang372 May 8, 2026 17:03
@kevinyang372
Copy link
Copy Markdown
Member

@vkodithala Could you take over? This is an edit to terminal/input.rs

Copy link
Copy Markdown
Contributor

@vkodithala vkodithala left a comment

Choose a reason for hiding this comment

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

Hey @sdaveas - thanks for the fix, this looks awesome. Mind linking an issue on our public repo? If there isn't already one, feel free to file manually or via the /feedback slash command in Warp :)

Copy link
Copy Markdown
Contributor

@vkodithala vkodithala left a comment

Choose a reason for hiding this comment

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

Refer to previous comment re: missing linked issue! Will review once fixed.

@sdaveas
Copy link
Copy Markdown
Author

sdaveas commented May 12, 2026

Hey @sdaveas - thanks for the fix, this looks awesome. Mind linking an issue on our public repo? If there isn't already one, feel free to file manually or via the /feedback slash command in Warp :)

@vkodithala done! Created an issue and linked in the description.

@sdaveas sdaveas requested a review from vkodithala May 12, 2026 19:56
Copy link
Copy Markdown
Contributor

Thanks so much! We just reviewed this and are looking for a little more info. For context, the decision to make Ctrl-A jump to the beginning of the current line was intentional, since we wanted to support IDE/text editor-style editing in our terminal input. Would like to see some examples of how other terminals do this to inform if we want to consider a change!

Copy link
Copy Markdown
Contributor

@vkodithala vkodithala left a comment

Choose a reason for hiding this comment

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

Feel free to re-request a review if and when the original issue is marked ready-to-spec/implement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants