[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: accessing the Linux clipboard



Raphael Tennenbaum wrote:
any linuxyers know how to read/write this? I seem to remember some discussion a few years back.
There are actually two means of copying text in linux.
One uses the "selection buffer." any text highlighted in a window can be copied by pressing the "middle" mouse button (usually these days the wheel or left-and-right-button combo). The text being copied into dosemu/xy copies nicely, but that going out resembles what's captured when you mark text in a Windows DOS box.
The clipboard (ctrl-x, ctrl-v) can accessed from dosemu/xy, but I have
had some problems doing so. There are programs to manipulate the
clipboard (xsel, xclip -- you need to install them) but the ability to
use those programs from dosemu seems to have limits. The following Xy4
commands allowed me to import text copied to the clipboard:
BX (do/nv unix xclip -o -selection c > /home/pgl/data/clip/toxy)BX (me
\clip\toxy)
"unix" is the dosemu command that permits the use of unix commands, in
this instance the "xclip" program to copy the primary X windows
clipboard to the file "toxy", which is then merged at the cursor
location. (Of course, I did have a CR/LF mismatch, but it otherwise
worked reasonably well) I was never able to get the reverse of this,
sending a Xy4 selection to the clipboard using xclip or xsel, to work
properly.
BX (sas/nv \clip\toxy)BX (do/nv unix xclip -i -selection c <
/home/pgl/data/clip/toxy)
will copy highlighted Xy4 text to the X windows clipboard, but Dosemu/Xy
becomes unstable. I wasn't sure what I was doing wrong (or even if I was
doing something wrong, to be honest), and I gave up fiddling with it
because it was largely an academic exercise for me.

Paul