Copying Between GNU Screen buffers
Posted on November 10, 2009, under GNU/Linux.
GNU Screen is one of those tools that makes you think “How the %&@# did I live without this for so long?!” If you work on command lines regularly, GNU Screen is a must.
In my desktop environment, I run Konsole and Yakuake, with a different Screen session in each[1]. A few days ago, I noticed that I was using the mouse to copy text between these Screen sessions. How inefficient is that?
It turns out that there’s a really easy way to copy text between different Screen sessions.
Note: I use CTRL-J as my escape command.
Copy some text to the first Screen’s buffer, and type ^J:writebuf . Now switch to your other Screen session, and type ^J:readbuf . Your second Screen session has just grabbed what you copied in your first Screen session. Paste it wherever you want, and Bob’s your uncle.
[1] These Screen sessions are different on purpose. My Yakuake session is for “throw-away” tasks that don’t necessarily pertain to any tasks that I’m currently working on.