feat(linux): precise terminal focus via WINDOWID + custom terminal support#177
Merged
vakovalskii merged 1 commit intovakovalskii:mainfrom Apr 16, 2026
Conversation
…nal support - Read WINDOWID from /proc/<pid>/environ for accurate window matching instead of matching first window by terminal server PID - Add kitty remote control support for tab-level focus - Support arbitrary terminal binary path in settings (text input with datalist suggestions instead of hardcoded dropdown) - Auto-detect system default terminal via x-terminal-emulator symlink - Handle gnome-terminal (--) and wezterm (start --) special flags, generic -e for all other terminals - Add wmctrl hex conversion and xdotool decimal fallbacks
This was referenced Apr 16, 2026
vakovalskii
added a commit
that referenced
this pull request
Apr 16, 2026
Merged PRs: - #169 (@buriy): Running card titles white for visibility - #170 (@buriy): Makefile for easy service management - #177 (@tearfu1): Linux precise terminal focus via WINDOWID - #172 (@vbp1): WSL browser UI (launch, focus, IDE) - #150 (@dum3r): WSL agent homes discovery on Windows - #165 (@tpitsunov): Kilo CLI agent support (SQLite backend) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
vakovalskii
added a commit
that referenced
this pull request
Apr 16, 2026
Merged PRs: - #169 (@buriy): Running card titles white for visibility - #170 (@buriy): Makefile for easy service management - #177 (@tearfu1): Linux precise terminal focus via WINDOWID - #172 (@vbp1): WSL browser UI (launch, focus, IDE) - #150 (@dum3r): WSL agent homes discovery on Windows - #165 (@tpitsunov): Kilo CLI agent support (SQLite backend) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
WINDOWIDfrom/proc/<pid>/environinstead of matching by terminal server PID. This fixes the issue where Focus Terminal would activate the wrong window/tab when multiple terminal windows are open.kitty @ focus-window --match pid:<pid>for kitty users.ghostty,/usr/bin/alacritty).x-terminal-emulatorsymlink target on Debian/Ubuntu.gnome-terminalgets--,weztermgetsstart --, everything else gets generic-e.What was broken
focusTerminalByPid()on Linux walked the parent chain to find the terminal server PID, then matched it againstwmctrl -l -p. Since terminal servers (e.g.gnome-terminal-server) own ALL windows with a single PID, it always focused the first window — not the one with the active session.gnome-terminal.How it works now
Focus (WINDOWID approach)
Custom terminal
Settings now shows a text input with autocomplete suggestions from detected binaries. The value is sent as-is to the server, which determines launch flags by
path.basename().Test plan