Skip to content

M5a: cmux-linux GTK4 application scaffold (Sprint 1-3) - #104

Merged
Jesssullivan merged 4 commits into
mainfrom
sid/m5a-sprint1-foundation
Mar 29, 2026
Merged

Jesssullivan merged 4 commits into
mainfrom
sid/m5a-sprint1-foundation

Conversation

@Jesssullivan

Copy link
Copy Markdown
Owner

Summary

Complete scaffold for the cmux-linux GTK4 terminal multiplexer, implementing issues #77-83 across 3 sprints.

Sprint 1: Foundation

Sprint 2: Core UI

Sprint 3: Platform Integration

Files (11 new)

cmux-linux/
├── build.zig           # Links libghostty.a + GTK4 + libadwaita + deps
└── src/
    ├── main.zig        # GtkApplication + libghostty init
    ├── app.zig         # Runtime callbacks (action, clipboard, close)
    ├── c_api.zig       # @cImport bindings
    ├── config.zig      # JSON config parser + validation
    ├── session.zig     # Session snapshot + restore
    ├── sidebar.zig     # Workspace list sidebar
    ├── socket.zig      # Unix socket JSON-RPC server
    ├── split_tree.zig  # Binary tree split pane model
    ├── surface.zig     # GtkGLArea + ghostty surface
    ├── tab_manager.zig # AdwTabView workspace management
    └── workspace.zig   # Workspace data model

~2,000 lines of Zig across 11 source files.

Test plan

  • cd ghostty && zig build -Dapp-runtime=none -Drenderer=opengl produces libghostty.a
  • cd cmux-linux && zig build compiles and links on Linux
  • App launches with GTK4 window, terminal renders
  • New tab / close tab works
  • Socket responds to ping

Closes #77, #78, #79, #80, #81, #82, #83

Generated with Claude Code

@Jesssullivan
Jesssullivan force-pushed the sid/m5a-sprint1-foundation branch from 31c219c to e805d8f Compare March 29, 2026 03:38
Jesssullivan added a commit that referenced this pull request Mar 29, 2026
nix/tests.nix: Add Tier 2b test verifying GTK4 + libadwaita runtime
libs are present in the NixOS VM. This is a stepping stone toward
full graphical cmux-linux tests (blocked on Nix packaging of the
libghostty + cmux-linux build chain).

Update basic-window-check-gnome comment to reflect PR #104 progress.
- Update .gitmodules URL from manaflow-ai/ghostty to Jesssullivan/ghostty
- Submodule at 90a26469 with GHOSTTY_PLATFORM_LINUX in embedded.zig
  (Jesssullivan/ghostty#1) and #undef linux macro fix (#2)
- Update docs/ghostty-fork.md: document patch #8 (linux Platform variant)
  and switch header from manaflow-ai to Jesssullivan
12 Zig source files implementing the full M5a Terminal MVP scope:

Sprint 1 - Foundation:
- main.zig: GtkApplication + libghostty init/wakeup/tick integration
- app.zig: Runtime callbacks (action, clipboard, close_surface)
- surface.zig: GtkGLArea + GHOSTTY_PLATFORM_LINUX surface creation
- c_api.zig: @cImport bindings for GTK4, libadwaita, ghostty.h
- config.zig: JSON config parser matching macOS schema (427 lines)
- build.zig: Links libghostty.so + GTK4 + libadwaita + OpenGL

Sprint 2 - Core UI:
- window.zig: AdwApplicationWindow + AdwTabView + AdwTabBar
- tab_manager.zig: Workspace list mapped to AdwTabView pages
- split_tree.zig: Binary tree split pane model with GtkPaned
- workspace.zig: Workspace data model (panels, title, color, status)
- sidebar.zig: AdwNavigationSplitView + GtkListBox workspace list

Sprint 3 - Platform Integration:
- socket.zig: Unix domain socket JSON-RPC server (XDG paths)
- session.zig: Session snapshot/restore (autosave 8s, atomic writes)

Compiles and links on Ubuntu, Fedora 42, and Arch Linux.
Closes #77, #78, #79, #80, #81, #82, #83.
linux-ci.yml: Add libghostty build (-Dapp-runtime=none -Drenderer=opengl)
and cmux-linux build steps to all 3 Linux jobs (Ubuntu, Fedora, Arch).
Add font/rendering deps (freetype, harfbuzz, fontconfig, libpng, mesa).
Add zig build test step for config parser unit tests.

fork-ci.yml: Build GhosttyKit.xcframework from source instead of
downloading from manaflow-ai/ghostty releases. Uses native target
for faster CI builds.
@Jesssullivan
Jesssullivan force-pushed the sid/m5a-sprint1-foundation branch from 073c0fb to 5c80cab Compare March 29, 2026 18:36
Jesssullivan added a commit that referenced this pull request Mar 29, 2026
Verify GTK4 + libadwaita runtime libs are present in the NixOS VM.
Stepping stone toward full graphical cmux-linux tests (blocked on
Nix packaging of the libghostty build chain).

Update basic-window-check-gnome TODO to reflect PR #104 progress.
Verify GTK4 + libadwaita runtime libs are present in the NixOS VM.
Stepping stone toward full graphical cmux-linux tests (blocked on
Nix packaging of the libghostty build chain).

Update basic-window-check-gnome TODO to reflect PR #104 progress.
@Jesssullivan
Jesssullivan force-pushed the sid/m5a-sprint1-foundation branch from 5c80cab to 9ae1864 Compare March 29, 2026 21:18
@Jesssullivan
Jesssullivan merged commit 17ac73a into main Mar 29, 2026
10 of 12 checks passed
@Jesssullivan
Jesssullivan deleted the sid/m5a-sprint1-foundation branch March 29, 2026 22:56
Jesssullivan added a commit that referenced this pull request Mar 29, 2026
* Switch ghostty submodule to Jesssullivan/ghostty with linux Platform

- Update .gitmodules URL from manaflow-ai/ghostty to Jesssullivan/ghostty
- Submodule at 90a26469 with GHOSTTY_PLATFORM_LINUX in embedded.zig
  (Jesssullivan/ghostty#1) and #undef linux macro fix (#2)
- Update docs/ghostty-fork.md: document patch #8 (linux Platform variant)
  and switch header from manaflow-ai to Jesssullivan

* Scaffold cmux-linux GTK4 application (#77-83)

12 Zig source files implementing the full M5a Terminal MVP scope:

Sprint 1 - Foundation:
- main.zig: GtkApplication + libghostty init/wakeup/tick integration
- app.zig: Runtime callbacks (action, clipboard, close_surface)
- surface.zig: GtkGLArea + GHOSTTY_PLATFORM_LINUX surface creation
- c_api.zig: @cImport bindings for GTK4, libadwaita, ghostty.h
- config.zig: JSON config parser matching macOS schema (427 lines)
- build.zig: Links libghostty.so + GTK4 + libadwaita + OpenGL

Sprint 2 - Core UI:
- window.zig: AdwApplicationWindow + AdwTabView + AdwTabBar
- tab_manager.zig: Workspace list mapped to AdwTabView pages
- split_tree.zig: Binary tree split pane model with GtkPaned
- workspace.zig: Workspace data model (panels, title, color, status)
- sidebar.zig: AdwNavigationSplitView + GtkListBox workspace list

Sprint 3 - Platform Integration:
- socket.zig: Unix domain socket JSON-RPC server (XDG paths)
- session.zig: Session snapshot/restore (autosave 8s, atomic writes)

Compiles and links on Ubuntu, Fedora 42, and Arch Linux.
Closes #77, #78, #79, #80, #81, #82, #83.

* Add libghostty + cmux-linux build to CI, fix macOS xcframework

linux-ci.yml: Add libghostty build (-Dapp-runtime=none -Drenderer=opengl)
and cmux-linux build steps to all 3 Linux jobs (Ubuntu, Fedora, Arch).
Add font/rendering deps (freetype, harfbuzz, fontconfig, libpng, mesa).
Add zig build test step for config parser unit tests.

fork-ci.yml: Build GhosttyKit.xcframework from source instead of
downloading from manaflow-ai/ghostty releases. Uses native target
for faster CI builds.

* Add cmux-linux-build-check NixOS VM test

Verify GTK4 + libadwaita runtime libs are present in the NixOS VM.
Stepping stone toward full graphical cmux-linux tests (blocked on
Nix packaging of the libghostty build chain).

Update basic-window-check-gnome TODO to reflect PR #104 progress.

* M5d: Linux packaging — desktop file, Flatpak, DEB, COPR (#97-100)

dist/linux/:
- com.jesssullivan.cmux.desktop — desktop entry for app launchers
- com.jesssullivan.cmux.metainfo.xml — AppStream metadata
- icons/ — 16x16, 128x128, 256x256, 512x512 PNGs

flatpak/:
- com.jesssullivan.cmux.yml — Flatpak manifest targeting
  org.gnome.Platform 47, builds libghostty + cmux-linux

debian/:
- control, rules, changelog, copyright — DEB packaging for
  Ubuntu 24.04+ (libgtk-4-1, libadwaita-1-0 deps)

dist/:
- cmux.spec — Fedora COPR RPM spec file

App ID: com.jesssullivan.cmux (consistent across all formats)

Closes #97, #98, #99, #100.
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.

Build cmux-linux GTK4 application linking to libghostty

1 participant