Merged
Conversation
202f0d2 to
b17147c
Compare
ravicious
reviewed
Sep 2, 2025
Member
ravicious
left a comment
There was a problem hiding this comment.
Reviewed until "Notify UI when window visibility changes", so far I only looked at the code.
ravicious
reviewed
Sep 3, 2025
Member
ravicious
left a comment
There was a problem hiding this comment.
The code looks fine, I just need to test how this works on Windows and Linux too.
ravicious
reviewed
Sep 4, 2025
ravicious
reviewed
Sep 5, 2025
ravicious
reviewed
Sep 5, 2025
ravicious
reviewed
Sep 5, 2025
ravicious
reviewed
Sep 5, 2025
ravicious
reviewed
Sep 5, 2025
ravicious
approved these changes
Sep 5, 2025
Contributor
gzdunek
added a commit
that referenced
this pull request
Sep 9, 2025
* Add tray icons for Mac and Linux * Fix resources path * Add config option * Set tray when the app launches * Integrate app with tray * Notify UI when window visibility changes * Terminate foreground sessions when window is hidden * Open dialogs first before showing window * Improve docs * Rely on `window.isVisible()` to tell if window is hidden or not * Change `WindowsManagerIpc.WindowVisibility` to `RendererIpc.WindowVisibility` * Rename "window visibility" to "background mode" * Revert "Open dialogs first before showing window" This reverts commit b17147c. * Simplify mounting/unmounting documents * Use different GUIDs for packaged and dev app * Make sure window is not destroyed before using it * Renames * Improve dialog message * Add `isDestroyed` to window mock * Fix comment * `database` -> `databases` * Improve readability (cherry picked from commit 6cef4f3)
gzdunek
added a commit
that referenced
this pull request
Sep 9, 2025
* Add tray icons for Mac and Linux * Fix resources path * Add config option * Set tray when the app launches * Integrate app with tray * Notify UI when window visibility changes * Terminate foreground sessions when window is hidden * Open dialogs first before showing window * Improve docs * Rely on `window.isVisible()` to tell if window is hidden or not * Change `WindowsManagerIpc.WindowVisibility` to `RendererIpc.WindowVisibility` * Rename "window visibility" to "background mode" * Revert "Open dialogs first before showing window" This reverts commit b17147c. * Simplify mounting/unmounting documents * Use different GUIDs for packaged and dev app * Make sure window is not destroyed before using it * Renames * Improve dialog message * Add `isDestroyed` to window mock * Fix comment * `database` -> `databases` * Improve readability (cherry picked from commit 6cef4f3)
This was referenced Sep 9, 2025
github-merge-queue bot
pushed a commit
that referenced
this pull request
Sep 10, 2025
* Allow Connect to run in background (#58575) * Add tray icons for Mac and Linux * Fix resources path * Add config option * Set tray when the app launches * Integrate app with tray * Notify UI when window visibility changes * Terminate foreground sessions when window is hidden * Open dialogs first before showing window * Improve docs * Rely on `window.isVisible()` to tell if window is hidden or not * Change `WindowsManagerIpc.WindowVisibility` to `RendererIpc.WindowVisibility` * Rename "window visibility" to "background mode" * Revert "Open dialogs first before showing window" This reverts commit b17147c. * Simplify mounting/unmounting documents * Use different GUIDs for packaged and dev app * Make sure window is not destroyed before using it * Renames * Improve dialog message * Add `isDestroyed` to window mock * Fix comment * `database` -> `databases` * Improve readability (cherry picked from commit 6cef4f3) * Dialog improvements from #58858
github-merge-queue bot
pushed a commit
that referenced
this pull request
Sep 10, 2025
* Allow Connect to run in background (#58575) * Add tray icons for Mac and Linux * Fix resources path * Add config option * Set tray when the app launches * Integrate app with tray * Notify UI when window visibility changes * Terminate foreground sessions when window is hidden * Open dialogs first before showing window * Improve docs * Rely on `window.isVisible()` to tell if window is hidden or not * Change `WindowsManagerIpc.WindowVisibility` to `RendererIpc.WindowVisibility` * Rename "window visibility" to "background mode" * Revert "Open dialogs first before showing window" This reverts commit b17147c. * Simplify mounting/unmounting documents * Use different GUIDs for packaged and dev app * Make sure window is not destroyed before using it * Renames * Improve dialog message * Add `isDestroyed` to window mock * Fix comment * `database` -> `databases` * Improve readability (cherry picked from commit 6cef4f3) * Dialog improvements from #58858
mmcallister
pushed a commit
that referenced
this pull request
Sep 22, 2025
* Add tray icons for Mac and Linux * Fix resources path * Add config option * Set tray when the app launches * Integrate app with tray * Notify UI when window visibility changes * Terminate foreground sessions when window is hidden * Open dialogs first before showing window * Improve docs * Rely on `window.isVisible()` to tell if window is hidden or not * Change `WindowsManagerIpc.WindowVisibility` to `RendererIpc.WindowVisibility` * Rename "window visibility" to "background mode" * Revert "Open dialogs first before showing window" This reverts commit b17147c. * Simplify mounting/unmounting documents * Use different GUIDs for packaged and dev app * Make sure window is not destroyed before using it * Renames * Improve dialog message * Add `isDestroyed` to window mock * Fix comment * `database` -> `databases` * Improve readability
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.
Closes #54275
Connect will now run in the background, in a system tray:

When the app window is closed, we terminate all active foreground sessions (SSH, local terminal, Windows desktop).
To implement this, the UI listens to window visibility events emitted by the main process. When the window is hidden, the UI unmounts active documents; when it becomes visible again, the documents are remounted.
This required addressing a few edge cases:
Our documents automatically reconnect when mounted. This led to multiple per-session MFA prompts being triggered in a row,
which caused them to fail (there is a mutex in the daemon, but maybe YubiKey needs some delay between prompts?). The same issue also appeared when reopening a previous session. To fix this, documents now only mount when they are visible. This should also improve UX, being hit by multiple dialogs when launching the app feels annoying.EDIT: Only
DocumentTerminalandDocumentDesktopSessiondocuments will mount when visible.When the app receives a tshd event, it makes the window visible and usually shows a dialog. That dialog conflicted with an MFA dialog triggered by document activation. As a workaround, certain documents are now only activated when no dialogs are visible. Additionally, the order of tshd event handling was updated: we now open the dialog first and then focus (and show) the window.
Best to review commit by commit.
changelog: Teleport Connect now runs in the background by default on macOS and Windows. On Linux, this behavior can be enabled in the app configuration
TODO: add docs