{
  "id": 17081613,
  "title": "Keeping my auto-tmux muscle memory while also touching tmux over SSH — taming the nesting with prefix+T",
  "url": "https://urgent.news/2026/10/29/keeping-my-auto-tmux-muscle-memory-while-also-touching-tmux-over-ssh",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-29T15:34:04.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/kohei_wada/keeping-my-auto-tmux-muscle-memory-while-also-touching-tmux-over-ssh-taming-the-nesting-with-2631"
  },
  "original_language": "en",
  "account": "I am accustomed to my terminal automatically launching tmux upon startup. Using Ghostty, this process involves only a single command. The session persists even when the window is closed, which proves convenient. However, when tmux is also employed on an SSH host, issues arise. The primary problem is that keys fail to reach the inner session. For instance, when working on a remote GPU box, one typically prefers tmux to remain operational even after a disconnection. To achieve this, one runs `ssh -t gpubox tmux new -A -s main`, creating a nested relationship between local (outer) and SSH-host (inner) tmux instances. This nesting results in both sessions attempting to listen for the prefix `C-b`. Consequently, pressing `C-b %` to split a pane in the inner session fails as the outer session consumes it, rendering the inner session unusable. Various solutions are proposed online, which can be grouped into two primary camps. The first camp advocates for using native terminal splits locally and utilizing tmux exclusively for remote sessions. Proponents argue that without local tmux usage, nesting does not occur. Tools like Ghostty and WezTerm provide native splits requiring no prefix and share the clipboard seamlessly. This approach appeals to some individuals, but it introduces inconsistencies across machines. For example, Alacritty, another frequently utilized terminal, does not support splits or tabs, leading to a different workflow on Alacritty machines. This inconsistency may confuse users accustomed to a uniform experience. The second camp advocates for maintaining the local auto-tmux setup while addressing the nesting problem. This solution involves employing an F12 toggle or dual prefixes to manage the issue. Samoshkin's F12 toggle is a popular approach within this camp. Pressing F12 silences the outer tmux, allowing every key to pass directly to the inner session. Pressing it again restores normal functionality. While this method functions effectively, pressing F12 can be cumbersome, especially when used frequently. The prefix `C-b` is already within reach, making it a more comfortable alternative. After extensive experimentation, the optimal solution combines local tmux usage with a prefix+T toggle. By pressing `C-b T`, the outer tmux is silenced, enabling all keys to flow directly to the inner session. Conversely, pressing plain `T` restores normal operations. The binding in the configuration is as follows: `bind T \\ set prefix None \\; set key-table off \\; set status off \\; refresh-client -S`. Upon silencing the outer session, the prefix becomes disabled, and the `T` key directly returns the user to the inner session. The return action utilizes a bare `T` without a prefix, bound via `bind -T off`. However, it is important to note that the `enter` and `return` actions cannot be identical. After silencing the outer session, the prefix is disabled, preventing the combination of `C-b T`. Therefore, the return action is a bare `T` without a prefix, bound through `bind -T off`. Additionally, one should avoid using `C-b T` for both entering and exiting the silenced state, as the `enter` and `return` actions cannot coincide. Portable configuration and a clean status bar are additional benefits of this approach. Once the nesting issue is resolved, other enhancements can improve the experience. To prevent re-login on each pane split, leveraging SSH's `ControlMaster` option allows subsequent panes to connect instantly through an existing master connection. Furthermore, ensuring portability by removing hard-coded configurations, such as `/bin/bash`, enables consistent functionality across different systems. The final outcome allows for a consistent local auto-tmux experience while effectively managing nesting when using tmux on remote SSH hosts. Configurations like this can be shared across machines, ensuring a seamless workflow regardless of the specific terminal emulator employed.",
  "summary": "I've gotten used to my terminal dropping me straight into tmux on open. With Ghostty it's one line. command = tmux new-session -A -s 0 There's always one session, and it survives closing the window. Comfortable. But once you're used to that, the moment you also use tmux on an SSH host, the pain starts. Symptom: keys don't reach the inner session When I want to settle in and work on a remote GPU…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}