From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27892 invoked from network); 9 Nov 1998 15:19:57 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 9 Nov 1998 15:19:57 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id KAA19657; Mon, 9 Nov 1998 10:17:01 -0500 (EST) Resent-Date: Mon, 9 Nov 1998 10:16:52 -0500 (EST) From: Phil Pennock Message-Id: <199811091519.PAA00513@athenaeum.demon.co.uk> Subject: Re: New-line in prompt In-Reply-To: from "Owen M. Astley" at "Nov 9, 98 01:27:28 pm" To: oma1000@cam.ac.uk Date: Mon, 9 Nov 1998 15:19:09 +0000 (GMT) Cc: zsh-users@math.gatech.edu X-Disclaimer-1: Any views expressed in this message, where not explicitly X-Disclaimer-2: attributed otherwise, are mine and mine alone. Such views X-Disclaimer-3: do not necessarily coincide with those of any organisation X-Disclaimer-4: or company with which I am or have been affiliated. X-Phase-of-Moon: The Moon is Waning Gibbous (66% of Full) X-Mailer: ELM [version 2.4ME+ PL37 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"eUUvc1.0.Ao4.ZTmHs"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1932 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Typing away merrily, Owen M. Astley produced the immortal words: > I am trying to get a new line (\n) in a prompt (actually I only want the > new line if the current one is too long). Has anybody got any idea about > how to do this? %{\n%} works but, as the man page says, it shouldn't > change the cursor position (for obvious reasons if you use it). How about using a print in the precmd special function? If you want the normal prompt escapes in it, use the -P option to print. precmd is called before every prompt. % function precmd { print -P Funky-%~ } Funky-~ % echo Funky-~ % cd /usr Funky-/usr % Hope this helps. -- --> Phil Pennock ; GAT d- s+:+ a22 C++(++++) UL++++/I+++/S+++/H+ P++@ L+++ E-@ W(+) N>++ o !K w--- O>+ M V !PS PE Y+ PGP+ t-- 5++ X+ R !tv b++>+++ DI+ D+ G+ e+ h* r y?