Subject: Re: chvt for netbsd/wscons?
To: Karsten Kruse <tecneeq@tecneeq.de>
From: Dan LaBell <dan4l-nospam@verizon.net>
List: netbsd-help
Date: 07/13/2005 18:31:09
On Jul 9, 2005, at 8:38 PM, Karsten Kruse wrote:
> Dan LaBell wrote:
>
>> Is there a chvt or equivalent way to change from one virtual screen to
>> another another , programmatically ? Any ioctl or other os interface?
>> I'm guessing stuffing the terminal input buffer via TIOCSTI will not
>> work ( wrong layer, not low enough ).
>
> http://mail-index.netbsd.org/netbsd-users/2002/11/13/0007.html
>
> Works for me.
>
Thanks, I needed: options WSDISPLAY_COMPAT_USL
for the ioctl, I had trimmed it, thinking it was just another
compatibility feature.
After adding it, it worked fine, and I don't think I could have
understand it w/o sample code.
I was kinda of hoping there would be something in the form of taking a
file descriptor
to the vt, rather than passing the screen number. So instead of:
fd=open("/dev/ttyECfg", O_RDWR, 0 );
ioctl(fd,VT_ACTIVATE,screen);
something like:
fd=open("/dev/ttyE1", O_RDRW, 0);
ioctl(fd, VT_ACTIVATE); /* *** */
leading to a shell-util where one could just do vtactivate $( tty ),
or possibly, it could just take /dev/tty, or straight STDIN_FILENO.
Of course, I could wrap it, to get that idiom, which I guess I'll leave
as an exercise to myself.