Draft
Conversation
Extract macOS-specific code from bot.c into platform_macos.c and add platform_linux.c using X11, XTest, and libpng. - platform.h: common interface for window listing, screenshots, keystroke injection, and window focus - platform_linux.c: uses _NET_CLIENT_LIST for window enumeration, XGetImage for screenshots, XTestFakeKeyEvent for keystrokes, _NET_ACTIVE_WINDOW for window raising - Makefile: auto-detects OS, links correct libraries - bot.c: now platform-independent, calls plat_* functions - README: Linux setup instructions and headless/VM usage guide
Emoji-based navigation keys: - ⬆️⬇️⬅️➡️ for arrow keys (history, cursor movement) - 🔼🔽 for Page Up/Down (scrolling in vim, less, etc.) - Modifiers work with nav keys (e.g. Ctrl+Up)
Navigation keys (arrows, PageUp/PageDown) sent without modifiers were getting an automatic Enter appended because had_mods was only set when mods != 0. Now had_mods is set unconditionally for all navigation keys, matching the behavior of ESC. Restore inline comments that were inadvertently stripped during the platform refactoring. Trim the README Xresources section to avoid bloating it with a full color theme.
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
bot.cintoplatform_macos.cbehind a clean platform abstraction (platform.h)platform_linux.cusing X11, XTest, and libpng for window enumeration, screenshots, keystroke injection, and window focusbot.cis now fully platform-independentLinux backend details
_NET_CLIENT_LIST+WM_CLASSfor terminal detectionXGetImagefrom root window at window coordinates, saved as PNG via libpngXTestFakeKeyEventwith automatic shift detection viaXkbKeycodeToKeysym_NET_ACTIVE_WINDOWEWMH client messageDependencies (Linux)
Test plan