[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: x-terminal-emulator & xterm



* Andy Saxena (andyML@nyc.rr.com) [020505 23:16]:
> Hi,
> 
> For some reason, when I invoke x-terminal-emulator, which points to
> xterm, results in different background, foreground, etc. settings than
> if I were to invoke xterm directly.
> 
It has to do with the way xterm loads its X Resources. These may be
specified in your ~/.Xresources file. For example, in mine, I have some
settings like these:

XTerm*scrollBar:	on
xterm-mutt*scrollBar:	false

now, when I invoke xterm via "xterm -name mutt", I get an xterm without
a scrollbar. If I invoke just plain "xterm", I get a scrollbar. That
shows specifying the name explicitly on the command line; it defaults to
the name by which the xterm was called. For example, I could create a
symlink with "ln -s /usr/X11R6/bin/xterm xterm-mutt" and invoke
./xterm-mutt without any arguments, and the xterm-mutt X resources would
be used. In your case, different resources are being loaded for
'x-terminal-emulator' and 'xterm'.

> In general, if xterm is invoked via a symlink, the result is different!
> I was under the impression that invoking a program via a symlink is
> transparent as far as the execution context of the program is concerned.

It is on some levels; the symlink is dereferenced to get to the actual
code of the executable. A program can tell how it was called by looking
at argv[0], though. You should get the same result if you copy (instead
of symlinking) to a different name and running the copy. With the
symlink, the execution is identical, but the environment (containing the
command line) is different.

good times,
Vineet

-- 
Currently seeking opportunities in the SF Bay Area
Please see http://www.doorstop.net/resume.shtml

Attachment: pgpAAW7qxgoFd.pgp
Description: PGP signature


Reply to: