Skip to content

alacritty terminal adapter - #53

Open
mduvarci12 wants to merge 1 commit into
unclebob:mainfrom
mduvarci12:alacritty-adapter
Open

alacritty terminal adapter#53
mduvarci12 wants to merge 1 commit into
unclebob:mainfrom
mduvarci12:alacritty-adapter

Conversation

@mduvarci12

Copy link
Copy Markdown

Summary

Adds a new terminal backend for Alacritty, following the
launch-only adapter contract already used by windows-terminal.sh.

Alacritty has no AppleScript dictionary and no built-in way to return a stable,
queryable window/tab id, so this adapter can open a terminal surface per
role but cannot reliably track or reopen it afterward. Concretely:

  • terminal_backend_can_open_sessionsreturn 0 (it can open sessions)
  • terminal_backend_tracks_windowsreturn 1 (no stable id to track)

This means SwarmForge opens one Alacritty window per configured role and skips
the watchdog for those windows, exactly like the existing Windows Terminal
adapter. Closing the first (cleanup) window still works normally, since that
path doesn't depend on window tracking.

Usage

SWARMFORGE_TERMINAL=alacritty ./swarm

What's implemented

  • terminal_backend_label — returns "Alacritty"
  • terminal_backend_can_open_sessionsreturn 0
  • terminal_backend_tracks_windowsreturn 1 (launch-only)
  • terminal_open_session — opens a new Alacritty window via open -na Alacritty
    that attaches directly to the assigned tmux socket/session
  • terminal_window_exists / terminal_close_window — no-ops consistent with
    the launch-only contract (nothing SwarmForge can reliably track or close)

Testing

Tested manually on macOS (Sonoma) with Alacritty installed via Homebrew:

  • SWARMFORGE_TERMINAL=alacritty ./swarm opens one Alacritty window per role
  • Each window correctly attaches to its assigned tmux session
  • Cleanup (closing the first configured window) still tears down the swarm as expected

Limitations / follow-ups

  • No watchdog / auto-reopen if a role's Alacritty window is closed manually,
    same limitation as the Windows Terminal adapter.
  • A future version could attempt id tracking via System Events window
    matching (by title), but this felt more fragile than useful for a first pass —
    happy to discuss if maintainers want that instead.

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.

1 participant