mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Baudis <pasky@pasky.ji.cz>
To: Jiri Mencak <j.mencak@hud.ac.uk>
Cc: gpm@lists.linux.it, linux-kernel@vger.kernel.org
Subject: Re: gpmselection
Date: Sun, 7 Apr 2002 23:44:45 +0200	[thread overview]
Message-ID: <20020407214445.GD3218@pasky.ji.cz> (raw)
In-Reply-To: <20020407205703.GB30641@mencak.homeip.net> <20020407214024.GC3218@pasky.ji.cz>

Oops, this time with the correct Cc: stuff, sorry :).

Dear diary, on Sun, Apr 07, 2002 at 10:57:03PM CEST, I got a letter,
where Jiri Mencak <j.mencak@hud.ac.uk> told me, that...
> Do you know any program or even better a gpm feature via which I could 
> access GPM selection? Say I wanted to select text `Hello World!' on 
> a text console using GPM and then this program (let's call it 
> `gpmselection') would output to stdout:
> 
> % gpmselection
> Hello World!
> 
> It would be nice to write to gpm selection as well. Say by writing:
> % echo "Hello World!" | gpmselection
> 
> it would be possible to paste `Hello World!' on a console.
> 
> What I am aiming at is an echange of data between X and a console. I 
> have a program `xsel' which does the same thing with X-Window selection.

This is a problem. Been there, wanted to do that. However, you cry on the wrong
grave. GPM doesn't itself handle this stuff, kernel does. Yes, it's
fundamentally bad design, no, you can't directly access kernel's selection
buffer. Yes, this change would be probably welcomed in 2.5.x. I wanted to do
it, but I've too little time for that these days :(.

The stuff you want to rewrite is at /usr/src/linux/drivers/char/selection.c,
maybe random bits at /usr/src/linux/drivers/char/vt.c. And, obviously GPM, as
you want to move this functionality there. You probably want to completely
remove concept of selections from kernel, make GPM to read content of
/dev/vcc/X when grabbing a selection and output proper escape sequences for
inverting the appropriate stuff (this may be tricky; maybe you want to keep
such mechanism in the kernel.. you'll see), add write handler for /dev/vcc/X to
the kernel so that you can simulate keyboard input on the terminal and finally
make some generic API inside GPM for manipulation with the selection buffer.

Have fun ;),

-- 
 
				Petr "Pasky" Baudis
 
* ELinks maintainer                * IPv6 guy (XS26 co-coordinator)
* IRCnet operator                  * FreeCiv AI hacker
.
Teamwork is essential -- it allows you to blame someone else.
.
Public PGP key && geekcode && homepage: http://pasky.ji.cz/~pasky/

       reply	other threads:[~2002-04-07 21:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20020407205703.GB30641@mencak.homeip.net>
     [not found] ` <20020407214024.GC3218@pasky.ji.cz>
2002-04-07 21:44   ` Petr Baudis [this message]
2002-04-08  6:30     ` [gpm]Re: gpmselection Alessandro Rubini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020407214445.GD3218@pasky.ji.cz \
    --to=pasky@pasky.ji.cz \
    --cc=gpm@lists.linux.it \
    --cc=j.mencak@hud.ac.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®