Skip to content

simulate: enable native text selection, remap keys#913

Merged
u9g merged 1 commit into
mainfrom
jason/simulate-native-text-selection
Jul 15, 2026
Merged

simulate: enable native text selection, remap keys#913
u9g merged 1 commit into
mainfrom
jason/simulate-native-text-selection

Conversation

@u9g

@u9g u9g commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

What

The simulate TUI captured the mouse (tea.WithMouseCellMotion()), which blocked the terminal's native drag-to-select. This drops mouse capture so text selection/copy works, and remaps the keys to compensate for the wheel behavior that changes as a result.

Why the key remap

Without mouse capture, terminals in alt-screen mode translate the scroll wheel into arrow-key presses. Under the old bindings that made the wheel move the list cursor instead of scrolling. The remap makes that behavior useful:

Key Action
i / k Navigate the simulation list (fall back to scrolling a detail pane when one is open)
l / Enter Open the selected simulation's detail
j / Esc Back out
/ Scroll one line — focused pane if any, else the whole page (so the mouse wheel scrolls again)
PgUp / PgDn Page-sized scroll
q Quit

/ are unbound in the main view (kept in the quit/save dialogs). The bottom hint bar is updated to match.

Test

  • go build ./..., go vet ./cmd/lk/, go test ./cmd/lk/ all pass
  • Manually: drag-to-select works, wheel scrolls the page, i/j/k/l navigate, PgUp/PgDn page through logs

Removing mouse capture lets the terminal handle drag-to-select. In
alt-screen the wheel then maps to arrow keys, so remap controls to match:
arrows scroll (wheel included), i/j/k/l navigate the list, PgUp/PgDn page.
@u9g u9g merged commit b3aa324 into main Jul 15, 2026
22 checks passed
@u9g u9g deleted the jason/simulate-native-text-selection branch July 15, 2026 20:23
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.

2 participants