Margrop
Articles386
Tags755
Categories7

Categories

1password 2K 3.6 Flash 30s timeout 4-bit 量化 6-DoF SLAM AC ACL ACL 切换 ACP AI AI Agent AI Coding Assistant AI Tech AI 安全 AI 日记 AI编程助手 AI辅助 AI辅助编程 AP API ARC-AGI-3 ASR Agent Agent Harness Agent 入侵 Agent 检索 Agent 沙箱 Agent 系统 Agent 路由 AgentPlan Agentic AI Agentic tools Ai2 Alertmanager Android 17 Antigravity AppDaemon AppWorld Aqara Attention Baseten Blog CC-Switch CI/CD CLI Tools CLI 工具 CLI工具 CPU 推理 CSRF Cache Hit Rate Caddy Categories 404 Claude Code Claude Sonnet ClawLoader Cloudflare Code Interpreter Codex Coding Plan Coding Plan Dashboard ComfyUI Computer Use Context Compression Cookie 认证 Cosmos-H-Dreams Cost Optimization Cron D1 DFIR Date DeepSeek V4 Flash Diagrams.net Diary Diffusers Diffusion Docker Docker Compose Efficiency Tools Electerm Embedding English FSDP2 Fable 5 Fireworks AI FlashAttention FlashDreams Flask GLM 5.2 GLM-5.2 GPT-4.1 GPT-5.6 GPT-Live GPT-Red GPU 加速 GPU 性能分析 Gateway Gemini Gemini 3.5 Flash Gemini API Gemini CLI Gemini Omni Flash Gemma 4 12B GitHub GitHub Actions Google Google AI Grabette Gripette HA HADashboard Hailuo Hermes HermesAgent Hexo HomeAssistant Hugging Face Hugo IBM Research IP IPv4 Inference Providers Isaac Lab Java KV cache Kimi Code Kimi K3 Kubernetes LFM2.5 LLM Router LVM‑Thin LeRobot Linux Liquid AI Live Translate LoRA MCP MacOS Managed Agents Markdown Memory 上限 Microsoft 365 Copilot MiniMax Model Routing MuJoCo Warp Multi-Agent MySQL NAS NVIDIA NeMo Automodel Nemotron 3 Embed NewAPI Newton Nginx Node-RED Node.js Nunchaku OOM OlmoEarth On-device AI Open Source Open Viking OpenAI OpenAI 兼容 OpenClaw OpenCode OpenResty OpenWrt PII 检测 PPPoE Physical AI Pollen Robotics Portainer PostgreSQL ProcessOn Prometheus Prompt Injection Proxmox VE PyTorch Qwen3-VL RPC RTEB Real-Time Inference Red Teaming Responses API Restart SIGTERM SNAP SOCKS5 SOCKS5 代理 SPED SSL SVDQuant Scientific Computing Self-Forcing Distillation Session Shell Skill 管理 Subagent Surgical Robotics Synology NAS TTS TimeMachine UML Uptime Kuma VPN VPS VoiceEQ WARP Web WebRTC WebSocket Windows Workers World Foundation Model activate ad adb adblock agent aligenie aliyun alpine annotation aop authy autofs backup baidupan bash bg-review bitwarden boot brew browser budget control caddy2 cdn centos cert certbot charles chat chrome classloader client clone closures cloudflare cmd command commit conn_id container cron 排错 crontab cross_sync ctyun ddsm demo dependency deploy developer devtools disconnect topic dll dns docker domain download draw drawio dsm dump dylib easytier edge environment hooks exception exit code 1 export fail2ban feign firewall-cmd flow free tier frp frpc frps fuckgfw full-duplex function fuzzy match gateway gcc gfw git github golang gperftools gridea grub gvt-g hacs havcs heap hello hexo hibernate hidpi hoisting homeassistant hosts html htmlparser https huggingface_hub iKuai iMessage idea image img img2kvm immortalwrt import index install intel io ios ip iptables iptv ipv6 iso java javascript jetbrains jni jnilib jpa js json jsonb jupter jupyterlab jvm k8s keepalive keepalive ping timeout kernel key kid kms kodi koolproxy koolproxyr kvm lan lastpass launchctl learning lede letsencrypt linux live low-code lvm lxc m3u8 mac macos mariadb markdown maven md5 mdadm memory 上限 microcode mirror modem modules monitor mount mstsc mysql n2n n5105 nas network nfs no close frame node node-red nodejs nohup notepad++ npm nssm ntp one-api 容器 oop openfeign openssl openviking os otp ovz p14 packet capture pat pdf pem perf ping pip plugin png powerbutton print pro proxy pve pvekclean python qcow2 qemu qemu-guest-agent rar reboot reflog remote remote desktop renew repo resize retina root route router rule rules runtime safari sata scheduled triggers scipy-notebook scoping scp self-play server serverless inference silent test skill_manage slmgr so socks source spk spring springboot springfox ssh ssl stash string supernode support svg svn swagger sync synology systemctl systemd tap tap-windows tapwindows telecom template terminal tls tmux token totp tvbox txt ubuntu udisk ui undertow uninstall unlocker upgrade url v2ray vLLM vhd viking_search vim vlmcsd vm vmdk web websocket wechat windows with worker wow xiaoya xml yum zip 上下文压缩 个人品牌 中国电信 临时关权限 临时提权 云电脑 交换机 人才争夺 人机协作 代理 企业 AI 优化 体检 供应链 值班 健康检查 光猫 公众号 公网IP 内存 内存优化 内容发布 内网 内网IP 内网渗透 写作 分布式推理 分布式训练 升级 协作 协作习惯 协议层 单平台型异常 博客 博客同步 博客改名 博客运维 卫星影像 反向代理 反诉 变更审计 可靠性 后台 Review 启动 告警 告警优化 周一 周一傍晚 周一焦虑 周三傍晚 周五 周六 周四傍晚 周四晚 周报 周日 周末 回滚 地球观测 地理空间推理 夏令时 多协议并发 多智能体 多模态 多节点 多节点管理 多通道并发 大厂人才战 天猫精灵 天翼云 失败模式 字体大小 安全 安全事件 安全意识 安装 定时任务 实时语音 客户端 SDK 容器 容器网络 导入 小米 工作感悟 工具审计 工具白名单 工具调用 工具调用拦截 工程团队 工程实践 工程笔记 常用软件 并发窗口 广告屏蔽 序列号 应用市场 开放 API 开权重 开源模型 开源项目 异常 异步任务 异步委派 微信 微信公众号 微信限流 心智成长 心跳 心跳检查 性能优化 感悟 成本控制 打工 打工人 打工人日记 扩散模型 技术 抓包 按 provider 优先级 排查 排障思路 推理加速 描述文件 故障 故障恢复 故障排查 效率 效率工具 数据 文本编码器 旁路由 无服务器 日志排查 日记 时区 时段权限 显卡虚拟化 智能体集成 智能家居 智能音箱 服务器 服务管理 本地安装 机器人仿真 机器人数据采集 权限管理 架构 框架级切片 梯子 模块 模型推理 模型路由 残存访问 治理层 流式推理 流程 流程图 浏览器 漫游 激活 火山引擎 火绒 灾难恢复 焦虑 独立仓库 玄学 生活 电信 画图 监控 监控系统 监管 直播源 直觉 磁盘 磁盘故障 稀疏样本 稀疏注意力 立体声 端口 端口冲突 端口扫描 管理 续期 网关 网络 网络风暴 群晖 群晖 NAS 脚本 脚本优化 腾讯 自动化 自动化反思 自动化运维 自动恢复 自动攻击 自动重启 自动重连 苹果 虚拟机 视频生成 认证 证书 评测基准 评测方法学 诉讼 语雀 语音 AI 质量检查 超时 跨平台 路由 路由器 软件管家 软路由 运维 运维日常 运维监控 进程生命周期 连接保活 连接问题 通信机制 通知 邮件漏发 部署 配置 钉钉 钉钉断开 镜像 镜像源 长上下文 长连接 门窗传感器 问题排查 防火墙 阿里云 阿里源 集客 需求变更 飞书

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:https://blog.margrop.com/post/2026-05-10-tmux-in-ai-era/
版权声明:本文采用 CC BY-NC-SA 3.0 CN 协议进行许可