Escape sequences & console
A message that is not in the archive (sent off-list or not yet received): "[email protected]
Quoted 6 lines · Sébastien HINDERER
According to
linux/drivers/console.c, functionsetterm_commands, case 12, one can change the virtual console by sending an escape sequence to/dev/cnsole(what I want to do), hower, this is not documented in man pages.From the source of the chvt program:
if (ioctl(fd,VT_ACTIVATE,num)) {
perror("chvt: VT_ACTIVATE");
exit(1);
}
if (ioctl(fd,VT_WAITACTIVE,num)) {
perror("VT_WAITACTIVE");
exit(1);
}Where fd is /dev/tty, /dev/tty0, /dev/console or std{in,out,err} (From the source, I doubt this ioctl works on all of those).
Simon
Signature · 4 lines
GPG public key available from http://phobos.fs.tum.de/pgp/Simon.Richter.asc Fingerprint: DC26 EB8D 1F35 4F44 2934 7583 DBB6 F98D 9198 3292 Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread! UP: 10:29pm up 7 days, 3:40, 8 users, load average: 3.67, 4.43, 4.69
Followup to: <Pine.LNX.4.31.0103022208050.30419-100000@phobos.fachschaften.tu-muenchen.de> By author: Simon Richter <[email protected]> In newsgroup: linux.dev.kernel
Quoted 12 lines
From the source of the chvt program:
if (ioctl(fd,VT_ACTIVATE,num)) { perror("chvt: VT_ACTIVATE"); exit(1); } if (ioctl(fd,VT_WAITACTIVE,num)) { perror("VT_WAITACTIVE"); exit(1); }
Quoted 3 lines
Where fd is
/dev/tty,/dev/tty0,/dev/consoleor std{in,out,err} (From the source, I doubt this ioctl works on all of those).
/dev/tty0 would be the correct device (tty0 = current virtual console.)
-hpa
Signature · 3 lines
<[email protected]> at work, <[email protected]> in private! "Unix gives you enough rope to shoot yourself in the foot." http://www.zytor.com/~hpa/puzzle.txt