First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 90907
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Mamoru KOMACHI (RETIRED) <usata@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Tom Martin (RETIRED) <slarti@gentoo.org>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
prompt_gentoo_setup prompt_gentoo_setup text/plain Mamoru KOMACHI (RETIRED) 2005-05-04 11:14 0000 1.19 KB Details
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 90907 depends on: Show dependency tree
Show dependency graph
Bug 90907 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)







View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2005-04-29 15:13 0000
From /usr/share/zsh/4.2.5/functions/Prompts/prompt_gentoo_setup:

  precmd  () { prompt_gentoo_precmd }
  preexec () { }

I don't know what exactly this is for, but it's *extremely frustrating*. If I do "prompt gentoo" before I redefine precmd and preexec in my zshrc then the prompt isn't set at all and I get the default prompt, and if I define it after then my precmd and preexec functions are overridden.

Thanks,
Tom

------- Comment #1 From Mamoru KOMACHI (RETIRED) 2005-05-03 00:05:02 0000 -------
Sorry but I don't understand what you are talking about.

If I do "prompt gentoo" before I redefine precmd and preexec,
the redefined precmd/preexec are used; and if I define precmd
and preexec before "prompt gentoo" then my precmd and preexec 
are overridden.

------- Comment #2 From Tom Martin (RETIRED) 2005-05-03 12:36:39 0000 -------
Hmm. Even if I trim down my zshrc to *just* the precmd/preexec and autoload -U
promptinit; promptinit; prompt gentoo, then I get the same result: if I do
prompt gentoo before I redefine precmd/preexec, I get the default prompt...
hostname%.

------- Comment #3 From Mamoru KOMACHI (RETIRED) 2005-05-04 11:14:27 0000 -------
Created an attachment (id=58047) [edit]
prompt_gentoo_setup

Now I understand what you mean.

Does this fix your problem? You must call `prompt gentoo` before
defining your precmd/preexec, but this should keep gentoo prompt
when you have your own precmd/preexec.

If this is okay I'll commit it to CVS.

------- Comment #4 From Tom Martin (RETIRED) 2005-05-04 11:33:40 0000 -------
Wonderful, this fixes it. Thank you!

Tom

------- Comment #5 From Mamoru KOMACHI (RETIRED) 2005-05-05 08:14:27 0000 -------
ok, it's in CVS ;)

------- Comment #6 From Tom Martin (RETIRED) 2005-05-07 12:41:44 0000 -------
Hmm, okay, this fixes the issue mentioned in the bug initiallity, but it
creates a new one. The prompt is the same for root user as it is for ordinary
user, that is, green and blue rather than red and blue.

------- Comment #7 From Mamoru KOMACHI (RETIRED) 2005-05-22 07:07:43 0000 -------
It works well on my box (red and blue for root).
Could you show me the instruction to reproduce your problem?

mine:
usata@rico ~ % su -
rico root # zsh (<= red and blue, but bash)
\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\]autoload -U promptinit
\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\]promptinit
\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\]prompt gentoo
rico ~ # (<= red and blue)

------- Comment #8 From Tom Martin (RETIRED) 2005-05-22 07:42:40 0000 -------
Yeah, I take exactly the same steps:

tmartin@pohl ~ % su
Password: 
pohl tmartin # zsh (bash; red and blue)
pohl# autoload -U promptinit (default zsh, white)
pohl# promptinit
pohl# prompt gentoo
root@pohl tmartin # (green and blue)

I have no .zshrc for root.

------- Comment #9 From Mamoru KOMACHI (RETIRED) 2005-05-22 08:02:39 0000 -------
You need to append '-' in order to prevent new user's shell
to inherit environment variables.

usata@rico ~ % su - (<- you see, '-' is important)

Now I understand what the problem is, and know how to
revert back, but I think the current (new) behaviour is the
right setting because if you do not append '-' almost all
variables are inherited, including $HOME and $USER, so
the prompt should also be inherited from previous user's.
What do you think?

------- Comment #10 From Tom Martin (RETIRED) 2005-05-22 09:21:13 0000 -------
I understand :)

I'm just going to have to tame my bad habits ;)

Ready to RESOLVE?

Thanks,
Tom

------- Comment #11 From Mamoru KOMACHI (RETIRED) 2005-05-22 09:27:25 0000 -------
Yup ;)

First Last Prev Next    No search results available      Search page      Enter new bug