• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Eliminating the xterm
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Eliminating the xterm


  • Subject: Re: Eliminating the xterm
  • From: "Nathaniel Gray" <email@hidden>
  • Date: Tue, 20 Nov 2007 11:30:02 -0800

On Nov 20, 2007 2:41 AM, Martin Costabel <email@hidden> wrote:
> Jeremy Huddleston wrote:
> > Honestly, I think that's not a good idea.  For one thing, X11.app (which
> > has the preferences you are talking about) doesn't launch xterm at
> > start.  The /A/U/X11.app executes the command 'xterm' then quits.  xterm
> > then connects to the $DISPLAY socket.  launchd starts /u/X/X11.app (the
> > one with the preferences) which launches Xquartz, etc...
>
> Reasonably, there should be a PreferencePane that you can open with
> System Preferences, without having to run X11.app. And instead of (or in
> addition to) the Dock item, there should be a menu bar item, similar to
> what you have for Bluetooth, Airport or Spaces. Then you could run
> the entries from the X11 Applications menu from that menu bar drop-down
> menu, also without having to start X11.app first. This would solve a lot
> of the usability problems.

I basically like this idea, but I don't know how you would account for
all the windows that have no dock icons.

> As for the so-called race condition, I don't think there really is one.
> When you start xterm in order to launch X11, xterm has already "won" the
> race, because it starts before the X server gets a chance to read any
> Xresources file. What can be done is to run a short script along the
> lines of the traditional xinit/xinitrc script, only without starting a
> window manager, and *then* run xterm (or not if the user does not want
> one); something like the following (note that the first 'xrdb' already
> wakes up launchd and starts the X server):
>
>    PATH=${PATH}:/usr/X11/bin
>    if [ -f "$HOME/.Xresources" ]; then
>      xrdb -merge "$HOME/.Xresources"
>    fi
>    if [ -f "$HOME/.Xmodmap" ]; then
>      xmodmap "$HOME/.Xmodmap"
>    fi
>    xterm -ls &
>
>
> A minimal version (tested inside your Xterm.app) would be
>
>    /usr/X11/bin/xrdb -merge "$HOME/.Xresources"
>    /usr/X11/bin/xterm -ls &
>
> If this does not work, then you can speak of a race condition, but for
> me it worked all the time.

No surprise there -- if you don't run xterm until xrdb has finished
then of course there's no race condition.  The hypothesized race
condition (I'll admit I haven't verified that there is one for sure)
goes something like this, if I understand it properly:

1. You click Xterm.app, which runs xterm
2. xterm tries to open DISPLAY
3. launchd starts X11.app
4. X11.app runs xinitrc, which includes the command "xrdb -merge ~/.Xresources"
5. launchd successfully opens DISPLAY  (Note: this may happen before
4.  I'm not sure.  But it doesn't really matter.)

xrdb and xterm are now running concurrently, and it's a race to see if
xrdb writes the X resources database before xterm reads it.  xterm has
a pretty good head start, but Jeremy's experience suggests that with
some configurations xrdb can reliably win.

Cheers,
-n8

--
>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- http://mojave.cs.caltech.edu -->
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list      (email@hidden)

This email sent to email@hidden

  • Follow-Ups:
    • Re: Eliminating the xterm
      • From: Merton Campbell Crockett <email@hidden>
References: 
 >Fwd: Eliminating the xterm (From: "Nathaniel Gray" <email@hidden>)
 >Re: Eliminating the xterm (From: Bill Campbell <email@hidden>)
 >Re: Eliminating the xterm (From: "Mark E. Perkins" <email@hidden>)
 >Re: Eliminating the xterm (From: Martin Costabel <email@hidden>)
 >Re: Eliminating the xterm (From: Ben Byer <email@hidden>)
 >Re: Eliminating the xterm (From: Jeremy Huddleston <email@hidden>)
 >Re: Eliminating the xterm (From: Ben Byer <email@hidden>)
 >Re: Eliminating the xterm (From: Ralph Martin <email@hidden>)
 >Re: Eliminating the xterm (From: Jeremy Huddleston <email@hidden>)
 >Re: Eliminating the xterm (From: Martin Costabel <email@hidden>)

  • Prev by Date: Re: Daydreaming (was: Re: 1.3a1)
  • Next by Date: Re: 1.3a1 - (Was: Re: Where's Ben?)
  • Previous by thread: Re: Eliminating the xterm
  • Next by thread: Re: Eliminating the xterm
  • Index(es):
    • Date
    • Thread