# Tmux 3: paste-command not recognized (pg 59)

**URL:** <https://forum.devtalk.com/t/tmux-3-paste-command-not-recognized-pg-59/189651>\
**Category:** PragProg Customers\
**Tags:** question, book-tmux-3\
**Created:** [3 March 2025 18:08 UTC](https://forum.devtalk.com/t/tmux-3-paste-command-not-recognized-pg-59/189651 "2025-03-03T18:08:15Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![bphogan](https://forum.devtalk.com/user_avatar/forum.devtalk.com/bphogan/32/756_2.png) [@bphogan](https://forum.devtalk.com/u/bphogan)\
**Post date:** [27 March 2025 17:13 UTC](https://forum.devtalk.com/t/tmux-3-paste-command-not-recognized-pg-59/189651/2 "2025-03-27T17:13:23Z")

</div>

Hi @stevenfalco. Thanks for raising this. It looks like I goofed and an old version of the file made its way into the book. ☹

It’s supposed to use @ variables, not the commands themselves.

Does this work for you?

```auto
# Detect the display server protocol and set clipboard commands
if-shell '["$XDG_SESSION_TYPE" = "wayland"]' \
    'set -g @copy_command "wl-copy"; \
     set -g @paste_command "wl-paste -n"' \
    'set -g @copy_command "xclip -sel clip -i"; \
     set -g @paste_command "xclip -sel clip -o"'

# Prefix Ctrl-C takes what's in the buffer and sends it to system clipboard
# via the command stored in the variable.
bind C-c run-shell 'tmux save-buffer - | #{@copy_command}'

# y in copy mode takes selection and sends it to system clipboard via the
# command stored in the variable.
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "#{@copy_command}"

# Prefix Ctrl-v fills tmux buffer from system clipboard, then
# pastes from buffer into tmux window
bind C-v run-shell '#{@paste_command} | tmux load-buffer - \; paste-buffer'

```

---

_[View the full topic](https://forum.devtalk.com/t/tmux-3-paste-command-not-recognized-pg-59/189651)._
