Skip to content

feat: add keep_terminal_focus option for diff views #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ThomasK33
Copy link
Member

Add keep_terminal_focus option for diffs

Added a new configuration option keep_terminal_focus that allows users to maintain focus in the Claude Code terminal when a diff opens. This is particularly useful for users who frequently use terminal keybindings like <CR> to accept/reject diffs without accidentally triggering unintended actions in the diff buffer.

The feature:

  • Adds a new boolean option keep_terminal_focus (default: false) to diff_opts
  • Finds the Claude Code terminal window after opening a diff
  • Returns focus to the terminal window when the option is enabled
  • Includes documentation in README and CLAUDE.md
  • Adds unit tests to verify configuration validation

Example usage:

require("claudecode").setup({
  diff_opts = {
    keep_terminal_focus = true,  -- Keeps focus in terminal after diff opens
  },
})

Change-Id: I196b3e69832c55aa56ab07b185cd643b3937b8a8
Signed-off-by: Thomas Kosiewski <tk@coder.com>
Copy link
Member Author

ThomasK33 commented Jul 30, 2025

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.

1 participant