an experimental, infinite-canvas terminal multiplexer using gpui forked from oppi.li/tarp
Files
readme.md

tarp #

tarp is an infinite-canvas, cross-machine terminal multiplexer built using GPUI, libghostty-vt and iroh.

tarp daemon works on darwin and gnu/linux. tarp GUI has only been tested on darwin, the application definitely runs on wayland, but is not tested thoroughly.

in more detail:

  • tarpd is a daemon service that runs PTYs
  • tarp GUI is a desktop application that can connect to one or more daemons using iroh for transport
  • tarp GUI can arrange terminals on an infinite canvas
  • tarp GUI can detach from a daemon and reconnect, without losing any sessions or window positions
  • tarp CLI can send lua statements to control a daemon

install #

the flake provides nixos systemd modules, launchd module (for darwin) and a home-manager module:

# works on both darwin and linux
services.tarpd {
    enable = true;
    user = "yourself";
    client.ui.enable = true; # enables the GUI
};

usage #

the main way to use tarp is to run a daemon, and run the GUI client to connect to the daemon, daemons can run on macos and gnu/linux as far as i know:

# the open policy lets in any client that knows the daemon's id,
# in practice, you want to be stricter with --policy paired
$ nix run git+https://tangled.org/oppi.li/tarp#tarp -- daemon --policy open

if you want to connect to this daemon from the same machine:

$ nix run git+https://tangled.org/oppi.li/tarp#tarp-ui

to connect from elsewhere:

# daemon prints its id, grab that
INFO tarpd: listening id=988...967 policy=open identity=ephemeral

# clients can connect with the `host` flag:
$ tarp --host 988...967

to connect to a host each time the GUI starts without --host, set autoconnect in ~/.config/tarp/config.toml. a host that cannot be reached stays in the host menu:

[[hosts]]
name = "server"
id = "988...967"
autoconnect = true

you can also speak to daemons via the CLI:

$ tarp -- terminal.spawn command='["yes"]'
{ "id": "some-uuid" }

$ tarp -- terminal.capture terminal="some-uuid"
y
y
y
y
...

$ tarp -- terminal.kill terminal="some-uuid"

GUI usage #

mod is cmd on macos. on gnu/linux, mod is ctrl for keyboard shortcuts and super for pointer gestures, and opt is alt.

  • mod-n: new terminal
  • two finger scroll: pan
  • mod-scroll: pan
  • click and drag canvas: pan
  • pinch: zoom
  • mod-left/right/up/down: move focus to next terminal
  • mod-shift-left/right/up/down: bring adjacent terminal into view
  • mod-o: zoom to fit all terminals
  • mod-f: zoom to fit focused terminal
  • mod-escape: remove the focus from the terminal
  • mod-s: draw a new terminal
  • mod-q: quit
  • click a terminal: focus
  • mod-drag a terminal: move the terminal
  • hover over a terminal holding mod-opt: same, with no mouse button
  • mod-right-drag a terminal: change the size of the terminal from the corner
  • hover over a terminal holding mod-opt-shift: same, with no mouse button
  • opt-drag the edge or corner of a terminal: change the size around its center
  • right-click the canvas: open the host menu

on macos, tarp can also open a new terminal from any app and switch to the space of its window. set this in ~/.config/tarp/config.toml and restart tarp:

[canvas]
new_terminal_shortcut = "cmd+ctrl+t"

the modifiers of the hover, right-drag and opt-drag gestures can be changed in the same file; mod-drag to move is fixed. join cmd, opt, ctrl and shift with +, or use none to turn a gesture off. cmd is super on gnu/linux. when two hover gestures match, the one with more modifiers wins, and resize wins a tie:

[canvas]
move_hover_modifiers = "cmd+opt"
resize_button_modifiers = "cmd"
resize_hover_modifiers = "cmd+opt+shift"
resize_center_modifiers = "opt"

opt is alt for terminal programs by default. on a keyboard layout that types with opt, such as eurkey, let it compose characters instead:

[terminal]
macos_option_as_alt = false

on macos, the titlebar can be made transparent and the window buttons hidden. restart tarp to apply this:

[canvas]
macos_transparent_titlebar = true
macos_window_buttons = "hidden"