From owner-freebsd-questions Thu Feb 27 15:56:25 2003 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 2379637B401 for ; Thu, 27 Feb 2003 15:56:24 -0800 (PST) Received: from imo-r07.mx.aol.com (imo-r07.mx.aol.com [152.163.225.103]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4A33F43F93 for ; Thu, 27 Feb 2003 15:56:23 -0800 (PST) (envelope-from Dave2206@aol.com) Received: from Dave2206@aol.com by imo-r07.mx.aol.com (mail_out_v34.21.) id n.28.344a99cd (4560) for ; Thu, 27 Feb 2003 18:56:20 -0500 (EST) From: Dave2206@aol.com Message-ID: <28.344a99cd.2b8fffa4@aol.com> Date: Thu, 27 Feb 2003 18:56:20 EST Subject: Re: determining active console To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: AOL 4.0 for Windows 95 sub 124 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In a message dated 2/27/03 1:01:23 PM Central Standard Time, keramida@ceid.upatras.gr writes: > On 2003-02-27 17:58, Hanspeter Roth wrote: > > On Feb 27 at 15:48, Giorgos Keramidas spoke: > > > On 2003-02-27 12:39, Hanspeter Roth wrote: > > > > Hello, > > > > how can I determine the active console? > > > > > > Use the tty(1) command: > > > > But this seems to yield the tty from which the command was launched. > > So if I do > > > > sleep 9; tty > > Hmmm, this is the "definition" of a virtual console. You can run > long-running commands on one and still switch to another. > > > and then switch to an another console, that `tty` yields the tty > > that was active when the command line was started. > > Yep. That's the idea. > > > But I'd like to know the console that has got the keyboard focus by > > switching with --. > > So, run "tty" on the console *after* switching to it :-) > > This may be somthing you can add to your prompt. Depending on your shell of course cdw To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message