Skip to content

boxen REPL: mousewheel = history, option-arrows insert b/f literals #805

Description

@jsavin

Problem

Two input-handling regressions in the boxen REPL:

3a) Mousewheel navigates history instead of scrolling output pane

Mousewheel up/down events are mapped to history-prev/history-next (same as up/down arrows) instead of scrolling the output pane.

3b) Option-Left / Option-Right insert literal b / f

macOS Terminal sends ESC b (option-left) and ESC f (option-right) for word-jump. The boxen input line is consuming the ESC and then inserting the following byte (b or f) as a literal character instead of decoding the sequence as a word-jump command.

Repro

Mousewheel:

  1. frontier-cli
  2. Issue any command that produces a few lines of output
  3. Scroll mousewheel up
  4. Observe: history navigates instead of pane scrolling

Option-arrows:

  1. frontier-cli in macOS Terminal.app (or iTerm2 with default "Option as Meta = Esc+" setting)
  2. Type some text on the input line
  3. Press Option-Left
  4. Observe: b inserted at cursor (should jump cursor one word left)
  5. Press Option-Right
  6. Observe: f inserted at cursor (should jump cursor one word right)

Expected

  • Mousewheel: scrolls output pane (up = older content, down = newer). History should remain bound to up/down arrows only.
  • Option-Left/Right: jumps cursor by one word in the input line, same as readline/bash convention.

Context

Discovered during C.6 soak after flipping default REPL from linenoise to boxen (PR #802). Linenoise handled both correctly (option-arrows via its built-in word-motion bindings; mousewheel naturally passed through to the terminal since linenoise didn't capture mouse events).

Grouping these two as one issue / one fix since both live in the boxen input-line key/event decoder.

Severity

P1 each — both are muscle-memory regressions for terminal users. Workaround: --plain falls back to linenoise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions