Skip to content

[BUG] opt+backspace (alt+backspace) no longer deletes the previous word in chat input #689

Closed

Description

@edenreich

Summary

In the chat TUI input, opt+backspace (macOS) / alt+backspace no longer deletes the previous word. Only ctrl+w still does word-wise delete.

Root cause from the code: the chat input is a custom InputView (internal/ui/components/input_view.go), not a native bubbles textarea, so its editing is driven by the keybinding registry rather than the component's built-in keymap. The delete-word action is bound to ctrl+w only:

internal/ui/keybinding/actions.go:344-348
  ID:      delete_word_backward
  Keys:    []string{"ctrl+w"}
  Handler: handleDeleteWordBackward

alt+backspace is present in the known-keys list (internal/ui/keys/keys.go:48) but is not mapped to delete_word_backward (or any delete-word action), so opt+backspace reaches the input with no word-delete binding and is effectively a no-op.

This appears to be a regression from the Charm UI v2 migration (#576): the previous bubbles textarea bound DeleteWordBackward to both alt+backspace and ctrl+w in its DefaultKeyMap, while the replacement custom input carried over only ctrl+w.

Steps to Reproduce

  1. Run infer chat.
  2. Type a few words in the input, e.g. hello world foo.
  3. Press opt+backspace (macOS) / alt+backspace.

Expected Behavior

The previous word is deleted, same as ctrl+w (standard macOS / readline convention): hello world foo -> hello world .

Actual Behavior

opt+backspace does not delete a word; the input is unchanged (no word-wise deletion). Only ctrl+w deletes a word.


Suggested fix: add alt+backspace (and likely ctrl+backspace) to the delete_word_backward action's Keys in internal/ui/keybinding/actions.go. Confirm the key encoding path (internal/ui/components/key_encode.go, internal/ui/keys/keys.go) delivers alt+backspace for opt+backspace; some macOS terminals send a different sequence unless "Use Option as Meta key" is enabled, so this may also warrant a docs note.

Environment: macOS (Darwin), infer chat TUI.

Activity

  1. added
    bug
    on Jun 30, 2026
  2. added theissue type on Jun 30, 2026
  3. moved this to Todo in 2026on Jun 30, 2026
  4. moved this from Todo to Done in 2026on Jun 30, 2026
  5. inference-gateway-releaser commented on Jun 30, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.126.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

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

    bugreleased

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions