In the last episode (Feb 27), Hanspeter Roth said:
> On Feb 27 at 15:48, Giorgos Keramidas spoke:
> > On 2003-02-27 12:39, Hanspeter Roth <[EMAIL PROTECTED]> wrote:
> > > Hello,
> > > how can I determine the active console?
> > 
> > Use the tty(1) command:
> But I'd like to know the console that has got the keyboard focus by
> switching with <ctrl>-<alt>-<fN>.

Use the undocumented VT_GETACTIVE ioctl on stdin (or anything else
connected to a vty) which will return the active vty number.  You can
also disable vty switching, programmatically switch to a particular
vty, and do other neat stuff.  Take a look at
/usr/src/usr.sbin/vidcontrolfor usage examples and
/usr/src/sys/dev/syscons/syscons.c for all the possible ioctls.

        Dan Nelson

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message

Reply via email to