terminal: Don't steal focus from an open modal on background terminal startup - #60960
Merged
ChristopherBiscardi merged 1 commit intoJul 20, 2026
Conversation
… startup A center terminal can finish starting after the user has moved on to the command palette or a picker; focusing it blurs the modal and closes it.
This was referenced Jul 31, 2026
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
… startup (zed-industries#60960) the startup terminal can take a sec to come up if your shell is slow. when it's ready it grabs focus, and if you've opened the command palette by then, that blurs the palette input and closes it. so it just vanishes. `add_center_terminal` focused the new terminal unconditionally. now it skips the focus if a modal is open (`!has_active_modal`). one line at the definition, covers all the call sites. kept it terminal-specific like dinocosta framed it. could do a broader workspace-level "don't steal from a modal" instead if you'd prefer. two tests: modal stays focused after a background terminal spawns (fails without the fix), and no-modal still focuses the terminal like before. Fixes zed-industries#60762. Release Notes: - Fixed a background terminal finishing startup closing the command palette or an open picker
playdohface
pushed a commit
to playdohface/zed
that referenced
this pull request
Aug 29, 2026
… startup (zed-industries#60960) the startup terminal can take a sec to come up if your shell is slow. when it's ready it grabs focus, and if you've opened the command palette by then, that blurs the palette input and closes it. so it just vanishes. `add_center_terminal` focused the new terminal unconditionally. now it skips the focus if a modal is open (`!has_active_modal`). one line at the definition, covers all the call sites. kept it terminal-specific like dinocosta framed it. could do a broader workspace-level "don't steal from a modal" instead if you'd prefer. two tests: modal stays focused after a background terminal spawns (fails without the fix), and no-modal still focuses the terminal like before. Fixes zed-industries#60762. Release Notes: - Fixed a background terminal finishing startup closing the command palette or an open picker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the startup terminal can take a sec to come up if your shell is slow. when it's ready it grabs focus, and if you've opened the command palette by then, that blurs the palette input and closes it. so it just vanishes.
add_center_terminalfocused the new terminal unconditionally. now it skips the focus if a modal is open (!has_active_modal). one line at the definition, covers all the call sites.kept it terminal-specific like dinocosta framed it. could do a broader workspace-level "don't steal from a modal" instead if you'd prefer.
two tests: modal stays focused after a background terminal spawns (fails without the fix), and no-modal still focuses the terminal like before.
Fixes #60762.
Release Notes: