Skip to content

Bind carriage return alongside enter on the TUI board - #1002

Open
bjohas wants to merge 1 commit into
MrLesk:mainfrom
bjohas:pr/enter-key
Open

Bind carriage return alongside enter on the TUI board#1002
bjohas wants to merge 1 commit into
MrLesk:mainfrom
bjohas:pr/enter-key

Conversation

@bjohas

@bjohas bjohas commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #1003

The board registers its Enter handler as screen.key(["enter"], ...) (src/ui/board.ts). In the vendored blessed fork (neo-neo-bblessed/lib/keys.ts), a carriage return is named return and only a linefeed is named enter:

if (s === '\r') {
  // carriage return
  key.name = 'return';
} else if (s === '\n') {
  // enter, should have been called linefeed
  key.name = 'enter';
}

Terminals that send CR for the Enter key — kitty on Linux among them — therefore reach no handler at all.

That handler does double duty: in move mode it confirms a pending move, and outside move mode it opens the task popup. On an affected terminal both silently do nothing.

The move case is especially opaque because performTaskMove swallows every error unless DEBUG is set, so a move that never fired is indistinguishable from one that failed. m still works as a confirm key, which makes the Enter path look selectively broken rather than unbound.

Fix

Bind both names. Added as an exported BOARD_ENTER_KEYS constant so it can be asserted in a test — the board needs a tty to instantiate, and the file already exports hasMoveBlockingBoardFilters / shouldRebuildColumns for the same reason.

screen.key(["enter"]) is the only such registration under src/ui/, and nothing registers "return" anywhere, so this is a single-site change.

Verification

  • Reproduced and confirmed fixed on kitty / Ubuntu: Enter now both opens the task popup and confirms a pending move.
  • bunx tsc --noEmit clean
  • biome check clean on both files
  • bun test src/test/board-ui.test.ts — 8 pass / 0 fail

blessed names a carriage return "return" and only a linefeed "enter", so screen.key(["enter"]) never fires on terminals that send CR. The handler both confirms a pending move and opens the task popup, so both silently do nothing.
bjohas added a commit to bjohas/Backlog.md that referenced this pull request Sep 3, 2026
Also drops the stale 'three branches based on 9a42e89' claim; upstream has moved on and the branch count has changed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
bjohas added a commit to bjohas/Backlog.md that referenced this pull request Sep 3, 2026
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

TUI board: Enter does nothing on terminals that send carriage return

1 participant