--- Hugo Vanwoerkom <hvw...@ya...> wrote:
<snip>
>
> But in bruby-2.4.29 you can copy from any vc but gpm
> pastes ALWAYS into the first vc, never into the
> others.
>
I can't find where in Bruby that is supposed to
happen. So I changed gpm to paste to tty<x> instead of
to tty0 (this is in gpm-1.19.6 the Debian version:
1.20.1 has problems)
--- gpm-1.19.6/src/gpm.c~ 2005-01-31
07:09:58.000000000 -0600
+++ gpm-1.19.6/src/gpm.c 2005-01-31 10:09:33.000000000
-0600
@@ -149,14 +149,32 @@
/*-------------------------------------------------------------------*/
/* The old console options is removed. We are taking
stderr now
* In the next update there should also be support
for syslog
+ * HVW - 01/31/2005 Changed to use /dev/ttyx instead
of /dev/tty0:
+ * in Bruby /dev/tty0 is the first
vc, not the current one (BUG)
********************************************************************/
static inline int open_console(const int mode)
{
- int fd;
-
- if ((fd=open(consolename, mode)) < 0)
- oops(consolename);
+ int fd;
+ int i;
+ char buffer1[12];
+ static struct vt_stat stat;
+
+// First open tty0 which is wrongly always pointing
to vc0
+ if ((fd=open(consolename, mode)) < 0)
+ oops(consolename);
+// Then get the active vc: it points correctly
+// Make a /dev/tty<x> with <x> to the active vc
+ if (ioctl(fd,VT_GETSTATE,&stat)<0)
+ oops(consolename);
+ i = stat.v_active;
+ sprintf(buffer1,"/dev/tty%d",i);
+ close(fd);
+// Now open that one instead...
+ if ((fd=open(buffer1, mode)) < 0)
+ oops(consolename);
+// if ((fd=open(consolename, mode)) < 0)
+// oops(consolename);
return fd;
}
I also have a Debian deb of gpm for it.
Hugo.
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo
|