Skip to content

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

Description

@Charlweed

Description

The cn prompt editor does not provide the usual Windows text-editing behavior for physical Delete and End, and there is no documented keybinding configuration to make these keys behave as expected.

Physical Delete is handled as backward deletion, exactly like Backspace. End is also unsupported in the inspected input path. This makes editing prompts frustrating.

Key Expected behavior Behavior indicated by inspected source
Delete Delete one character after the cursor Deletes one character before the cursor
Backspace Delete one character before the cursor Deletes backward; this behavior should be preserved
End Move to the end of the current line No End handler in the inspected input path

Relevant environment info

  • OS: Windows 10, build 19045.
  • Interface: Continue CLI (cn); desired behavior is standard editing in conventional terminals.
  • Local source package version: 1.5.46-hy (custom fork).
  • The Delete handler was also checked against upstream main at commit 5522c6f44ca0ac3528b37244818fbfa39b5af470 and contains the same logic.
  • Locally installed input library: Ink 6.2.2.
  • Evidence: source inspection, not an independently performed interactive terminal reproduction. Terminal version and raw key bytes have not been captured.

To reproduce

Suggested manual reproduction:

  1. Start cn in a terminal.
  2. Type abcd.
  3. Press Left twice, placing the cursor at ab|cd (| denotes the cursor).
  4. Press physical Delete.
    • Expected: ab|d.
    • Source-predicted result: a|cd.
  5. Reset to ab|cd and press Backspace.
    • Expected: a|cd; preserve this behavior.
  6. Reset to ab|cd and press End.
    • Expected: abcd|.
    • The inspected path provides no End action.

Source evidence

  • TextBuffer.ts:492–498 routes both key.delete and key.backspace to deleteBackward(). The comment explains that this accommodates Mac Backspace being reported as key.delete, but the condition applies on every platform.
  • TextBuffer.ts:66–76 already has separate backward and forward character deletion methods.
  • TextBuffer.ts:426–449 hard-codes Ctrl+E to moveToEnd(), which moves to the end of the entire input rather than the current line.
  • In locally installed Ink 6.2.2, parse-keypress.js recognizes End sequences, but use-input.js clears their text input and exposes no end flag to Continue. End support therefore needs attention at the input layer as well.
  • The CLI configuration documentation and TUI documentation provide no user-facing way to rebind these editing keys.

Requested behavior

Support physical Delete as forward character deletion, preserve Backspace as backward character deletion, and support End for line-end navigation. If these behaviors are intended to remain selectable, provide and document configurable bindings or a "conventional" editing mode.

Please distinguish physical Delete from the DEL character sent by Backspace in some terminals. Simply changing every key.delete event to forward deletion would regress Backspace for those terminals.

Related issue

#10535 reports Home/End/Ctrl+Arrow problems in the CLI and is currently closed. This report adds the separate physical Delete/Backspace conflation and the Windows editing/configurability use case.

Log output

No runtime logs collected; findings above are based on source inspection.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions