From owner-freebsd-questions@FreeBSD.ORG Fri Oct 13 01:58:44 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 81B5916A412 for ; Fri, 13 Oct 2006 01:58:44 +0000 (UTC) (envelope-from MTaylor@bytecraft.com.au) Received: from bcmelmx.bytecraft.au.com (bcmelmx.bytecraft.au.com [203.39.118.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7698743D5A for ; Fri, 13 Oct 2006 01:58:42 +0000 (GMT) (envelope-from MTaylor@bytecraft.com.au) Received: from svmarshal2.bytecraft.internal (svmarshal2.bytecraft.internal [10.0.0.3]) by bcmelmx.bytecraft.au.com (8.12.11/8.12.11) with ESMTP id k9D1wOBu080658; Fri, 13 Oct 2006 11:58:39 +1000 (EST) (envelope-from MTaylor@bytecraft.com.au) Received: from svmailmel.bytecraft.internal (Not Verified[10.0.0.24]) by svmarshal2.bytecraft.internal with MailMarshal (v6, 1, 4, 441) id ; Fri, 13 Oct 2006 11:58:23 +1000 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Date: Fri, 13 Oct 2006 11:58:29 +1000 Message-ID: <04E232FDCD9FBE43857F7066CAD3C0F11EF9BF@svmailmel.bytecraft.internal> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Question re ncurses and the various ttys Thread-Index: AcbuRnUJ7L2ATxy4Qk+U/6CVIIMq3wAJGvdA From: "Murray Taylor" To: "Raaf" , Cc: Subject: RE: Question re ncurses and the various ttys X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2006 01:58:44 -0000 =20 > -----Original Message----- > From: Raaf [mailto:freebsd@luna.afraid.org]=20 > Sent: Friday, 13 October 2006 7:36 AM > To: freebsd-questions@freebsd.org > Cc: Murray Taylor > Subject: Re: Question re ncurses and the various ttys >=20 > > Hi all > >=20 > > I've been digging around in the various man pages and=20 > havent yet found > > the=20 > > incantations I require. > >=20 > > Goal: to create a curses driven status screen that can run=20 > without user > > intervention. > >=20 > > I want to know if it is possible to _programatically_ switch to an > > unused=20 > > virtual tty, >=20 > Yes it is certainly possible, i have done this recently=20 > myself and like > you i couldn't find how to do it in any man page. Fortunately=20 > i could find > the answer in the xorg-server source code. >=20 > You just open one of the virtual terminals and issue the VT_ACTIVATE > ioctl: >=20 > fd =3D open("/dev/ttyv9",O_RDONLY); > ioctl(fd,VT_ACTIVATE,10); >=20 > > and then use this as the display page. > > ( By unused I mean marked 'off' in /etc/ttys ) >=20 >=20 > Well, the above code only switches the active vt... >=20 > If you want your program output to go to a certain vt you=20 > probably have > to open the specific vt and replace the stdin and stdout file=20 > descriptors > of your program with the one of the one of the vt you just opened. >=20 > But there are probably some caveats to this method, so best=20 > is to take a > look at the getty source code and maybe add your program to /etc/ttys. >=20 Thank you - this is probably the incantation I need along with the=20 curses newterm / setterm calls cheers mjt =20 --------------------------------------------------------------- The information transmitted in this e-mail is for the exclusive use of the intended addressee and may contain confidential and/or privileged material. Any review, re-transmission, dissemination or other use of it, or the taking of any action in reliance upon this information by persons and/or entities other than the intended recipient is prohibited. If you received this in error, please inform the sender and/or addressee immediately and delete the material.=20 E-mails may not be secure, may contain computer viruses and may be corrupted in transmission. Please carefully check this e-mail (and any attachment) accordingly. No warranties are given and no liability is accepted for any loss or damage caused by such matters. --------------------------------------------------------------- ### This e-mail message has been scanned for Viruses by Bytecraft ###