Skip to content

fix(cli): support physical delete and home/end navigation (#13265) - #13270

Open
maoxin1234 wants to merge 2 commits into
continuedev:mainfrom
maoxin1234:fix/cli-delete-key-handling
Open

fix(cli): support physical delete and home/end navigation (#13265)#13270
maoxin1234 wants to merge 2 commits into
continuedev:mainfrom
maoxin1234:fix/cli-delete-key-handling

Conversation

@maoxin1234

Copy link
Copy Markdown

Description

Fixes #13265.

In the \cn\ CLI prompt editor:

  • Physical \Delete\ was previously routed to \deleteBackward()\ alongside \Backspace, causing forward deletion to behave as backward deletion.
  • \Home\ and \End\ navigation keys were unhandled, and unparsed terminal escape sequences for line editing (\u001b[1~, \u001b[4~, \u001b[H, \u001b[F, \u001b[3~) were consumed without action.

Changes

  1. Added \moveToLineStart()\ and \moveToLineEnd()\ on \TextBuffer.
  2. Routed \key.delete\ to \ his.deleteForward()\ while preserving \key.backspace\ as \ his.deleteBackward().
  3. Handled \key.home\ (move to current line start) and \key.end\ (move to current line end).
  4. Recognized standard terminal escape sequences for Home, End, and forward Delete in \handleOptionKey.
  5. Updated and expanded unit tests in \TextBuffer.test.ts.

Test Plan

  • Ran \�un test extensions/cli/src/ui/TextBuffer.test.ts\ (all 79 tests passing).

@maoxin1234
maoxin1234 requested a review from a team as a code owner September 13, 2026 13:22
@maoxin1234
maoxin1234 requested review from sestinj and removed request for a team September 13, 2026 13:22
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.

CLI: Delete acts as Backspace and End is unsupported; editing keys cannot be configured

1 participant