[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OFFTOPIC: How about a /dev/clipboard ?



Apologies for reordering this posting, but I deleted the original.

Quoting Lazarus Long (lazarus@frontiernet.net):

>  > Jim Foltz wrote:
>  > > Hello,
>  > >
>  > > There are times when I need to cut and paste the output from a command
>  > > line program into a graphical program. The problem occurs when the output
>  > > is more than one screen long. I just thought it would be quite nice to
>  > > be able to redirect the output into /dev/clipboard, then switch to the
>  > > graphical program and use the mouse to paste it from /dev/clipboard to
>  > > where I need it.
>  > >
>  > > Is there a mechanism already in place to handle this?

Well, if you run the command-line program in an xterm, and you make that
xterm have a small font and stretch over several desktops, then you can
handle fairly large chucks of output. I run a default fvwm2 3x3 desk and
I have an 80x434 line xterm running down it. Of course, it takes three
wipes and some care to copy the whole lot, so I'm not suggesting it
scales as well as a clipboard would.

> On Wednesday, May 26, 1999 at 11:05:04 -0500, Jens B. Jorgensen wrote:
>  > That's a good idea. However, rather than /dev/X all you need is an X program which
>  > would read from standard input and put whatever it gets there onto the clipboard. Now
>  > that you mention this I'm surprised someone hasn't done it.
> 
> Wouldn't that require he be *in* X11 with his command line app at
> the time?

Agreed. What I would find useful is to "put down a mark" in an xterm
(equivalent to typing "script" except that the session in the xterm
might be running in a captive non-shell account on a remote machine)
and have everything that xterm displays from that point put into a
clipboard.

The kernel is not involved - xterm would do it. It's like "capture on"
in those old terminal emulation programs.

Then you need to "capture off" and paste it just like gpm does.

It might be trickier for copying *from* graphical applications
(not in xterms) because there's not necessarily a linear flow of
information onto the screen.

> I can think of many reasons why he couldn't be, such as with another
> account in a different tty.  (Screen is notorious for not allowing you to
> attach to an already-running session in an xterm if started by a different
> account.)  Many of us use different accounts to "compartmentalize" tasks,
> such as for various clients/customers.
> 
> The ability to paste an error message from one session into another in
> order to get help is useful, but so far, gpm will only allow it with
> other console sessions, AFAICT.

Well, no; it also works all over the X display. (Some things like
mc require you to Shift while selecting.)

> Is there a means to go about this when "switch to the graphical program"
> (below) means "switch from the tty running the command line app into
> X11 and the graphical program already running there"?
> 
> How about vice-versa?
> 
> This, btw, is yet-another-reason some ppl avoid X apps whenever possible;
> they're too incompatible with standard command line apps at times.
> If that changed, there might be less resistance to GUIs in general.
> (Well, maybe! :) )

Alternatively, you can just use X *all* the time and learn the few
wrinkles that involves. For example, Home and End vomit if used in
ae/xterm but not ae/VC. About the only thing I use VCs for now I've
got a huge default font is root sessions, as it avoids absent-mindedly
typing into one of my 14 xterms and finding I'm unintentionally root.

Cheers,

-- 
Email:  d.wright@open.ac.uk   Tel: +44 1908 653 739  Fax: +44 1908 655 151
Snail:  David Wright, Earth Science Dept., Milton Keynes, England, MK7 6AA
Disclaimer:   These addresses are only for reaching me, and do not signify
official stationery. Views expressed here are either my own or plagiarised.


Reply to: