Is there a command in GNU Screen to direct standard output to the copy buffer
I've been doing alot of work with files, it's great to copy and past the filenames I want into commands
e.g.
ls | grep proc
$ ls | grep cal
calendar.inc-gen.php
// enter copy mode
$^a y
// backward search for gen_chg
? cal
// start region
SPC
//goto to end of file by forward search php
php
// done
ENT
// type command line
$ git rm ^p
// creates
$ git rm calendar.inc-gen.php
I'm aware there are easier ways to do this with a bash script, but often I find myself needed a specialized piece of information from the terminal screen and it would be great to just type
ls | grep cal > To_GNU_SREEN_COPY_:) or something
dennis's solution below works
you may need to set the bufferfile in your .screenrc bufferfile /tmp/screen-exchange
Here's one way:
The gnu-screen Copy / Scrollback Buffer is located at register
.
To send a string to the Copy / Scrollback buffer from a shell within the screen session you can use the
register
command like so:However, if this command is running from a script, as is likely the case then you will need to specify the screen server name.
This command will also pull the value from a shell variable without the need for echo:
Specifying the window is not required, however this is how you would do it.