All notes tagged with tmux.

Copy/Paste for OpenCode with Ghostty and Tmux

I like to work on my remote server in a tmux instance that has all my projects set up and running, and is available from everywhere, including my phone these days. One pet peeve was that copy‑paste wasn’t working in OpenCode. After some debugging, I got it working with:

Ghostty: allow OSC52 clipboard access

copy-on-select = clipboard
clipboard-read = allow
clipboard-write = allow

tmux: allow OSC52 passthrough

# Allow passthrough for OSC52 clipboard sequences
set -g allow-passthrough on

Result: it now works! Go build something beautiful.

Changing working directory in tmux

I tend to keep a long-lived tmux session per project that I’m working on. When I want to start a new project though, it carries the old working directory with it. I keep forgetting what I need to do to type it, so hopefully this TIL makes me remember it for the next time.

To switch the current working directory, do a :attach -c <newdir>. And to do it it even more easily, I bound it in my tmux configuration to Meta-w:

bind M-w attach -c "#{pane_current_path}"