stevenfalco

stevenfalco

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

@bphogan

I am attempting to use the commands at the top of page 59 of the beta 3.0 version of the tmux 3 book.

I get an error on this line:

set -g paste-command "xclip -sel clip -o"'

The error message is:

invalid option: paste-command

I looked at the manual page and while the copy-command is listed, there is no listing for the paste-command so it appears that that command doesn’t exist.

I am using Fedora 41 which provides tmux version 3.5a. I think that is the most recent version of tmux.

Please let me know if there is a revised command that takes the place of paste-command.

Marked As Solved

bphogan

bphogan

Author of Build Websites with Hugo (and 4 other titles)

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

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

Does this work for you?

# 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'

Popular Prag Prog topics Top

jimmykiang
This test is broken right out of the box… — FAIL: TestAgent (7.82s) agent_test.go:77: Error Trace: agent_test.go:77 agent_test.go:...
New
New
jon
Some minor things in the paper edition that says “3 2020” on the title page verso, not mentioned in the book’s errata online: p. 186 But...
New
jeffmcompsci
Title: Design and Build Great Web APIs - typo “https://company-atk.herokuapp.com/2258ie4t68jv” (page 19, third bullet in URL list) Typo:...
New
edruder
I thought that there might be interest in using the book with Rails 6.1 and Ruby 2.7.2. I’ll note what I needed to do differently here. ...
New
jdufour
Hello! On page xix of the preface, it says there is a community forum "… for help if your’re stuck on one of the exercises in this book… ...
New
raul
Page 28: It implements io.ReaderAt on the store type. Sorry if it’s a dumb question but was the io.ReaderAt supposed to be io.ReadAt? ...
New
swlaschin
The book has the same “Problem space/Solution space” diagram on page 18 as is on page 17. The correct Problem/Solution space diagrams ar...
New
New
tkhobbes
After some hassle, I was able to finally run bin/setup, now I have started the rails server but I get this error message right when I vis...
New

Other popular topics Top

Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1016 16836 371
New
malloryerik
Any thoughts on Svelte? Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue...
New
PragmaticBookshelf
A PragProg Hero’s Journey with Brian P. Hogan @bphogan Have you ever worried that your only legacy will be in the form of legacy...
New
AstonJ
Or looking forward to? :nerd_face:
New
New
AstonJ
Curious to know which languages and frameworks you’re all thinking about learning next :upside_down_face: Perhaps if there’s enough peop...
New
Rainer
My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New
Exadra37
On modern versions of macOS, you simply can’t power on your computer, launch a text editor or eBook reader, and write or read, without a ...
New
Exadra37
I am a Linux user since 2012, more or less, and I always use Ubuntu on my computers, and my last 2 laptops have been used Thinkpads, wher...
New
New

Latest in PragProg

View all threads ❯