Detect terminal windows by client process, not app-id - #6447
Open
husamemadH wants to merge 1 commit into
Open
Conversation
Omarchy launches its own TUIs through xdg-terminal-exec with app-ids such as org.omarchy.btop, org.omarchy.terminal and TUI.float, so they never match the terminal class list even though the client is a terminal. Universal copy then sent CTRL+C instead of CTRL+Insert, and the TUI took it as SIGINT and closed. Keep the class check and fall back to the client process name, which identifies the terminal regardless of the app-id it was given.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Omarchy’s universal copy/paste detection for TUIs launched via xdg-terminal-exec with non-terminal app-ids (e.g., org.omarchy.*, TUI.float) by falling back to the focused client’s process name (/proc/<pid>/comm) when the window class does not match known terminal classes.
Changes:
- Add a terminal-process allowlist (e.g.,
foot,wezterm-gui) for identifying terminal clients regardless of app-id/class. - Read
/proc/<pid>/commfor the active window and use it as a fallback signal for “is terminal”. - Adjust
active_window_is_terminal()to prefer the existing class-based detection, then fall back to process-based detection.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
Universal copy/paste picks the terminal chord by matching the focused window's class against a fixed list. Omarchy launches its own TUIs through
xdg-terminal-execwith app-ids such asorg.omarchy.btop,org.omarchy.terminalandTUI.float, so those windows never match even though the client is a terminal.SUPER + Cthen sendsCTRL+C, the TUI takes it as SIGINT, and the window closes instead of copying.Keep the class check and fall back to the client process name from
/proc/<pid>/comm, which identifies the terminal regardless of the app-id it was given.Motivation
Fixes #6379.
Affects Activity (
SUPER + CTRL + T), Docker, Music TUI, About, the 122 menu entries that run throughomarchy-launch-floating-terminal-with-presentation— every Install, Remove and update screen — and TUI apps installed via Install ▸ TUI app, which carryTUI.float/TUI.tile.