From: Peter Stephenson <pws@csr.com>
To: "Renato Botelho" <rbgarga@gmail.com>
Cc: zsh-workers@sunsite.dk
Subject: Re: Completion damaging prompt
Date: Fri, 09 May 2008 14:06:41 +0100 [thread overview]
Message-ID: <200805091306.m49D6fcj000412@news01.csr.com> (raw)
In-Reply-To: <747dc8f30805090551j3d26f810ud868028403ab8d9f@mail.gmail.com>
"Renato Botelho" wrote:
> I'm using zsh 4.3.6 at FreeBSD 7.0, and I noted a problem with prompt
> in some cases,
> following is an example
>
> garga@botelhor:~> sudo su
>
> root@botelhor:/home/garga#
>
> root@botelhor:/home/garga# pkg<TAB>
>..
> And if I clear the screen using ^L prompt changes to ~garga
>
> root@botelhor:~garga#
That means something, somewhere in shell code is referring to your home
directory as ~garga (which would expand to /home/garga). After that's
happened once it's treated as a candidate for abbreviation wherever name
directories are valid. You have various choices:
- If you want to track down what it is, you'll probably need to get
the completion system to output debug information with "^X?". This
could be time-consuming to get completely to the bottom of.
- If you always want directories to be shown in full, you can replace
%~ in your path with %/. That will show /home/garga instead of ~ when
you're not root, however.
- If you want the prompt to be abbreviated only when you're not root,
you can change it to
PROMPT='%n@%B%m%b:%(#.%/#.%~>) '
- If you're happy with your home directory always being abbreviated when
you're root, so that at least it doesn't change, you can put a reference
to it in the initialisation file:
: ~garga
--
Peter Stephenson <pws@csr.com> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
next prev parent reply other threads:[~2008-05-09 13:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-09 12:51 Renato Botelho
2008-05-09 13:06 ` Peter Stephenson [this message]
2008-05-09 14:41 ` Bart Schaefer
2008-05-09 16:40 ` Renato Botelho
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=200805091306.m49D6fcj000412@news01.csr.com \
--to=pws@csr.com \
--cc=rbgarga@gmail.com \
--cc=zsh-workers@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).