I spent an hour debugging my .tcshrc file last night and thought that I
would pass this tidbit along. The upshot is that you shouldn't have
$DISPLAY defined unless you really have X11 running.  I had added a line in
my .tcshrc that set DISPLAY to ":0.0". My rationale is that I only ever run
X11 utilities locally, so it would save some typing.

Well, it turns out that /sw/bin/init.csh actually runs some X11 utilities
when it sees that DISPLAY is defined. If XDarwin isn't running, it will
take a long time for the utilities to time out. For example, I was adding
some aliases to .tcshrc and I typed "source .tcshrc" to see if they worked.
That source command inadvertently launched an X11 utility that took a good
while to time out. For the longest time, I thought it was the alias causing
problems. The final straw that sent me to hunt down the bug was that I had
problems writing files from vim.  I have in my .vimrc

   au BufWritePost,FileWritePost *.txt,*.c,*.asm silent
!/Developer/Tools/SetFile -t TEXT "%"

This automatically sets the MacOS X file type of files with .txt .c and
.asm extensions to TEXT when I save the file in vim. This is so MacOS X
utilities would open them properly.  Well, the auto command fired up a
shell which read my .tcshrc which ran /sw/bin/init.csh which ran
/sw/etc/profile.d/xfont.csh which checked that DISPLAY was set and ran
/sw/bin/xfontpath which hung. (What does xfontpath do anyway? and is it
really good practice to launch it without checking that XDarwin is
running?)  Needless, to say, I was not happy not being able to save from my
editor correctly. (BTW, the fix in vim is to set shellcmdflag=-fc which
tells the shell not to read .tcshrc.)

Anyway, a shaggy dog story, but I thought others might find it useful to
not set DISPLAY unless XDarwin is really running.

Richard


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Fink-beginners mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-beginners

Reply via email to