Subject: Re: Two X servers running simultaneously using wscons
To: None <netbsd-help@netbsd.org>
From: James K. Lowden <jklowden@schemamania.org>
List: netbsd-help
Date: 04/10/2002 00:21:55
On Mon, 8 Apr 2002 23:25:20 -0700 (PDT) "B. James Phillippe"
<bryan-spamtrap0@darkforest.org> wrote:

> On the flaccid day of Apr 9, James K. Lowden penned:
> 
> > On Tue, 9 Apr 2002 00:54:13 -0400 Andrew Brown <atatat@atatdot.net>
> > wrote:> >Can anyone tell me why my prompt in xterms doesn't reflect
> > the prompt> >in my .profile?  When I log in, I get a prompt like
> > > >"jklowden@home.schemamania.org$", but every xterm starts off with
> > > >"bash-2.04$ " until I issue ". .profile".  
> 
> Are you starting your xterm with "-ls", for (L)ogin (S)hell?

No, and that does fix it, thanks.  

A little more experimentation leads me to the conclusion that mine is a
Gnome question, or something silly in my startx.  If I start a second X
server for a user with no .xinitrc or anything, I land in twm of course,
and all my xterms have the right prompt.  So maybe gnome-session is
goofing with my environment.  More trial and error needed, evidently.  

But I think my first question really was about NetBSD: How are X servers
mapped to virtual consoles?  

Trying to answer that question for myself led me to the wscons man pages
(again).  This time, I think I get it: by not specifying any "screen type"
or "terminal emulation" (cf. wsdisplay(4)) for the virtual terminal
allocated by wsconscfg, we apparently leave it available for X.  

wscons.conf describes the virtual terminals.  It is read by
/etc/rc.d/wscons, which calls wsconscfg.  My wscons.conf is pretty
ordinary:

$ grep -v ^# /etc/wscons.conf |grep -v ^$
font    ibm     -       8       ibm     /usr/share/wscons/fonts/vt220l.808
screen  1       80x50   vt100
screen  2       80x50   vt100
screen  3       80x50   vt100
screen  4       -       -
mux             1

and the magic is in "screen 4", which being otherwise unspoken for goes to
X?  The hint is on the wsdisplay man page: "non-emulating displays can
only be used by special programs like X servers".  

By issuing "wsconscfg 5", I was able to get a second X server to map to
F6.  

But is that the right way to do it?  How why or if ttys gets involved, is
a complete mystery to me.  

TIA.

--jkl