1

I use byobu in tmux mode. In screen I can do this:

Ctrl+a [, move to line, Y, Ctrl+a ]

"Y" copys the whole line into the clipboard. I am looking to something similar in byobu in tmux mode. The only thing I found is:

Ctrl+a/b (depends on your setting) + [, move to line, 0, space, $, enter, Ctrl+a/b + ]

But I feel like that is a lot of hard to reach keystrokes, Y is much easier.

0

A bit of an improvement: do space, V, enter instead of 0, space, $, enter. A single V is a lot easier to type than a 0 and a $. V is equivalent to vim's "do visual mode select of entire line" command.

I can't speak to byobu directly but since it's just fronting tmux, you could also bind a key to all this in native tmux. Something like this:

bind-key -r -T copy-mode-vi Y send-keys -X begin-selection \; send-keys -X select-line \; send-keys -X copy-selection

Then you just enter copy mode, go to the line you want to copy, press Y then Enter. The line will now be in the paste buffer. (While that's a bit long and ugly it does work for me.)

Edit: Tested with tmux 2.4

|improve this answer|||||
0

I have in my ~/.byobu/.tmux.conf

bind-key -t vi-copy 'v' begin-selection                                                                                                                                 
bind-key -t vi-copy 'y' copy-selection

so normally I can enter in copy mode by:

Prefix + [

then I can use vi commands to navigate and enter vi select mode by 'v' yank the selection by 'y'

after that I can put/paste in the terminal by:

Prefix + ]

In order to copy a line:

    Prefix + [
    navigate to the line
    $ (jump to the end)
    Left Arrow
    v (begin-selection)
    0 (jump to the start of the line)
    y (yank and exit copy mode)

    Prefix + ] (paste the line)
|improve this answer|||||
0

I've found the answer for the original question.

You need the following line in the config:

bind-key -T copy-mode-vi Y send-keys -X end-of-line \; send-keys -X cursor-left \; send-keys -X begin-selection \; send-keys -X start-of-line \; send-keys -X copy-selection-and-cancel
|improve this answer|||||
-1

Because of newer Tmux version I had to change my config:

bind-key -T copy-mode-vi v send-keys -X begin-selection                                                                                                                 
bind-key -T copy-mode-vi y send-keys -X copy-selection \; send-keys -X cancel

Thanks to 'rushiagr' (http://www.rushiagr.com/blog/2016/06/16/everything-you-need-to-know-about-tmux-copy-pasting-ubuntu)

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.