Skip to content

Detect terminal windows by client process, not app-id - #6447

Open
husamemadH wants to merge 1 commit into
basecamp:quattrofrom
husamemadH:fix-clipboard-tui-app-ids
Open

Detect terminal windows by client process, not app-id#6447
husamemadH wants to merge 1 commit into
basecamp:quattrofrom
husamemadH:fix-clipboard-tui-app-ids

Conversation

@husamemadH

Copy link
Copy Markdown
Contributor

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-exec with app-ids such as org.omarchy.btop, org.omarchy.terminal and TUI.float, so those windows never match even though the client is a terminal. SUPER + C then sends CTRL+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 through omarchy-launch-floating-terminal-with-presentation — every Install, Remove and update screen — and TUI apps installed via Install ▸ TUI app, which carry TUI.float / TUI.tile.

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.
Copilot AI review requested due to automatic review settings July 30, 2026 18:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>/comm for 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.

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.

SUPER + C closes floating TUI windows instead of copying (org.omarchy.* app-ids miss terminal detection)

2 participants