gtmux / 指南guides / 从任意电脑接回attach from anywhere
从任意电脑接回会话Attach to your Mac from any computer
你在公司的 Mac 上跑着一堆 agent,人却在家里、在另一间办公室、在另一台笔记本前。手机能看能回,但你想要的是一个真正的终端——原样接着那个会话干。gtmux attach 就是干这个的。 Your Mac at the office is running a pile of agents, but you’re at home, in another room, in front of a different laptop. The phone can watch and reply, but sometimes you want a real terminal — the session, as-is, to keep working in. That’s what gtmux attach is for.
1 · 在你 Mac 上开一个口子1 · Open a door on your Mac
gtmux serve # local network
gtmux tunnel # + a public URL, from any network, no VPN 同一个 WiFi 下有 serve 就够;跨网就加 tunnel,它给你一个 https://…ccy.dev 的地址,走一条出站隧道,不用开路由端口、不用 VPN。serve is enough on the same WiFi; across networks, add tunnel — it gives you an https://…ccy.dev address over an outbound tunnel, no port-forwarding, no VPN.
2 · 从另一台电脑接进来2 · Attach from the other computer
gtmux attach <host> %7 # owner: host + --token
gtmux attach 'https://host/#t=…' # or a scoped guest link 它把那个 pane 的 PTY 原样桥到你眼前的终端——远程的 tmux、你的 ~/.tmux.conf、真彩色,全照旧。owner 用 token 全权;guest 链接只能进你允许的 pane。It bridges that pane’s PTY straight to the terminal in front of you — the remote tmux, your ~/.tmux.conf, truecolor, all intact. An owner token gives full access; a guest link only reaches the panes you allowed.
3 · 干完,干净地退出3 · Leave cleanly when you’re done
按 tmux 的 前缀 + d(默认 Ctrl-b d)或 Ctrl-] 断开——会话在你 Mac 上继续跑,一点不受影响。要记住的只有一条:别在 pane 里敲 exit,那是关掉 shell,不是断开 attach。Press tmux’s prefix + d (default Ctrl-b d) or Ctrl-] to detach — the session keeps running on your Mac, untouched. The one thing to remember: don’t type exit in the pane; that closes the shell, it doesn’t detach.
接下来:只想看状态 + 回一句,手机更顺手——装 iOS app。想把某个会话临时给同事?gtmux share 一个受限、可撤销的链接(见 文档)。 Next: if you just want to watch and reply, the phone is smoother — install the iOS app. Handing a session to a teammate for a bit? gtmux share a scoped, revocable link (see the docs).