Copy/Paste, Byobu, Scrollback Mode
I hope that you find this article when you have the same trouble that I had figuring out how to copy text to the system clipboard on Linux in Byobu’s scrollback mode.
What To Do
- Enter Scrollback mode by pressing
F7
. - Scroll until you can see the text that you’d like to copy.
- Turn Mouse mode to on by pressing
Alt+F12
. You’ll see “Mouse: ON” - Hold
Shift
and use the mouse/trackpad to select the text that you’d like to copy. You’ll see the selected text highlighted. PressShift+Ctrl+c
to copy. If you have a system clipboard viewer, then verify that the selected text has reached the clipboard. - Turn Mouse mode back to off by pressing
Alt+F12
again. You’ll see “Mouse: OFF” - Leave Scrollback mode by pressing
Ctrl+c
.
Yay!
Holding Shift
while selecting the text seems to be the critical part. Without Shift
, Byobu (screen?) pastes the text immediately then discards it, rather than pasting it into the system clipboard. You can imagine how frustrating that was for me.
Reference
Stack Overflow, “Straightforward way of copying text from byobu to system clipboard?”. Thank you to user gcuendet
. This told me that we need Shift
when selecting the text to copy.