#+TITLE: tmux copy-mode keys aligned with Emacs vterm-copy-mode #+DATE: 2026-05-18 * Source Authored from a =~/.emacs.d= session. Edit lives in this repo because =~/.tmux.conf= is the stowed symlink target. * Change Added a copy-mode key block to =dotfiles/common/.tmux.conf= (just below =set -g status-keys emacs=) to mirror the Emacs =cj/vterm-tmux-history= / =vterm-copy-mode= ergonomics in =~/.emacs.d/modules/vterm-config.el=: #+begin_src tmux bind-key -T copy-mode M-w send-keys -X copy-selection bind-key -T copy-mode C-g send-keys -X cancel unbind-key -T copy-mode Enter #+end_src Behavior: - =M-w= copies the selection and stays in copy-mode, so multiple selections can be grabbed in a row. tmux's default copied and then exited via =copy-selection-and-cancel=. - =C-g= now exits copy-mode (tmux's default was =clear-selection=). - =Enter= is unbound so RET has no "copy and exit" shortcut. The Emacs side removes RET from =vterm-copy-mode-map= for the same reason — one consistent way to leave the buffer. Defaults retained: - =q= and =Escape= already cancel. - =Space= still begins selection. * Why The Emacs side already aligned =vterm-copy-mode= and =cj/vterm-tmux-history= on one key story (commentary block at the top of =modules/vterm-config.el=). When tmux runs inside vterm, the user also lands in tmux's copy-mode (via the auto-enter on mouse wheel-up, line 10), so without this change the third surface had a different key story — Enter exits, M-w exits, C-g clears rather than cancels. * Activation After pulling and re-stowing on each machine: #+begin_src bash tmux source-file ~/.tmux.conf #+end_src Or in a live tmux session: =prefix r= (configured at line 53 of the conf). * Status Edited and saved. Not yet committed in =archsetup=. Craig confirms the keys work, then commits at his discretion.