I've got a shell script which outputs shell commands which are supposed to be copy-pasted with the mouse from one terminal window to another (I can test it in the same window though). The output should not contain any significant whitespace characters other than plain space, and the output lines should be truncated so that the code can be copied properly even on terminals where soft line breaks are copied as hard line breaks. I'd like to make sure. I'm thinking something like this:
$ eval `resize -s 24 80` $ reset $ my_script $ mouse_copy *all of the terminal history except for the first line* $ mouse_paste $ assert *the paste created the proper result*
Emulating this with something like
xclip would be nice, if possible.
The script should run on a custom Linux server which has no X. I don't know how in detail how the terminal output is sent to the client, but maybe the script would have to ask the X server on the client side what it's currently displaying?