Welcome to MacForumz.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

How to configure xterm?

 
   Macintosh computer (Home) -> System RSS
Next:  SILDoulos IPA 93 font in Word 2004  
Author Message
Tron Thomas

External


Since: Feb 03, 2004
Posts: 56



(Msg. 1) Posted: Tue Jul 27, 2004 9:10 pm
Post subject: How to configure xterm?
Archived from groups: comp>sys>mac>system (more info?)

I created a .profile file in my home directory which allows me to
configure the appearance of the Terminal application (i.e. adjusting
the prompt 'PS1').

However, when I run the X11 application and an instance of xterm
appears, xterm does not apply the settings in the .profile
congfiguration file.

What do I need to do to adjust the settings for xterm?

 >> Stay informed about: How to configure xterm? 
Back to top
Login to vote
Matt37

External


Since: Jul 28, 2004
Posts: 1



(Msg. 2) Posted: Wed Jul 28, 2004 6:55 am
Post subject: Re: How to configure xterm? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 27 Jul 2004 20:10:29 -0700,
Tron Thomas <tron.thomas RemoveThis @verizon.net> wrote:

 > What do I need to do to adjust the settings for xterm?

You have to explicitly tell to xterm to look at your .profile with the
"-ls" flag.

Either use "xterm -ls" in your .xinitrc or a call from X11.app's
application menu.

man xterm for more informations.

--
Un groupe spécifique aux débutants permettrai aux gens qui sont
"middle-class" de pouvoir continuer à se former et à aller plus
profond dans Linux.
-+-EF In : <http://www.le-gnu.net> - Fais moi tout -+-<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: How to configure xterm? 
Back to top
Login to vote
user40

External


Since: Jun 23, 2004
Posts: 40



(Msg. 3) Posted: Wed Jul 28, 2004 7:54 am
Post subject: Re: How to configure xterm? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <a4171f97.0407271910.48418ee4.TakeThisOut@posting.google.com>, tron.thomas.TakeThisOut@verizon.net (Tron Thomas) writes:
 >I created a .profile file in my home directory which allows me to
 >configure the appearance of the Terminal application (i.e. adjusting
 >the prompt 'PS1').
 >
 >However, when I run the X11 application and an instance of xterm
 >appears, xterm does not apply the settings in the .profile
 >congfiguration file.
 >
 >What do I need to do to adjust the settings for xterm?

FWIW, I've found that I could only use the .Xdefault's resources to
get the xterm setups I desired.

--
<a style='text-decoration: underline;' href="http://www.legacy-2000.com" target="_blank">http://www.legacy-2000.com</a> for the *best* OpenVMS system security
solutions that others only claim to be.
--
VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)COM

"Well my son, life is like a beanstalk, isn't it?"<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How to configure xterm? 
Back to top
Login to vote
noman

External


Since: May 18, 2004
Posts: 245



(Msg. 4) Posted: Wed Jul 28, 2004 7:54 am
Post subject: Re: How to configure xterm? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2004-07-28, Matt <forum DeleteThis @syrius.org> wrote:
 > You have to explicitly tell to xterm to look at your .profile with the
 > "-ls" flag.

Since the OP probably doesn't understand what this is all about it
might be useful to explain. ~/.profile is only used for login shells,
and xterm by default runs an ordinary shell, not a login shell. The
-ls forces it to run a login shell.

But there's no reason to do that. The prompt settings belongs in
~/.bashrc, which runs with every (interactive) shell, and not in
..profile, which only runs on login shells. Moving it to ~/.bashrc
will solve the problem for all terminal emulators.



 > man xterm for more informations.

Or man bash to understand more clearly what happens when.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How to configure xterm? 
Back to top
Login to vote
Bev A. Kupf1

External


Since: Sep 04, 2003
Posts: 978



(Msg. 5) Posted: Wed Jul 28, 2004 8:54 am
Post subject: Re: How to configure xterm? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 28 Jul 2004 11:47:22 GMT,
noman (noman@klassikal.net) wrote:
 > But there's no reason to do that. The prompt settings belongs in
 > ~/.bashrc, which runs with every (interactive) shell

~/.bashrc is _not_ read for every interactive shell. It is only
read for those interactive shells that are _not_ login shells.

Quoting from the bash manual page:
"When an interactive shell that is not a login shell is started, bash
reads and executes commands from ~/.bashrc, if that file exists. This
may be inhibited by using the --norc option."

 > , and not in
 > .profile, which only runs on login shells. Moving it to ~/.bashrc
 > will solve the problem for all terminal emulators.

So, no - moving it to ~/.bashrc will _not_ solve the problem for all
terminal emulators.

 >
 > Or man bash to understand more clearly what happens when.

You're an odd one to be giving that advice, don't you think?

BTW, this behaviour in bash is true for versions upto the current
version (3.0 -- that was released yesterday).
--
Bev A. Kupf
"The lyfe so short, the craft so long to lerne" -- Chaucer
JWolf - more flavours than Baskin Robbins - <a style='text-decoration: underline;' href="http://macconsult.com/diaperboy/" target="_blank">http://macconsult.com/diaperboy/</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How to configure xterm? 
Back to top
Login to vote
noman

External


Since: May 18, 2004
Posts: 245



(Msg. 6) Posted: Wed Jul 28, 2004 8:54 am
Post subject: Re: How to configure xterm? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2004-07-28, Bev A. Kupf <bevakupf RemoveThis @myhome.net> wrote:
 > ~/.bashrc is _not_ read for every interactive shell. It is only
 > read for those interactive shells that are _not_ login shells.

Yes, you're right. I should have taken my own advice and read the man
page. I don't use bash unless I have to, and when I do, I have my
environment configured so that everything happens in .bashrc (I can
think of no reason ever to start a new interactive shell without
wanting a standard environment) and .profile just sources .bashrc.
Since this is such obviously sensible behavior, and since I set it up
many many years ago, I forgot that I had to do it manually.



 > So, no - moving it to ~/.bashrc will _not_ solve the problem for all
 > terminal emulators.

Calm down. It will if you set up your environment sensibly. See
above.



 > You're an odd one to be giving that advice, don't you think?

Unlike you I occasionally make mistakes, which I always freely admit
to. What's it like to be perfect Bev?<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How to configure xterm? 
Back to top
Login to vote
Bev A. Kupf1

External


Since: Sep 04, 2003
Posts: 978



(Msg. 7) Posted: Wed Jul 28, 2004 9:54 am
Post subject: Re: How to configure xterm? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 28 Jul 2004 12:45:11 GMT,
noman (noman@klassikal.net) wrote:
  >> You're an odd one to be giving that advice, don't you think?
 >
 > Unlike you I occasionally make mistakes, which I always freely admit
 > to. What's it like to be perfect Bev?

Go back and read the text of your follow-up to Matt. My response was
directed at your taking him to task for giving an accurate and
perfectly acceptable solution (launch xterm with the '-ls' option).

(or did you forget the tone & content of your follow-up?)

As for being perfect, I would never claim that - but thank you for
the compliment.

--
Bev A. Kupf
"The lyfe so short, the craft so long to lerne" -- Chaucer
JWolf - more flavours than Baskin Robbins - <a style='text-decoration: underline;' href="http://macconsult.com/diaperboy/" target="_blank">http://macconsult.com/diaperboy/</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How to configure xterm? 
Back to top
Login to vote
Greg Shenaut1

External


Since: Apr 03, 2004
Posts: 122



(Msg. 8) Posted: Wed Jul 28, 2004 9:54 am
Post subject: Re: How to configure xterm? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Matt <forum RemoveThis @syrius.org> exponit:
 > On 27 Jul 2004 20:10:29 -0700,
 > Tron Thomas <tron.thomas RemoveThis @verizon.net> wrote:
 >
  >> What do I need to do to adjust the settings for xterm?
 >
 > You have to explicitly tell to xterm to look at your .profile with the
 > "-ls" flag.

Another approach is to use "-e login -fp $USER" at the end of the xterm command.

Greg Shenaut<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How to configure xterm? 
Back to top
Login to vote
noman

External


Since: May 18, 2004
Posts: 245



(Msg. 9) Posted: Wed Jul 28, 2004 9:54 am
Post subject: Re: How to configure xterm? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2004-07-28, Bev A. Kupf <bevakupf DeleteThis @myhome.net> wrote:
  >> Unlike you I occasionally make mistakes, which I always freely admit
  >> to. What's it like to be perfect Bev?
 >
 > Go back and read the text of your follow-up to Matt.

Done.


 > My response was
 > directed at your taking him to task

No one was "taken to task" here. I don't believe the correct answer
to the question "how do I get my preferrred prompt in an xterm" (which
is effectively what the OP wanted to know) is "always run a login
shell". I also don't think it's a good idea to tell someone to do
something relatively arcane (like "add -ls") without explaining why.
I pointed these things out, quite matter of factly.

Now go back and read the text of your followup to mine. Compare and
contrast.



 > (or did you forget the tone & content of your follow-up?)

Nope, I didn't. My memory's not the greatest anymore -- witness my
forgetting of the bash startup procedure -- but it's not as bad as all
that. The tone was neutral; the content was flawed in the way you
were so delighted to point out, though not as off the mark as you seem
to want it to be. Fundamentally it was imo the right answer: don't do
this only for login shells. Since bash is not my default shell I
forgot an essential step, which you unintentionally reminded me of:
it's always a good idea to source .bashrc from .profile.




 > As for being perfect, I would never claim that - but thank you for
 > the compliment.

Thank you for my confirming my suspicions.



Bev and her perfection aside, here's my preferred solution:

- Move the prompt handling from ~/.profile to ~/.bashrc

- Add a line to ~/.profile so that it sources ~/.bashrc

- Run login shells only if you think it's appropriate, and not just
because you happened to put something in .profile which you really
want to apply to all interactive shells.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How to configure xterm? 
Back to top
Login to vote
Display posts from previous:   
   Macintosh computer (Home) -> System All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]