Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to paste text copied in a paste buffer to a different window with some keybinding, without having to leave the current window? I.e., instead of going to the window and doing a Ctr-a + ], giving a gnu screen command and the name of the receiving window?

share|improve this question
    
Other than having the other windows reading constantly from /tmp/screen-exchange, I don't think so. – Stefan Seidel Sep 18 '12 at 13:08

You could make a bind to create such a keybinding in your screenrc, because there is none.

Depending on how you wanted to implement it (is it for a named screen whose name is known?), the following screen functions could be useful to you:

  • copy ( C-a esc / C-a [ ) to make your copy of the current window
  • writebuf (C-a > ) to write /tmp/screen-exchange
  • readbuf ( C-a < ) to read in the other /tmp/screen-exchange
  • paste . ( C-a ] / C-a C-] ) to write the paste on the other window
  • at [identifier][#|*|%] command [args ...] to make other windows process the two former commands from the specified original window, without leaving it (through a keybind or directly at the screen commandline C-a : ).
share|improve this answer

While this does not directly answer your question I strongly recommend switching from screen to tmux if possible. Tmux is screen on steroids.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .