I have made a patch to screen 4.0.3 that supports the following syntax:
^A :readbuf !shell-command
This allows you to exec any arbitrary shell command and pipe the output into the screen buffer. Note that this is implemented by executing a subshell using popen
and copying the standard output to the current file specified in the bufferfile
setting (and then reading that file), so be careful you don't overwrite something you don't intend to. Also, this patch is probably terribly insecure so please use it at your own risk.
An example might be:
^A :readbuf !cat $HOME/projects/foobar/file.txt
Any shell command is executed literally as typed.
See gnu-screen-readbuf-exec on Github for the Git repository containing the patch.