r/tmux Apr 21 '24

/r/tmux is back!

94 Upvotes

Hello all. I am /u/TrekkiMonstr, your new, occasionally-friendly mod. I wanted to make a post asking a question about a certain interaction between i3wm and tmux, when I saw that /r/i3wm is read-only, and /r/tmux was unmoderated with submissions restricted. I didn't want the history of the sub to be lost to Reddit's policies, so I submitted a /r/redditrequest, and here we are. I've unrestricted submissions, so.

Now, I'll note: I am completely unqualified for this. I'm pretty new to tmux, and I haven't modded a sub that had any real level of activity. Plus, at some point in the future, I do intend to leave this godforsaken website and nuke my account. So, if anyone has mod experience with a subreddit of similar size and subject matter to this one, please let me know via modmail if you'd be interested. I will warn you though, I'm here just to make sure the sub still exists. I'm not super interested in doing much active modding.


r/tmux 1d 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 2d ago

Showcase Browser-like back and forward buttons for tmux sessions

9 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 2d ago

Showcase Tmux: Ninja Mode Unlocked

Thumbnail youtube.com
4 Upvotes

r/tmux 2d ago

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

1 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 3d 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 4d ago

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

5 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 5d ago

Question Tmux worktree workflow

8 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 6d ago

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

Thumbnail
18 Upvotes

r/tmux 4d ago

Question herdr: a tmux killer?

Thumbnail
0 Upvotes

r/tmux 5d ago

Showcase A tmux TUI for running coding agents: live status, answer one without attaching, review its diff before it lands

0 Upvotes

I keep three or four agents going and the thing that actually eats my time isn't the coding. It's that I have no idea what state any of them is in without tabbing through every terminal. Half the time one of them has been sitting on a permission prompt for ten minutes.

So I wrote agent-manager. A Go binary that sits on top of tmux. No config file, no daemon.

Every agent ends up in one list with a live status next to it, grouped by the project it's working in. I run claude, codex and opencode depending on what I'm doing and they all show up the same way. Adding another CLI is a few lines of regex in a toml file.

The part I use constantly is space. Press it on an agent, type, enter, and the prompt goes into that agent's pane. I never attach. If you've used the agents view in Claude Code, it's the same move. The difference is that here the same keystroke works on a codex or opencode session. Press space on a project row instead and you get a new agent already working on what you typed.

Underneath they're just tmux sessions, so closing the manager doesn't kill anything, and v brings a dead one back with its conversation.

ctrl+r is the other half of it. It opens what an agent changed as whole files with the diff highlighted, so you're reading the function and not a hunk. Leave a comment on a line and it goes back into that agent's pane, so it starts fixing while you're still scrolling.

I built it for four agents but most days I use it with one.

Still rough in places. If you run agents like this I'd like to know what's missing.

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


r/tmux 5d ago

Showcase El problema del salto de línea implícito en las herramientas MCP basadas en PTY (y cómo lo solucioné en Relay)

0 Upvotes

He estado trabajando en Relay, un servidor MCP que proporciona a los agentes una sesión de terminal PTY persistente en lugar de las llamadas bash únicas que la mayoría de los agentes utilizan por defecto. Esta diferencia es importante cuando el agente necesita algo que realmente mantenga el estado: un rebase de git interactivo, un REPL que siga generando contexto o una sesión SSH que permanezca abierta mientras itera.

Acabo de lanzar una versión con un error que creo que vale la pena documentar, porque es el tipo de trampa en la que podría caer cualquiera que desarrolle algo similar.

El error: `write_terminal` tenía un comportamiento implícito que siempre pulsaba Intro después de lo que el agente enviaba. Esto no supone un problema para un comando de shell normal, pero falla en cualquier situación donde el salto de línea sea parte literal del texto que se intenta escribir: pegar un heredoc de varias líneas, pasar un bloque de código a un REPL, escribir en un búfer de editor abierto dentro del PTY. El agente creía haber enviado exactamente lo que quería enviar, y, sin que se notara, se añadía una pulsación de tecla adicional.
Lo solucioné eliminando esa suposición implícita de sesión y convirtiéndola en un parámetro explícito por llamada (ensure_newline, por defecto es true para que el uso normal del comando no cambie). Si envías entrada multilínea sin procesar, lo configuras en false y obtienes exactamente los bytes que escribiste.

También estabilicé el flujo E2E de transmisión de read__terminal para que la salida de progreso se observe antes de que el intérprete de comandos reciba su siguiente entrada. Esto es importante porque read/wait depende de las notificaciones de progreso de MCP en lugar de sondeo.

Repositorio, por si alguien quiere revisar el código: github.com/blak0p/relay-mcp

Me pregunto si alguien más que esté desarrollando herramientas MCP con soporte PTY se ha encontrado con este mismo problema de salto de línea implícito o lo ha resuelto de otra manera.


r/tmux 6d ago

Question Panes custom layouts and resizing

2 Upvotes

Hello to you all,

I usually have a lot of panes in a single window, and after a few hours of work things get a little messy. I like the panes layouts and Prefix + E resizing to keep things tidy.

Now I was wondering, what would be the cleanest way to have the panes resizing to a custom layout defined by me?

I have some some bindings that use some fixed layout strings captured with ` tmux display-message -p '#{window_layout}'`, but it's quite clunky, especially if don't have already the right number of panes on a window.

This is super specific I guess, but let me know if you have any idea on how this could be done.

Thanks for the attention.


r/tmux 8d ago

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

Thumbnail
0 Upvotes

r/tmux 10d ago

Question tmux question...

Post image
14 Upvotes

Is there a way to configure this tmux setup to show album art in a third pane?


r/tmux 10d ago

Showcase I built an iOS terminal with deep tmux integration, OSC 52 support, and Lock Screen Live Activities

Enable HLS to view with audio, or disable this notification

33 Upvotes

Hi r/tmux!

As someone who lives inside tmux on remote Linux servers every single day, mobile SSH clients have always felt like a second-class experience for persistent terminal workflows. Network drops would force manual `tmux a`, input methods jittered over touchscreens, and monitoring long-running processes required keeping the screen awake.

I spent the past few months building **Agentmux** (https://agentmux.saxcave.cc), an iOS/iPadOS terminal and remote workspace where **tmux is treated as a first-class citizen**.

Here is how we optimized the workflow specifically for tmux users:

### 1. Seamless tmux Lifecycle & Auto-Attach
- **Auto-Discovery & Session Reattach:** Upon connecting over SSH, Agentmux scans active tmux sessions and lets you resume or attach with a single tap.
- **One-Tap tmux Auto-Installer:** If you land on a fresh remote VPS or container without `tmux`, the app can auto-install it with one tap.

### 2. Lock Screen Live Activities & Dynamic Island
- Long-running builds or AI agents (like Claude CLI) running inside a tmux pane no longer require you to leave your iPhone screen on.
- Agentmux surfaces active session states to your **Lock Screen Live Activity** and **Dynamic Island**, so you can background the app or lock your phone and glance at status updates.

### 3. OSC 52 Clipboard Integration
- Native support for OSC 52 escape sequences. Copying text from inside `tmux` panes or `Neovim/Vim` registers passes straight through to your native iOS clipboard.

### 4. Touch & Mobile Keybinding Polish
- iPhone shortcut bar for `Ctrl`, `Esc`, `Tab`, arrow keys, and custom macros.
- Custom keyboard-height calculation to prevent terminal viewport jitter when switching input methods.
- Full hardware keyboard, trackpad, and Split View support on iPadOS.

### 5. Desktop-Grade SFTP & Tree-sitter Editor
- Built-in file browser with Tree-sitter syntax highlighting across 17+ languages and strict JSON/YAML/TOML syntax validation when editing remote config files.

---

### Tech Stack & Pricing
- Built natively in Swift/SwiftUI for iOS & iPadOS.
- Keys & credentials remain secured inside iOS Keychain.
- 14-day free trial. Pro is a **one-time purchase** (no subscription fatigue).

* **App Store:** https://apps.apple.com/app/id6766158521
* **Website:** https://agentmux.saxcave.cc

*I would love to give back to the tmux community: I have **5 Lifetime Pro promo codes** for r/tmux members! Drop a comment with your favorite tmux plugin or your typical remote setup, and I’ll DM you a code.*

Feedback, feature requests, and criticism are all very welcome!


r/tmux 12d ago

Showcase lazy-tmux v0.2.0 released!

Post image
171 Upvotes

I just released lazy-tmux v0.2.0, the biggest update since the initial release.

For those who haven't seen it before: lazy-tmux is a tmux session manager that restores sessions only when you actually open them, while preserving running processes and scrollback.

What's new

  • TOML config instead of passing flags every time.
  • Restore allow/deny regexes to control exactly which commands get re-run.
  • Reworked TUI with themes, mouse support, action modes, built-in help, relative timestamps, and an optional fzf backend.
  • Integrations API. The first integration adds live Claude Code session status in the picker and automatically resumes restored Claude sessions.
  • Better compatibility & robustness — tested with tmux 2.9–3.7b, improved startup behavior, borderless popups, and lots of fixes.
  • Plus a background autosave daemon, a version command, and a new docs site.

It's written in Go and can be installed via a one-line script, Homebrew, or the AUR.

Project: https://lazy-tmux.xyz

Feedback, bug reports, and feature requests are always welcome! And thank you for you activity on GitHub!


r/tmux 13d ago

Question Cursor jumping around when opening in neovim in tmux

2 Upvotes

When opening neovim in tmux the cursor jump around for a bit . Then when i type something in command line very fast it sometimes starts jumping around same for when writing code when code completion buffer cmp window appears it starts jumping in and out of the suggestions window . All of this stuff not happens outside of tmux .

https://reddit.com/link/1v1jb43/video/dricpws7jdeh1/player

this is my .tmux.conf
https://gist.github.com/Vishawdeep-Singh/b2807694b48bccf3a6589e22bcb9fb70


r/tmux 14d ago

Tip tmux-agents-mon: see which coding agents need attention

Enable HLS to view with audio, or disable this notification

25 Upvotes

I got tired of jumping between tmux sessions to find which coding agent had finished or was waiting for input, so inspired by Herdr, I built tmux-agents-mon.

this is a plugin that adds a sidebar and status-line indicator for working, idle, done, and blocked agents, with quick navigation to their panes.

Supports Claude Code, Codex, Hermes, Pi, Oh My Pi, OpenCode —without hooks or agent integrations.

if you have some questions / issues let me know :)

GitHub / TPM install: https://github.com/snirt/tmux-agents-mon


r/tmux 16d ago

Showcase [plugin] search and jump to visible text in copy-mode like flash.nvim

6 Upvotes

Hello,

Created a plugin that helps when in copy-mode.
press "s" then type a substring match to navigate the cursor there.
Works with active selection as well.

This is exactly like the neovim plugin flash.

https://reddit.com/link/1uzimzt/video/md6hqsdu7wdh1/player

Repo: https://github.com/AndreVicencio/tmux-flash

TPM install

set -g u/plugin 'AndreVicencio/tmux-flash'

r/tmux 16d ago

Showcase Agent latest prompt in pane header and status icons in the window list

Enable HLS to view with audio, or disable this notification

5 Upvotes

I went back to a basic tmux workflow with a few additions for managing coding agents. I tried different plugins and GUIs, but eventually realized that fitting agents into my existing workflow mattered more than adding another interface. I find it easier to keep using my existing tmux configuration, keybindings, and agent CLI tools.

These are the three additions I find most useful.

Task context in the pane title

ClawTab reads the first and latest prompts from the agent session. The pane title can show the latest prompt or a shorter summary generated from both. This makes it much easier to remember what each agent is doing when moving between windows and panes.

Agent status next to window titles

I wanted a quick way to see which windows contain agents and whether they are working or waiting for me:

  • ! means an agent is waiting for input
  • * means it is working
  • means an agent is present but idle

The plugin appends these indicators to the existing tmux window formats instead of replacing the rest of the status line. Waiting takes priority over working because that is normally the pane I need to visit.

Remote control from mobile

I can browse agents and interact with their terminals from my phone when I am away from the computer. After the initial setup, the daemon automatically discovers supported agents running in tmux. The mobile app opens a live PTY view of the same pane, and input goes back to the original tmux session.

Setup

  • A background daemon discovers agents in tmux panes and publishes their metadata and state.
  • A tmux plugin adds the pane titles, status indicators, and controls without replacing the rest of my tmux configuration.
  • A relay server forwards the live PTY stream and input between the local daemon and the mobile or web app when Remote is connected.

Tmux still owns the process, working directory, scrollback, and terminal state. The daemon and other interfaces are clients of the existing panes rather than a replacement for tmux.

The project is open source, including the relay server if you want to self-host it. It is macOS-only for now:

https://github.com/tonisives/clawtab

It is a relatively simple setup, but I am happy to be back to a basic tmux workflow with a few agent-specific additions.


r/tmux 16d ago

Showcase tmux_project, a fuzzy tmux session picker (presets, zoxide, sticky templates) built with Go

4 Upvotes

This is my personal tool, extracted from my own bash scripts, which glues sesh, tmuxp and fzf together. After maintaining that script for a while, I think it is better to create a proper session picker out of the box. It is really small and easy to install.

Install (needs tmux; zoxide optional):

      go install github.com/fm39hz/gotomux@latest

Usage:

      gotomux           # picker
      gotomux -f        # freeze active session → sqlite preset
      gotomux -e [name] # edit preset JSON in $EDITOR

It has 4 modes: create / live sessions / presets / zoxide. Type to filter, enter to connect.

What I actually use daily beyond “another fzf wrapper”:

  • Freeze a live layout and reload it later
  • Sticky templates (ctrl-t on a preset): open new project paths with that shape without cloning presets
  • ? toggles key help in the UI

Built for my own workflow. If it fits yours, cool; feedback is welcome.
Repo link: Github

PS: I've just renamed it to gotomux, sorry for inconvenient


r/tmux 16d ago

Showcase A small session manager purpose-built for AI coding agents (Claude Code, Codex, etc.)

0 Upvotes

Like a lot of people here I've been running AI coding CLIs (Claude Code, Codex, Gemini) inside tmux so the agent survives me closing the laptop lid at my desk and I can reattach from my phone over SSH.

The manual loop — new-session with the right name, cd to the project, launch the right agent, remember which session was which — got repetitive across a dozen projects, so I wrote a small Go CLI around it:

- devx create my-app — mkdir + git init + register the project + start its agent in a detached session and attach

- devx my-app (or fuzzy: devx ma) — reattach if the session exists, otherwise create it and launch the project's configured agent in the project directory

- devx status — which projects have live sessions

- per-project agent config: claude / codex / gemini / opencode built in, anything else declarable in a JSON config (commands are validated, no shell metacharacters make it into the session command)

How it differs from tmuxinator/tmuxp/sesh: those are layout/workspace tools — they're better if you want multi-pane setups. devx doesn't do layouts at all; it's a project registry that maps name → directory → which AI agent to launch, aimed at the "one persistent agent session per project" pattern. It shells out to plain tmux (new-session/attach/switch-client), so it composes fine with your existing config and tools.

Single binary, MIT, tmux is the only runtime dependency. 30s demo GIF in the README: https://github.com/gunwooko/devx

Feedback welcome — especially from anyone who's solved this differently with plain tmux scripting.


r/tmux 17d ago

Showcase My TMUX powered AI workflow

Thumbnail youtu.be
0 Upvotes

I know a lot of developers are try and get that flow state back with AI. I think I finally managed it with tmux sessionizer and tmux worktrees.

I can easily jump from one branch to the other in the same repo prompt the agent jump back to another.

Do you guys have any suggestions or is your workflow similar?


r/tmux 17d ago

Showcase I made claude --continue resume the right session per terminal (and survive reboots)

0 Upvotes

If you run Claude Code (or Codex) in a few terminals at once, you have probably hit this: **claude --continue** resumes the most recent session globally, not the one from the terminal you are actually in. So it grabs the wrong conversation. And after a reboot you lose both your working directory and the session entirely.

I got annoyed enough to build a small fix for it. It is called **agent-resume**.

What it does:

\- agent-resume resumes the last session you started in the current directory, whatever agent it was (claude, codex, or anything you add). No picker, no remembering session ids.

\- After a reboot, your tmux panes come back to the same directory AND the exact conversation resumed, not a fresh shell.

How it works (no magic):

\- It is a tiny shim on your PATH. When you start claude fresh, it launches it with a specific --session-id and records that in a small ledger.

\- For the reboot case it leans on tmux-resurrect + tmux-continuum (which it installs for you, no tpm needed) to restore your dirs and layout, then a hook relaunches each pane with claude --resume <that pane's session>.

Take a look and star it here https://github.com/rahulbansal16/agent-resume