Skip to content

fix: tighten Linux terminal focus detection#491

Merged
garysheng merged 1 commit into
PeonPing:mainfrom
pandego:fix/472-zellij-alacritty-focus
Apr 25, 2026
Merged

fix: tighten Linux terminal focus detection#491
garysheng merged 1 commit into
PeonPing:mainfrom
pandego:fix/472-zellij-alacritty-focus

Conversation

@pandego
Copy link
Copy Markdown
Contributor

@pandego pandego commented Apr 24, 2026

Fixes #472

Summary

  • check the active X11 window class as well as the title when deciding whether the terminal is focused
  • use stable class-name matches for terminals like Alacritty so zellij-renamed titles still count as focused
  • stop treating generic titles like start as a match for the st terminal by restricting that fallback to class-name detection

Validation

  • bash -n peon.sh
  • bash -n tests/setup.bash
  • direct function-level check of terminal_is_focused() on Linux/X11:
    • returns focused for zellij: dev with window class Alacritty
    • returns not focused for window title start with window class firefox

Notes

  • I added focused BATS coverage for the two Linux regressions, but this host does not currently have bats installed to execute the suite locally.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 24, 2026

@pandego is attempting to deploy a commit to the Gary Sheng's projects Team on Vercel.

A member of the Team first needs to authorize it.

@garysheng garysheng force-pushed the fix/472-zellij-alacritty-focus branch from a3e2ab0 to 921a069 Compare April 25, 2026 15:47
@garysheng garysheng merged commit 2fc3bd7 into PeonPing:main Apr 25, 2026
2 of 3 checks passed
garysheng added a commit that referenced this pull request Apr 25, 2026
- feat(nix): add programs.peon-ping.claudeCodeIntegration option (#480, closes #368)
- fix: tighten Linux focus detection for zellij/Alacritty and avoid st false-match (#491, closes #472)
- fix(pack-download): treat empty source_path as repo-root (#490, closes #343)
- fix: preserve sibling custom hooks on install/uninstall (#485, closes #484)
- fix(peon.sh): guard save_sound_pid against unset $! in PEON_TEST sync paths
- tests(windows): recalibrate Pester expectations for ide_rules runtime (#479, closes #478)
- docs: sync zh/ja READMEs with the new claudeCodeIntegration nix option
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.

terminal_is_focused doesn't work with zellij and alacritty

2 participants