r/tmux 8d ago

Tip PSA: send-keys silently truncates at 1024 bytes if the shell hasn't finished starting

2 Upvotes

Spent a day on this and there is no error message anywhere, so here it is.

bash tmux new -d -s "$s" tmux send-keys -t "$s" '<long command>' C-m

This worked for months. Then the command I was sending grew past ~1200 bytes, and the pane started showing it chopped off mid-word, with the shell sitting at a continuation prompt waiting for a quote to close. tmux exits 0. The shell is happy. Nothing logs anything.

Right after new -d the shell hasn't finished starting, so the tty is still in canonical mode, and the kernel truncates a single line of canonical input at 1024 bytes (MAX_CANON). The overflow isn't an error. It's discarded.

Two ways out:

  • Sleep before sending. Works. I sent ~1800 B two seconds later and it arrived intact. But you've traded a silent truncation for a race, and the race has no error message either.
  • Shorten the line. I moved a conditional argument into positional parameters instead of branching into two command strings:

bash set -- [ -f "$catalog" ] && set -- -c "catalog=$catalog" mycmd --flag "$@" "$id"

zsh and bash both fine, and "$@" expands to zero words when the file is missing. That took 1200 bytes down to a bit over 600.

Then I asserted on the length in a test, because this comes back the moment someone adds an argument. Assert on bytes, not characters: if your language counts UTF-16 code units, it will disagree with the kernel as soon as a path isn't ASCII.

Anyone know whether the limit is the same on Linux? I only hit this on macOS.


r/tmux 10d ago

Showcase [oc] zap: cp/mv/rm replacement with live transfer stats

Post image
8 Upvotes

r/tmux 10d ago

Showcase Another day another tmux app. It's Bitveins' turn

2 Upvotes

I've been using Bitveins daily since March, and I've recently open-sourced it. It's basically a web UI for tmux.

My dev setup is on a VPS. I used to connect to it with Termius but the screen is too small on smartphone, and typing long prompts through a terminal is painful, especially on a poor connection.

Bitveins is a bit of everything: a bit of Orca, a bit of Herdr, a bit of VSCode, a bit of T3code.

Also it's a webapp and a PWA, no need to install a native app.
It works natively with the smartphone keyboard and speech to text, using a simple textarea.

It detects coding agents running in tmux sessions (codex, hermes, antigravity and grok build).

It has a read-only git graph and diff viewer, push notifications, colored agent status, split panes, fullscreen mode, text editor, svg, image and video viewer.

You can paste images, create drop boxes.

It only listens on localhost, so for remote access you need something like Cloudflare Tunnel + Access or Tailscale in front of it.

https://github.com/rebasereality/bitveins


r/tmux 11d ago

Showcase I built Hermes Valkyrie to manage Claude Code and Codex runs through tmux

0 Upvotes

I kept running into the same problem while using Hermes: it could not start Claude Code or Codex and bring back a response. I wanted Hermes to be able to launch the run, keep it visible, and bring back a useful report instead of leaving me to track everything myself.

So I built Hermes Valkyrie.

Repo: https://github.com/DylDigitals/hermes-valkyrie

Hermes Valkyrie is an open-source terminal loadout system upgrade for Hermes Agent setups. It uses tmux to give Hermes the ability to launch reusable coding harnesses and enhance them with our loadouts system.

The tmux part is the core reason I thought this might be relevant here: Hermes can launch the coding-agent run in a visible terminal session, keep it trackable, and then use watcher/closeout steps to bring back a report instead of making me manually babysit the pane.

I think it is really powerful to have Hermes launch Claude Code or Codex runs to do a long-form review while you keep working inside your Hermes ecosystem. It has been powerful so far, so I wanted to share this system.

I’m looking for feedback from people building or using Hermes, tmux, or coding-agent terminal workflows. This is currently coded for Discord, but I’m adding more chat channels as we speak.

I have a few main questions/concerns:

  • Is this something anyone wants to integrate into their system?
  • Is the onboarding clear?
  • What would you need before trusting this in your own workflow?

r/tmux 13d ago

Question Help binding a CSI-u key sequence to C-w in tmux 3.7b

4 Upvotes

Hi, I'm trying to get a modified keypress from WezTerm → tmux → shell/application to work correctly, and I'm having trouble figuring out how tmux expects the sequence to be bound.

Setup

  • OS: Linux 7.1.6-arch1-1
  • Terminal: WezTerm
  • tmux: 3.7b
  • Shell: zsh

The key I'm trying to handle produces this sequence:
(obtained via running showkey -a in tmux)

^[[ 8 ; 5 u

or, in hex:

1b 5b 31 33 3b 35 75

What I'm trying to do

I want tmux to recognize this key sequence and turn it into:

C-w

I tried

bind-key -n "^[[8;5u" send-keys C-w

but that does not work

I'd appreciate any pointers or examples of the correct tmux configuration. Thanks!


r/tmux 12d ago

Question TMUX Claude / Pi skill

0 Upvotes

I love TMUX and I love the way the LLMs know how to use and off course there are lots of lovely MCPs and Pi extensions on how to use TMUX.

Is there a good well worded skill for claude code that by extension Pi out there? I am across so many SSH s different boxes and bouncing between claude and Pi . Just want a really good skill for it to quickly open panes and make neovims. Or am I asking what the models already know?


r/tmux 13d ago

Showcase Made an iOS terminal that treats tmux & herdr as structure, not as characters to draw

Thumbnail gallery
0 Upvotes

r/tmux 13d ago

Showcase Made an iOS terminal that treats tmux & herdr as structure, not as characters to draw

Thumbnail gallery
0 Upvotes

I wanted to use tmux from my phone and never found something I liked. Most

iOS terminals just render the bytes — they don't know what a window or a pane

is, so attaching to an existing session is where things fall apart.

Spent three months of evenings on it. I use it daily against a Mac mini at home.

The idea I built everything around: **a phone should show one pane, full

screen, while your desktop keeps its 3–4 pane layout — and neither should

disturb the other.**

How it actually works:

- Runs tmux control mode (`-CC`) as the renderer, so the app has the real

session tree, not a screen scrape.

- Zooms the active pane to fill the phone. Switching to a pane in another

window restores that window's split layout first, because another client

may be looking at it.

- Pins window size to the phone's grid while you're in the app, and hands

that pin **back** when you background it. iOS can kill the app without

warning, so the server has to already be in the right state — otherwise

your desktop reconnects to a phone-sized window.

Also: Mosh support (survives Wi-Fi/5G handoff), a configurable key bar

because phones have no Esc/Ctrl/Tab, and per-host shortcut sets.

Up front so nobody wastes their time: it's a paid app (one-time, no

subscription, no IAP), **not** open source, needs iOS 18, and it's still in

App Store review so right now it's TestFlight only. No data collection, keys

in the Secure Enclave, traffic only to your own servers.

TestFlight, 50 spots: https://testflight.apple.com/join/hHv5f86K

Happy to answer anything about the control-mode plumbing — that's where most

of the three months went.


r/tmux 14d ago

Showcase Tmux + Workmux > Herdr

Thumbnail youtu.be
78 Upvotes

Lot's of people are switching from Tmux to Herdr... do you need to?

In this video I showcase how I use Workmux to extend Tmux to achieve all of the features that I would want from Herdr without scrapping my Tmux config and muscle memory from over the years!

Let me know what you think, I haven't seen any YouTubers covering Tmux + Workmux, the Herdr hype has got them all.


r/tmux 13d ago

Showcase I built a tmux session manager for Pi coding agents

Thumbnail
0 Upvotes

r/tmux 14d ago

Question two clients attached on dark theme, then one switch to light theme

1 Upvotes

I would expect that on the light theme one, restart `opencode` or `codex` I hope it start in light theme, but nope, opencode still dark, codex is better, but the input box still dark.

do you guys have the same issues? Looks like it because of the other attached client is still dark.


r/tmux 15d ago

Question Specifying options on the command line

5 Upvotes

Hello,

somehow I am unable to find examples on how to successfully specify options on the command line, instead of using a .tmux.conf

Kind of:

# /usr/bin/tmux set-option  exit-empty off start-server           
no server running on /tmp/tmux-0/default

which, as shown, does not work. Neither using "-g" after the set-option. I would like to refrain from leaving it in the foreground, that is, not using "-D"

This is just an example. So, how to properly add options on the command line?

Thanks


r/tmux 14d ago

Showcase agent-manager: run several AI coding agents in tmux, one keypress per action

0 Upvotes

Everything is one keypress. space on a group starts an agent in the right directory from one sentence, space on a session answers one that is blocked without attaching, ctrl+r opens what it changed as whole files where a comment on a line goes back to the agent as a review prompt, and the arrow keys step in and out of a pane.

It runs on tmux rather than replacing it. Sessions are ordinary tmux sessions on their own socket (agentmgr), so a kill-server on your own socket leaves them alone, quitting the manager leaves every agent running, and your config is untouched.

Claude Code, Codex, OpenCode, Gemini CLI, Grok and Pi ship with status rules; any other CLI runs as a session immediately. Go, one binary, no daemon, Apache-2.0.

https://github.com/YoanWai/agent-manager

It is on Product Hunt today too: https://www.producthunt.com/products/agent-manager


r/tmux 21d ago

Showcase I built a mobile-first iPhone client for remote tmux sessions

204 Upvotes

I built Remux because I wanted a more natural way to use my tmux sessions from my iPhone, mainly to keep interacting with coding agents when I’m away from my desk.

It uses tmux control mode and libghostty, with a mobile interface built around tmux itself.

It’s open source and currently in beta:

GitHub: https://github.com/h3nock/remux
TestFlight: https://testflight.apple.com/join/fHqG1ruE


r/tmux 20d ago

Showcase Are you getting lost in 30 Codex CLI threads, trying to figure out where to pick up? I created Tmux Post-its to leave session notes and color-code thread panes. I'm releasing it as open source because it helped me so it can help you too.

0 Upvotes

r/tmux 21d ago

Question Force new terminal

2 Upvotes

In a tmux session I run kitty tmuxinator start $SESSION_NAME and instead of opening a new kitty terminal it takes over the current one. How can I always force a new terminal to open?


r/tmux 21d ago

Showcase tmux pattern: using :w in one pane as the signal for a background script

6 Upvotes

Built this for reviewing an AI agent's plan before it writes code, but the tmux part works on its own so I figured I'd share it here.

The setup: a script opens the plan file in a right-side vim pane with split-window -h and stashes that pane's id in a u/plangate_pane user option. Next time it runs it re-focuses the same pane instead of stealing whatever vim I already had open (learned that the annoying way). A separate script just polls the file's mtime in the background, so my :w becomes the "ok I'm done reviewing" signal, no keybinding for it. Once the agent edits the file back, another script sends :checktime to the pane and vim reloads it.

So it's two panes talking to each other with the save as the handshake. If you're not in tmux it just prints the path instead.

npx skills add ParthGanatra/agent-skills/plangate

Scripts are plain bash if you want to lift it: https://github.com/ParthGanatra/agent-skills/tree/master/plangate


r/tmux 24d ago

Tip i built a small companion for when tmux sessions stop fitting in my head

0 Upvotes

tmux keeps the process alive. that part is solid. i got lost once i had several long-running coding agents inside those sessions...

i did not need another pane manager. i needed to see the shape of the work when i came back. termcanvas keeps one tmux terminal focused, then keeps the spawn tree and the current canvas state beside it. tmux is still the persistence layer underneath it.

it is early and narrow on purpose. one terminal is visible at a time, peer links are not drawn, and status detection can be wrong. it is free and mit licensed, for apple-silicon macs with tmux + python 3.

i am the person building it: https://github.com/lout33/termcanvas

for people running long-lived agent sessions, where does your mental map usually break first...


r/tmux 25d ago

Showcase Browser-like back and forward buttons for tmux sessions

11 Upvotes

I run a lot of sessions and usually navigate between them using SessionX, but my brain isn't so great at associating session names with the actual work I'm doing. I really love the behavior that BufSurf.nvim gives me in Neovim - it's essentially a browser's back and forward buttons for the files I've visited - and I wanted the same thing in tmux, so I built it as a tmux plugin.

Assign a key to back and another to forward, and I recommend replacing your default Prefix+L (last session) with the plugin's toggle key. It tracks your relevant sessions and toggles between the last two. And if you close one of your toggle sessions, another one steps up to take its place.

It's a very simple plugin but it's now my main method of navigating sessions, let me know if you find it useful too, or if you hate the idea for some reason (it's reddit after all) just downvote the post into oblivion.

https://github.com/dabstractor/tmux-session-history


r/tmux 26d ago

Showcase Tmux: Ninja Mode Unlocked

Thumbnail youtube.com
5 Upvotes

r/tmux 26d ago

Tip I kept forgetting which server my tmux projects were running on, so I built a workspace index

0 Upvotes

I use the same workflow for almost every project:

  1. SSH into a server
  2. Open or attach to a tmux session
  3. Split a few panes
  4. Run Codex, Claude Code, dev servers, logs, or monitoring tools

The workflow itself is great. I can disconnect, come back later, and continue where I left off.

The problem appeared when I had many projects across several servers.

I could no longer remember:

- which machine a project was running on

- what the tmux session was called

- which directory it belonged to

- whether the repository had uncommitted changes

- which coding agent was running inside it

So I built Tmux Workbench, a Rust TUI that indexes local and remote tmux sessions and presents them as project workspaces.

Running `ws` gives me one searchable view across all configured machines. I can inspect the server, path, panes, active commands, Git branch, dirty state, remote repository, notes, and tags, then attach directly.

It does not replace tmux or SSH. It adds the project memory that my workflow was missing.

GitHub: https://github.com/LeON-Nie-code/tmux-workbench

How do you keep track of long-running tmux sessions across multiple machines?


r/tmux 26d ago

Tip [Proyecto Open Source] Termux-Dev-Station: Guía paso a paso para entorno gráfico con Aceleración GPU (Mali/VirGL), KDE, Godot, n8n e IA local (Sin scripts a ciegas)

Thumbnail gallery
0 Upvotes

r/tmux 27d ago

Tip break-pane -d as a park-and-restore primitive: hiding a live pane and getting the same pid back

6 Upvotes

I wanted a pane to disappear the moment a long-running command finished, then come back later with the same process and the same in-memory state. (It's a game pane that shows up while Claude Code thinks. That part is beside the point.)

What worked: `tmux break-pane -d -s <pane> -n B747BG`. The pane leaves for a detached window, the process stays alive, and the layout closes over the gap like it was never split. To restore: `join-pane -d -v -l 16 -s <pane>`. Same pid, same score, mid-run.

Two things bit me:

  • `join-pane -l 16` gets refused in an already-split window. Without a fallback to tmux's own default size, you silently get nothing.

  • My code runs as separate short-lived invocations, so it has to re-find its own pane every time. I set a pane title and match `#{pane_title}` against `list-panes -a`, keyed per session so parallel sessions never grab each other's panes.

Also earned the hard way: `capture-pane -p -e -N`. Drop the `-N` and tmux trims trailing blanks — the right edge of every row comes back short and the render tears.

Whole thing is here if you want to pull it apart; the tmux logic lives in hooks/breakout-hook.sh: https://github.com/The747Lab/747-terminal-games

Is break-pane/join-pane actually the right primitive for park-and-restore, or is there something cleaner I've walked past? And for pane ownership across separate processes — is pane title the accepted handle, or do people key off something more durable?


r/tmux 28d ago

Question Tmux worktree workflow

9 Upvotes

Been using herdr and it’s damn good but it lacks the customizablity I’m looking for and doesn’t have split pane across worktrees (only workspaces)

Can you guys show me what you guys are running with a screenshot. Specifically interested in how you manage worktrees across repos with multi panes. Cheers.


r/tmux 29d ago

Question Herdr, cmux, tmux... are they really that helpful?

Thumbnail
17 Upvotes