Margrop
Articles374
Tags738
Categories7

Categories

/v1/models 0.025s 0步 0步元递归 0步本身 12类 192.168.x.x 1password 22类一键汇总 3层定位法 401 4个Gateway 4个Gateway全军覆没 503 60秒延迟 60秒超时 6个节点 AC ACP AI AI Coding Assistant AI编程助手 AI辅助 AI辅助编程 AP API Agent couldn't generate Alertmanager AppDaemon Aqara BaiduPCS CC-Switch CI/CD CLI Tools CLI工具 CONFIG Caddy Chrome缺失 Claude Code Cloudflare Codex Cookie 认证 Cron D1 DB探针 DB静止 DIY-123模型 DIY-MINI DIY平台 Date Diagrams.net Diary Docker Docker Compose EADDRINUSE EasyTier NAT穿透 Efficiency Tools Electerm English FTS5 Gateway Gemini CLI GitHub Actions HA HADashboard Hermes Hexo HomeAssistant IP IPv4 Java LVM‑Thin Linux MacOS Macmini Macmini log路径 Markdown MiniMax MiniMax-M3 Multi-Agent MySQL NAS NRestarts Nginx Node-RED Node.js OOM OpenAI OpenClaw OpenClaw gateway OpenCode OpenResty OpenWrt PPPoE Portainer PostgreSQL ProcessOn Prometheus Proxmox VE RPC Restart=always Restart=always循环 SOCKS5 SQLite SSL Session Shell Subagent TTS TimeMachine UML Uptime Kuma VM151 VM152 WeCom缺失 VM153 VPN VPS VPS4 VPS4 overlay TCP不可达 WeCom Web WebSocket Windows Workers activate ad adb adblock agent aligenie aliyun alpine annotation aop authy auto-restart autofs backup baidupan bash bitwarden boot brew browser by-design caddy2 capture_output cdn centos cert certbot charles chat chat completion chrome classloader client clone closures cloudflare cmd command commit connected container cron crontab cron任务 cron设计 ctyun dashboard ddsm demo dependency deploy developer devtools dll dns docker domain download draw drawio dsm dump duplicate service unit dylib edge exception exit 78 export fail2ban fallback fallback失效 feign firewall-cmd flow frp frpc frps fuckgfw function fuser gcc gfw git gitea github golang google_gemma-4 gperftools gridea grub gvt-g hacs havcs heap hello hexo hibernate hidpi hoisting homeassistant hosts html htmlparser https iKuai idea image img img2kvm immortalwrt import index install intel io ios ip iptables iptv ipv6 iso java javascript jetbrains jieba jni jnilib journald journald日志漂移 jpa js json jsonb jupter jupyterlab jvm k8s kernel key kid kms kodi koolproxy koolproxyr kvm lan lastpass launchctl learning lede letsencrypt linux live loopback-proxy low-code lsof lvm lxc m3u8 mac macos manual mariadb markdown maven md5 meta-acceptance meta-pattern meta-probe microcode mirror model provider modem modules monitor mount mstsc mysql n2n n5105 nas netstat network new-api nfs node node-red nodejs nohup notepad++ npm nssm ntp one-api oop openfeign openssl os otp ovz p14 packet capture pat pdf pem perf ping ping通但chat不通 pip plugin png port=18789 powerbutton print pro proxy pve pvekclean python qcow2 qemu qemu-guest-agent rar reboot reconnect循环 reflog remote remote desktop renew repo resize retina root route router rule rules running runtime safari sata schema schema列名 scipy-notebook scoping scp server server is busy service不可信 slmgr so socket-proxyd socks source spk split边界 spring springboot springfox sqlite3 CLI ss ssh ssl stale stash stderr被吞 string subprocess supernode svg svn swagger sync synology system-level daemon system-level vs user-level system-level与user-level抢端口 systemctl systemctl disable systemd systemd duplicate service systemd exit 78 systemd service unit systemd unit systemd unit race systemd-socket systemd被覆盖 tap tap-windows tapwindows telecom template terminal tls tmux token token失效 totp transient 999 trigram tvbox txt ubuntu udisk ui undertow unicode61 uninstall unlocker upgrade upstream provider timeout uptimeMs url user-level daemon v10探针 v11探针 v12探针 v13探针 v1探针 v2ray v6探针 v7探针 v8探针 vhd vim vlmcsd vm vmdk web websocket wechat windows with work day 2 worker wow xiaoya xml yum zip 一键告警脚本 上游LLM容量 不是我的锅 中国电信 中文搜索 主动0步 主动0步本身 主动不追问 主动不追问本身 主动不追问本身也是清单之外 主动不通知 主动不通知本身 主动修 主动修system-level本身也是清单之外 主动修本身也是清单之外 主动周一 主动意识到 主动意识到0步本身 主动意识到0步本身也是清单之外 主动追问 云电脑 交换机 人机协作 代理 优化 但chat 30s+ 但是我的事 体检 保护逻辑本身也是清单之外 修挖坑闭环 修正本身 修正递归 值班 假阳 假阴 健康检查 元递归 光猫 全绿 全量同步 公网IP 内存 内存优化 内网 内网IP 内网渗透 写作 分词 切换 列名误判 升级 协作 单位混淆 博客 反向代理 反常稳定 反应 vs 知识 启动 告警 告警优化 周一 周一焦虑 周三 周二 周二晚上 周五 周六 周四 周报 周日 周末 周末也是清单之外 周末本身也是清单之外 周末突破 周末第二天 周末落地 周末落地本身 夏令时 多场景 多智能体 多节点 多节点管理 天猫精灵 天翼云 安全 安装 定时任务 容器 容器网络 导入 小米 工作感悟 工作日 工作日常 工作日第三天 工作日第五天 工作日第四天 已通知用户 常用软件 幂等 广告屏蔽 序列号 应用市场 异常 循环类 心态 心智成长 心理模型 心跳 心跳检查 性能优化 感悟 打工 打工人 打工人的无奈 批量校验 技术 抓包 挖坑→修坑闭环 排查 排查思路 探针再升级 探针本身 探针版本 探针管理 探针自检 探针踩坑 接受 接受之后 接受修 接受修正 接受层 接受挖坑 接受本身 接受递归 描述文件 放下 故障 故障排查 效率 效率工具 数据 旁路由 旁路进程 无服务器 日记 时区 显卡虚拟化 智能家居 智能音箱 服务器 服务管理 架构 梯子 模块 模型别名映射 模型探测 模型端点可达性 模型端点能ping通 模型调用 毫秒 流程 流程图 流程管理 浏览器 清单之后 清单之外 清单之外也包括接受本身 清单的元递归 清单设计 清单边界 清单进化 源码备份 漫游 激活 激活循环 火绒 焦虑 玄学 生活 电信 画图 监控 监控系统 直播源 直觉 磁盘 端口 端口冲突 端口扫描 第10天 第10类 第11天 第11类 第12天 第12类 第13天 第13类 第14天 第14类 第15类 第16天 第16类 第17类 第18类 第19类 第20类 第21类 第22类 第23类 第25类 第6天 第7天 第8天 第9天 第9类 管理 续期 网关 网络 网络风暴 群晖 脚本 脚本优化 腾讯 自动化 自动恢复 自建应用 自我反思 自我打脸 节点角色 虚拟机 被动意识到 角色不匹配 角色误判 角色误配 角色错配 认证 设计偏差 证书 语雀 误报 误报过滤 超时 路由 路由器 软件管家 软路由 运维 运维监控 进程 连接保活 连接问题 通信机制 通知 通知元递归 通知挖坑 通知本身 部署 部署链路 配置 配置落后 钉钉 镜像 镜像源 长期稳定 长连接 门窗传感器 问题排查 防火墙 阿里云 阿里源 集客 静默期 飞书

Hitokoto

Archive

You Won't Believe It - But I Still Can't Live Without tmux in the AI Era

You Won't Believe It - But I Still Can't Live Without tmux in the AI Era

You Won’t Believe It, But I Still Can’t Live Without tmux in the AI Era

说出来你们可能不信,都 2026 年了,AI 代码助手已经能帮你写完整项目了,但每天打开终端,我输入的第一个命令还是 tmux new -s work

说出来你们可能不信,都 2026 年了,AI 代码助手已经能帮你写完整项目了,但每天打开终端,我输入的第一个命令还是 tmux new -s work

It’s 2026. AI coding assistants can now write entire projects for you. But every single day, the first command I type into my terminal is still tmux new -s work.

A colleague asked me: “We’re in the AI era now. Why are you still using this 2007 relic?”

I said: “Relic? No. It’s the same old bottle, but filled with new wine.”

AI Is So Powerful — Why Can’t I Let Go of tmux?

Honestly, I did try the “modern” way of development.

For a while, I experimented with various AI programming tools — Cursor, Windsurf, Copilot Workspace. These tools are genuinely impressive. They can generate code, explain code, even refactor entire modules for you.

But every time I used them, I found my attention fragmenting.

Problem One: Too Many Windows

AI tools are usually web interfaces or standalone apps. To use AI to help you code, you have to:

  1. Open an editor to write code
  2. Switch to a browser to ask AI questions
  3. Copy AI’s answers back into the editor
  4. Run to see results
  5. Switch back to browser to continue

Every window switch interrupts your flow. Research shows it takes an average of 23 minutes to refocus after an interruption.

Problem Two: AI Output Is Too Long

AI responses are often wall-to-wall text. When I ask AI to “analyze this function’s performance,” it can produce a 500-line analysis report. Finding the key conclusion among all those lines? Your eyes go blurry.

Problem Three: SSH Disconnect = Work Lost

This is the most painful one. Sometimes I’m having AI generate a complex command, or debugging a tricky problem, when suddenly —

“Connection to server closed.”

SSH disconnects.

If I were using a regular terminal, I’d have to:

  1. SSH back in
  2. Try to remember where I was
  3. Re-run previous commands
  4. Discover some state is lost
  5. Have a mental breakdown

But now?

1
2
# After reconnecting to the server
tmux attach -t work

One second later, I’m right back where I left off. vim is on line 142, the AI terminal still has the conversation history, the log window is still scrolling. Every window, every state, preserved completely.

This is the magic of tmux sessions: Your work is a “living” state, not a “dead” terminal.

Part One: Split Panes Are the Right Way to Work with AI

What’s the correct way to use AI-assisted programming today?

My answer: tmux + vim + AI terminal + log monitoring, three windows open simultaneously, each doing its job.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
┌─────────────────────────────────┬──────────────────┐
│ vim - app.py │ AI Terminal
│ │ │
│ def handle_request(): │ >>> Analyzing... │
data = ai.analyze( │ Suggest: cache
prompt=queryComplexity: O(n)
│ ) │ │
│ return render(data) │ │
├─────────────────────────────────┴──────────────────┤
│ logs - tail -f │
│ [10:30:01] Request received │
│ [10:30:02] AI processing... │
│ [10:30:03] Response: 200 OK
└───────────────────────────────────────────────────┘

This is my daily standard layout:

Left vim: Write code, use vim-slime or copy-paste to bring in code snippets from AI

Right AI terminal: Ask AI questions, see AI’s analysis results, have AI review your code

Bottom log window: tail -f to see logs in real-time, verify AI’s code changes immediately

Three windows visible at once, no switching, no Alt+Tab, no getting lost between windows.

When AI tells me “there’s a problem with this code,” I just glance down at the log window to see if there’s actually an issue. When AI gives an optimization suggestion, I can edit it directly in vim while watching the logs for effect.

This “immersive AI programming” experience is way better than constantly switching between windows.

Part Two: Session Persistence — AI Tasks Don’t Fear Disconnection

This is the most important tmux feature, the one that made me completely dependent on it.

Scene replay:

3 PM. I’m having AI help me write a complex data processing pipeline. AI gave me 200 lines of code. I’m reading through it line by line, when suddenly —

“Connection to server closed.”

SSH disconnected.

With a regular terminal, I’d have to:

  1. SSH back in
  2. Try to remember where I was
  3. Re-run previous commands
  4. Discover some state is lost
  5. Mental breakdown

But now?

1
2
# After reconnecting to the server
tmux attach -t work

One second. Back to where I left off.

The lifecycle looks something like this:

1
2
3
4
5
[Session Active] --> [detach] --> [Session Detached but Running] --> [attach] --> [Session Active]
↓ ↓
Working normally SSH disconnected,
session preserved,
all state intact

detach and attach — this is the essence of tmux.

  • Ctrl+b d: Temporarily detach from session (session keeps running in background)
  • tmux attach: Reconnect to session (everything exactly as you left it)

With this, I’m never afraid of SSH disconnects. Heading home and suddenly remember an unfinished task? No problem. Tomorrow at work, tmux attach, continue where you left off.

Part Three: Copy-Mode — Precision Navigation in AI’s Long Output

One characteristic of AI output: It’s long. Very long.

Sometimes you ask AI a technical question, and it writes you a small essay. Code, explanations, suggestions, caveats — hundreds of lines.

Finding the few lines you actually need among hundreds? Scanning with your eyes? You’ll exhaust yourself.

But with tmux copy-mode, everything becomes simple.

Traditional copy-mode:

  1. Ctrl+b [ enter copy-mode
  2. Arrow keys to move line by line
  3. See something you want to copy? Space to start selection
  4. Enter to confirm
  5. Ctrl+b ] to paste

This is already pretty good, but tmux copy-mode has an even more powerful feature: Regex search jumping.

After entering copy-mode, press / to search. Want to find the handle_request function? /handle.*request, Enter, jump directly to the first match. Press n for next match, N for previous.

1
2
3
4
# In copy-mode
/handle.*request # Search for lines containing "handle" and "request"
n # Jump to next match
N # Jump to previous match

Imagine this scenario: AI gives you 500 lines of code analysis and refactoring suggestions, with a dozen places that need changes. Before, you’d scroll with your mouse until your eyes glazed over. Now? /, n n n, precisely locate every一处.

This is what tmux taught me: Good tools don’t give you more features — they get you to where you want to go more efficiently.

Part Four: My Modernized .tmux.conf

After using tmux for years, my configuration has evolved. Here are the options I think are most valuable in the AI era:

1. Key Binding Optimization — Save Your Pinky

The default prefix key is Ctrl+b. This combination isn’t kind to small hands (needing to press Ctrl and b simultaneously is tough on the pinky).

I changed it to Ctrl+a:

1
2
3
4
# ~/.tmux.conf
unbind C-b
set -g prefix C-a
bind C-a send-prefix

Now just press Ctrl+a. Way more comfortable than Ctrl+b.

2. Mouse Support — Operate tmux with Your Mouse

1
set -g mouse on

With mouse support enabled, you can:

  • Resize panes with mouse
  • Select text with mouse
  • Click to switch panes
  • Scroll history with mouse wheel

Very beginner-friendly for GUI users transitioning to terminal.

3. Status Bar Makeover — See State at a Glance

1
2
3
4
5
6
# Status bar shows richer information
set -g status-interval 5
set -g status-left "#[fg=green]tmux #[default]"
set -g status-right "#[fg=cyan]%Y-%m-%d %H:%M"
set -g window-status-format "#I:#W"
set -g window-status-current-format "#[fg=yellow,bold]#I:#W"

Status bar now shows current time, window list, current window highlighted.

4. Faster Response — Reduce Latency

1
2
3
4
5
# Reduce escape delay (important for vim users)
set -g escape-time 0

# Faster key sequences
set -g repeat-time 300

escape-time 0 is especially important for vim users because it reduces the delay between keypress and vim response.

5. Copy-Mode Optimization — Better Text Selection

1
2
3
4
5
6
# vi-style copy-mode
setw -g mode-keys vi

# Copy-mode shortcuts
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel

Using vi-style shortcuts for copy-mode means zero learning curve for vim users.

Part Five: tmux + AI = Multiplied Efficiency

After saying all this about tmux, someone might ask: In the AI era, where does tmux add value?

My understanding is this:

AI handles “thinking,” tmux handles “executing.”

AI’s strengths are generation, reasoning, explanation. What AI isn’t good at:

  • Long-running tasks
  • Real-time state monitoring
  • Maintaining context continuity
  • Multi-task parallel processing

These just happen to be tmux’s strengths.

Let me give a few concrete examples:

Example One: AI Generation + tmux Monitoring

Have AI generate a data processing script, run tail -f in tmux to watch logs in real-time, while AI explains errors in the log in another window. No switching, focus on one screen.

Example Two: AI Parallel Dialogues

Open multiple tmux panes, chat with different AIs simultaneously — one helps with frontend, one with backend, one with test cases. Three AIs working at once, efficiency multiplied.

Example Three: AI Debugging + Real-Time Verification

AI gives you a fix suggestion, edit it immediately in vim, watch the effect in the bottom log window. Not satisfied? Keep asking AI, keep editing, keep watching. The entire debug loop completes in one screen.

This is what I mean by “multiplied efficiency”: It’s not tmux making you faster, and not AI making you faster — it’s the combination that makes your workflow a smooth loop.

Reflection: From “Tools” to “Workflow” Thinking

While writing this article, I took stock of my tool usage habits over the years.

When I started working in 2015, I used putty to connect to servers, pure command line. Back then, the terminal was everything — the mouse was superfluous.

In 2018, I started using tmux. Wow, split panes are great, session persistence is great. But then VS Code came along with its powerful remote development plugins, and tmux got shelved again.

In 2023, AI arrived. Countless AI programming tools emerged. I tried pure GUI AI programming, but something always felt off.

Until 2025, when I picked up tmux again and realized: It’s not that GUI is bad, nor that AI is bad. It’s that they weren’t well integrated with each other.

tmux gave me a “container” — a space where I could integrate AI, vim, log monitoring, and various tools together. In this container, AI isn’t another window to switch to — it’s part of my workflow.

Good workflows don’t pile on tools. They make tools work together, each doing its job.

In the AI era, tools aren’t lacking. What’s lacking is people who can use tools efficiently.

What tmux taught me: Good workflows don’t need complex UIs. Simplicity is the ultimate efficiency.

Those flashy AI programming tools are genuinely powerful. But if your workflow design is poor, they just distract you. A simple tmux layout combined with the right AI tools lets you focus on what really matters — solving the problem itself.

The same old bottle, filled with new wine. Tools don’t age; only how we use them keeps evolving.


Author: A regular worker who still uses tmux in the AI era

Illustrations used in this article:

tmux layout diagram
Figure 1: My standard AI programming layout — vim + AI terminal + log monitoring trio

tmux session lifecycle
Figure 2: tmux session detach/attach lifecycle — don’t fear disconnects, work state preserved

tmux copy-mode search
Figure 3: tmux copy-mode regex search — precisely locate key content in AI’s long output

Author:Margrop
Link:http://blog.margrop.com/post/2026-05-10-tmux-in-ai-era/
版权声明:本文采用 CC BY-NC-SA 3.0 CN 协议进行许可