Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Dec 1995 13:13:48 -0800
From:      Eric Blood <eblood@winky.reno.nv.us>
To:        James FitzGibbon <james@else.net>
Cc:        questions@freebsd.org
Subject:   Re: Commandline switch vty ? 
Message-ID:  <199512282113.NAA02322@winky.reno.nv.us>
In-Reply-To: Your message of "Thu, 28 Dec 1995 13:12:30 EST." <Pine.LNX.3.91.951228131035.1424A-100000@else.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <Pine.LNX.3.91.951228131035.1424A-100000@else.net>you write:
>Does anyone know of a way to change the current vty from the command line? 

Upon examining the source for syscons (/usr/src/sys/i386/isa/syscons.c), it
recognizes ANSI character sequences.  One of the codes is ESC[nz.  This
will change to the nth console.  With this following program, you can
switch to a given console at the command line:

escape.c

void main(int argc, char **argv) {

   if (argc == 2) 
      printf("%c%s\n", '\x1b', argv[1]);
}

In order to switch to the second console (ttyv1) you would do 
"escape [1z".

Good luck.

Eric Blood
eblood@cs.unr.edu, http://www.cs.unr.edu/~eblood



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199512282113.NAA02322>