From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@sunsite.dk
Subject: Re: Help help, prompt problems here!
Date: Mon, 09 May 2005 02:35:10 +0000 [thread overview]
Message-ID: <1050509023510.ZM9684@candle.brasslantern.com> (raw)
In-Reply-To: <20050508193722.8F67C1CE303@ws1-6.us4.outblaze.com>
On May 8, 2:37pm, Fafa Hafiz Krantz wrote:
}
} I am having some difficulty on one of the two boxes I installed
} zsh on today. The box having problems won't let no prompt appear
} unless I type CTRL+C. Even after I do that, it's not the prompt
} I've specified in /etc/zshrc.
As a general principle, you should be very careful of what you put into
the /etc/z* files, as opposed the $HOME/.z* files of each user.
For example:
} prompt elite2 green
}
} if [[ `whoami` = root ]] then
} prompt elite2 red
} fi
This would be much better handled by placing "prompt elite2 red" in
~root/.zshrc and "prompt elite2 green" in ~fteg/.zshrc (or whatever
your non-root user account is, if it's not "fteg").
However, if you must test for root in /etc/z*, the best way is simply
to check with [[ $EUID = 0 ]] or even (( EUID == 0 )).
Returning to the original problem -- it seems likely that either (a)
there's something in /etc/zshenv that you're not telling us about, and
that something is stuck, possibly waiting for input, until you hit the
ctrl+c, or (b) `whoam` itself is stuck for some reason, and when you
hit ctrl+c it fails, so the "if" fails, so "prompt elite2 red" is not
executed.
You could find out which of these things is happening by placing a
"set -x" at the top of /etc/zshenv, or by running "zsh -x".
} Also, I need help modifying the theme 'elite2' into looking just
} a little bit better.
Find the prompt_elite2_setup file with this:
print ${^fpath}/prompt_elite2_setup(N)
Copy that file to a new name in some directory in $fpath (it does not
have to be the same directory), such as prompt_fteg_setup -- the string
between the underscores is the theme name, so this is creating a new
theme named "fteg".
Edit prompt_fteg_setup and globally search-and-replace to change all
occurrences of "elite2" to "fteg". Then find the assignment to PS1,
right in the middle of the prompt_fteg_setup function, and remove the
substring
$parens($text%!$punctuation_color/$text%y$parens)$text
That'll leave you with two consective meta+d (0xc4) characters, of which
you should delete one. I think it was bad form of the elite2 author to
leave raw non-ascii characters there, but the entire "for code in ..."
loop is extraneous as well ... it appears just to be sloppy or incomplete
copying from prompt_elite_setup.
Anyway, in that same long ugly assignment, the time is displayed with
%D{%I:%M%P}
and the date with
%D{%m/%d/%y}
you need to edit the stuff inside the { } to change the format. See
"man strftime" for details.
Having finished with those edits and saved the file so that it's in
a directory in $fpath the next time zsh starts up, you should be able
to change "prompt elite2 green" to "prompt fteg green".
next prev parent reply other threads:[~2005-05-09 2:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-08 19:37 Fafa Hafiz Krantz
2005-05-09 2:35 ` Bart Schaefer [this message]
2005-05-09 9:39 ` Peter Stephenson
2005-05-09 16:27 Fafa Hafiz Krantz
2005-05-09 16:59 Fafa Hafiz Krantz
2005-05-10 2:55 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1050509023510.ZM9684@candle.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).