Skip to content

feat: add focusOnOpen option to Terminal#149

Open
sauyon wants to merge 1 commit into
coder:mainfrom
sauyon:feat/focus-on-open
Open

feat: add focusOnOpen option to Terminal#149
sauyon wants to merge 1 commit into
coder:mainfrom
sauyon:feat/focus-on-open

Conversation

@sauyon
Copy link
Copy Markdown

@sauyon sauyon commented Apr 1, 2026

Add a focusOnOpen boolean option (default: true) that controls whether the terminal automatically focuses itself when open() is called. Setting it to false lets embedders open a terminal in the background without stealing keyboard focus from another element.

resolves #100

Add a `focusOnOpen` boolean option (default: `true`) that controls
whether the terminal automatically focuses itself when `open()` is
called.  Setting it to `false` lets embedders open a terminal in
the background without stealing keyboard focus from another element.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
diegosouzapw added a commit to diegosouzapw/ghostty-web that referenced this pull request May 23, 2026
Add a focusOnOpen boolean option (default: true) that controls whether
the terminal automatically focuses itself when open() is called.
Setting it to false lets embedders open a terminal in the background
without stealing keyboard focus from another element.

Resolves coder#100.


Inspired-by: coder#149

Co-authored-by: Sauyon Lee <git@sjle.co>
@diegosouzapw
Copy link
Copy Markdown

Hi @sauyon! 👋

Your work on this PR inspired a commit in my fork diegosouzapw/ghostty-web.
I ported the focusOnOpen option and added you as co-author in the corresponding commit — thank you for the contribution!

I'm working on OmniRoute, a project that provides free access to LLM models, and I'm planning to use ghostty-web as the terminal component there. Your work is part of what makes that possible. 🙏

Feel free to check it out — contributions and feedback are very welcome!

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.

Bug: New terminal instances steal away focus

2 participants