rex-linux
A native Linux client for Superlogical Rex,
written in Rust with GPUI for the window and
libghostty for terminal emulation.
Rex servers already run on Linux; this is the missing desktop client. Like Rex
for Mac, it treats this machine's server as home: sessions opened here live on
that server, so the CLI, agents, and your other devices (over the server's
built-in Tailscale) see the same sessions. It speaks the server's public API
(revision 15, served at /llms.txt by every server):
- a JSON control WebSocket (
rex.control.v1) for sessions, windows, layout,
focus, keys, ownership, and events;
- one binary data WebSocket (
rex.data.terminal.v1) per visible terminal,
which starts with a Ghostty snapshot and continues with raw PTY output.
Each visible terminal is a local libghostty replica restored from that snapshot,
so scrollback, selection, and rendering happen on the client while the server
stays the source of truth.
Features
- Rex for Mac's layout: tabs above the panes with a session picker, or a
sidebar of hosts, sessions, and tabs (Settings > Interface > Toolbar layout,
saved in
$XDG_CONFIG_HOME/rex-linux/settings.json)
- Sessions from every host at once, kept current over a connection to each
host; a session on another host opens by switching to that host
- Pane cards with headers naming the program and its directory, which glide
to their new places as splits open, close, and zoom (Settings > Interface >
Animation style: Snappy, Natural, or Off)
- Drag the border between two panes to resize them
- A command palette (Ctrl+Shift+P, or the ⌘ toolbar button) that searches
this client's actions, the actions your
init.lua defines and blocks
offer, the current session's tabs, and every host's sessions, with recent
actions first
- Right-click menus for panes (copy, paste, split, zoom, float, clear, reset,
close), tabs (new, rename, close, close others), and sessions; Shift+F10
opens the pane menu from the keyboard, and Shift+right-click opens it over
programs that use the mouse
- Window tabs and split layouts exactly as the server lays them out, including
zoom and floating layers
- Keys go through
client.key, so Lua bindings in ~/.config/rex/init.lua see them first
- Client actions are declared to the server with
client.keymap, so the config file
can rebind or remove them and bind keys to its own Lua actions
- Resize ownership: the client takes the blocks it shows when its window is
activated or typed into, and asks for grids that fit each pane
- Mouse reporting, wheel scrolling (local scrollback, alternate-scroll, or
reported to the program), selection with copy to the clipboard and primary
selection, middle-click paste, bracketed paste via the server
- Program status (OSC 7501): coding agents, builds, and other programs that
report what they're doing show it on tabs, sidebar rows, pane headers, and
the picker, and a notification says when one out of sight needs you, fails,
or finishes (Settings > Program Activity)
- Nightly builds that install themselves in the background and take effect
on a restart back into the same session (Settings > Updates)
- OSC 52 clipboard writes, bells, titles, desktop notifications (
notify-send)
- Remote hosts from the home server's host list, shared with every device that
uses it as home, reached over HTTPS (tailnet addresses), plain HTTP, or Unix
sockets; add, remove, and switch between them from the sidebar or Settings
- A Settings window with the home server's built-in Tailscale device, as Rex for Mac
has: serve over Tailscale, sign in (the link opens in your browser and a
notification announces it), limit access to your account, hostname, sign
out, and a copyable remote address
- Remote control: other clients can run this app's actions, such as
rex -C nostromo do pane.split.right
- Survives server restarts and network drops: the control connection reconnects
with its reconnect token, and data streams resume from the exact byte count
Installing
Nix. The flake builds the app with its launcher entry and icons:
nix profile install github:willothy/rex-linux
nix run github:willothy/rex-linux -- --session work
On NixOS or Home Manager, add the flake as an input and its overlay, then
install pkgs.rex-linux:
nixpkgs.overlays = [ inputs.rex-linux.overlays.default ];
environment.systemPackages = [ pkgs.rex-linux ]; # or home.packages
Nix installs leave updates to Nix (nix profile upgrade, nix flake update).
Other distributions. Download the nightly tarball for your architecture
from the nightly release
and run its installer:
tar xzf rex-linux-x86_64-linux.tar.gz
rex-linux/install.sh # rex-linux/install.sh --uninstall removes it
It installs into ~/.local/share/rex-linux, links ~/.local/bin/rex-linux,
and adds Rex to your launcher. From then on Rex checks the nightly release
every few hours, installs new builds next to the running one (keeping the
previous build), and offers Restart to Update in Settings > Updates, as Rex for
Mac does. rex-linux --version names the build.
The nightly release is built by .github/workflows/nightly.yml each night
that main has changed, with scripts/package.sh.
Building
libghostty is built from source with Zig 0.17. On NixOS:
nix develop
cargo build --release
Elsewhere you need Rust 1.96+, Zig 0.17 on PATH, and the usual GPUI
dependencies (Vulkan loader, Wayland and/or X11 libraries, xkbcommon, fontconfig,
freetype).
Running
rex-linux # $REX_SERVER, then the shared server at /run/rex/server.sock, then the per-user server
rex-linux -S https://studio.tail1234.ts.net # a server's built-in Tailscale address
rex-linux -S unix:///run/rex/server.sock # a specific Unix socket
rex-linux -S http://build.local:7297 # a server started with --extra-listen
rex-linux --font "JetBrainsMono Nerd Font Mono" --font-size 13
rex-linux --new-session # start in a new session (the launcher's New Session action)
REX_LINUX_FONT sets the default font family.
Default keys
| Key |
Action |
| Ctrl+Shift+N |
New session |
| Ctrl+Shift+PageUp / PageDown |
Previous / next session |
| Ctrl+Shift+R (or double-click, right-click) |
Rename session |
| Ctrl+Shift+T |
New window |
| Ctrl+Tab, Ctrl+Shift+] / Ctrl+Shift+Tab, Ctrl+Shift+[ |
Next / previous window |
| Alt+1 … Alt+9 |
Select window |
| Ctrl+Shift+D / Ctrl+Shift+E |
Split right / down |
| Ctrl+Shift+Arrows |
Focus pane in a direction |
| Ctrl+Shift+Z |
Zoom pane |
| Ctrl+Shift+W |
Close pane |
| Ctrl+Shift+C / Ctrl+Shift+V, Shift+Insert |
Copy / paste |
| Shift+PageUp / PageDown / Home / End |
Scroll |
| Ctrl+= / Ctrl+- / Ctrl+0 |
Font size |
| Ctrl+Shift+S, Ctrl+Shift+B |
Switch between tabs above and the sidebar |
| Ctrl+Shift+K |
Change session (the session picker) |
| Shift+F10 |
Pane menu |
| Ctrl+Shift+P |
Command palette |
| Ctrl+, |
Settings |
| Ctrl+Shift+H |
Switch host |
Actions use Rex for Mac's names (pane.split.right, client.tab.new,
session.next, …), so bindings in the server's init.lua apply to both apps;
rex keymap shows what the server resolves.
Layout
| Crate |
Purpose |
rex-client |
Endpoints, the control connection, data streams with resume, and the API types |
rex-terminal |
libghostty replicas: snapshot restore, Rex stream messages, frames, selection, mouse encoding |
rex-app |
The GPUI application (rex-linux binary) |
cargo run -p rex-client --example probe opens a scratch session on a server and
records its terminal stream; cargo run -p rex-terminal --example replay replays a
recording through a replica.
Not yet supported
ssh:// hosts; HTTPS, plain HTTP, and Unix sockets work
- Pairing devices with a QR code
- Key sequences and modes from the config file; single-key bindings work
- Dragging pane borders and floating layers (they render and follow the server)
- Kitty graphics images
- Wide characters are drawn one cell wide by the text shaper