Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh 3pre2: carriage return in prompt
- X-seq: zsh-users 283
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxx>
- To: luomat@xxxxxxxx
- Subject: Re: zsh 3pre2: carriage return in prompt
- Date: Thu, 11 Jul 1996 15:55:42 +0200 (MET DST)
- Cc: zsh-users@xxxxxxxxxxxxxxx
- In-reply-to: <199607110601.CAA00860@xxxxxxxx> from "Timothy J. Luoma" at "Jul 11, 96 02:01:31 am"
- Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary
- Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368
>
> I had been using this as my prompt:
>
> PROMPT='[%h] [OLD: $OLDPWD] [CURRENT: %~] $(echo "\n")'
>
> That gave me the information I wanted, and a carriage return at the
> end of the line, so my commands always began at the left margin.
>
> This no longer works with 3.pre2. Has something changed that makes
> this impossible? All I want is something that looks like this:
Yes. Quote from man zshexpn:
COMMAND SUBSTITUTION
A command enclosed in parentheses preceded by a dollar
sign, like so: $(...) or quoted with grave accents: `...`
is replaced with its standard output, with any trailing
newlines deleted.
But really using $(echo "\n") is a quite expensive solution. It requires a
fork(). You can just simply write
PROMPT='[%h] [OLD: $OLDPWD] [CURRENT: %~]
'
If you use csh_junkie_paren, turn it of, or put a backslash at the end of
the line.
Zoltan
Messages sorted by:
Reverse Date,
Date,
Thread,
Author