TIL: One escape sequence makes my terminal follow my AI agent into a worktree

The thing that made me grin today: I tell Claude Code to “work in a git worktree,” the agent jumps into a fresh checkout, and my Ghostty terminal follows it — new tabs and splits open right inside the worktree, not where I launched. The agent moves; the terminal moves with it. Feels like magic, and it’s one escape sequence.

A bit about OSC

Escape sequences aren’t just colors. OSC — Operating System Command — is the family that sends side-channel messages to your terminal: window title, clipboard, and the one here, the current directory (OSC 7):

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论