Skip to content

Recognize Ctrl-D as a TUI quit shortcut#447

Merged
wesm merged 3 commits intoroborev-dev:mainfrom
mariusvniekerk:ctrl-d
Mar 6, 2026
Merged

Recognize Ctrl-D as a TUI quit shortcut#447
wesm merged 3 commits intoroborev-dev:mainfrom
mariusvniekerk:ctrl-d

Conversation

@mariusvniekerk
Copy link
Collaborator

Summary

  • treat \ as a top-level EOF-style quit shortcut in the TUI
  • make it quit from any view, including text-entry modals and review screens
  • add tests covering both review and modal paths

Closes #431

@roborev-ci
Copy link

roborev-ci bot commented Mar 6, 2026

roborev: Combined Review (b6692b1)

Verdict: The commit successfully adds a global Ctrl-D quit shortcut, but introduces a risk of dropping in-progress input by bypassing contextual key handling.

Medium

Regression risk (input contexts quit immediately)

  • File: [cmd/roborev/tui/handlers.go:14](/home/roborev/repos/roborev/cmd
    /roborev/tui/handlers.go:14)
  • Description: Ctrl-D is handled before all view-specific/focused-input handlers, so it now force-quits even when an editor/modal is focused. This can bypass contextual key handling and drop in-
    progress input.
  • Suggested fix: Gate quit behavior on focus state (only when no text input/panel is actively editing), or explicitly add a confirmation/dirty-state check before quitting from edit-capable views.

Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

Move Ctrl-D from the top of handleKeyMsg (unconditional quit) into
handleGlobalKey alongside Ctrl-C/q. Modal views with text inputs
(comment, filter, fix prompt, patch save) now handle keys first, so
Ctrl-D is a no-op while editing. From non-input views it behaves like
q: navigates back before quitting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@roborev-ci
Copy link

roborev-ci bot commented Mar 6, 2026

roborev: Combined Review (790afad)

Summary Verdict: High and Medium severity issues found regarding the implementation and scope of the new Ctrl-D shortcut behavior.

High

Unconditional Ctrl-D in handleGlobalKey drops user input

  • Location: cmd/roborev/tui/handlers .go:78
  • Problem: The commit message states "Gate Ctrl-D quit on focus state to avoid dropping input", but the code adds ctrl+d to handleGlobalKey unconditionally. Since handleGlobalKey is shared across views that likely contain input fields (e.
    g., prompt, commit msg), this will cause Ctrl-D to unconditionally trigger an exit/back action and drop user input if an input is focused.
  • Suggested Fix: Add a condition to check if an input field is currently focused before returning m.handleQuitKey() for the
    ctrl+d case.

Medium

Ctrl-D is not handled in several non-input modal views

  • Locations:
    • cmd/roborev/tui/handlers.go:20
    • cmd/roborev/tui /handlers_modal.go:252
    • cmd/roborev/tui/handlers_modal.go:348
    • cmd/roborev/tui/handlers_modal.go:504
  • Problem: handle KeyMsg routes viewLog, viewTasks, viewPatch, etc. to view-specific handlers before handleGlobalKey, and those handlers generally do not include "ctrl+d". Result: Ctrl-D works in queue/review/prompt/commit/help, but is ignored
    in other non-input views where q is meaningful.
  • Suggested Fix: Add "ctrl+d" alongside existing "q"/"esc" behavior in non-input modal handlers (handleLogKey, handleTasksKey, handlePatchKey, and any other intended views), while
    preserving no-op behavior in active text-entry states.

Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

Add ctrl+d alongside existing q/esc quit/back behavior in log,
tasks, patch (non-input mode), worktree confirm, and column
options handlers so the shortcut works consistently across all
non-input views.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@roborev-ci
Copy link

roborev-ci bot commented Mar 6, 2026

roborev: Combined Review (7c64f34)

Summary: All agents agree the code is clean; no medium, high, or critical issues were found.

The changes safely add and test the ctrl+d navigation shortcut across TUI views without introducing any functional regressions or security vulnerabilities.


Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

@wesm wesm merged commit 228b03c into roborev-dev:main Mar 6, 2026
8 checks passed
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.

Recognize Ctrl-D as convenience to quit the TUI

2 participants