Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: need to explicitly create newline on command prompt

On Mon, Aug 14, 2000 at 10:24:07AM +0200,
Eric Smith <eric@xxxxxxxxxxxx> wrote:
> <cut and paste from terminal>
> [eric@plum ~]$ perl -e 'print "abc "'
> [eric@plum ~]$ echo abc 
> abc 
> [eric@plum ~]$ perl -e 'print "abc \n"'
> "'abc

How do you get _this_?
Can't reproduce such behaviour.

> [eric@plum ~]$ zsh                  
> [eric@plum ~]$ perl -e 'print "abc "'
> [eric@plum ~]$ perl -e 'print "abc \n"'
> abc 

Yes. This happens because zsh clears the whole line before drawing a
prompt. You can workaround the problem:
precmd() {

> [eric@plum ~]$ bash
> bash-2.03$ perl -e 'print "abc "'
> abc bash-2.03$ perl -e 'print "abc \n"'
> abc 

Bash doesn't clear the line before drawing a prompt, so this behaviour

> With zsh, I have never been able to get output of a perl command
> unless an explicit "\n" is entered.  A straight echo or even:
> echo 324542| sed 's/3/9/g'
> does print out. (Also there is that weird `"'abc' output.
> With bash all is as it should be.
> Any ideas where I could look t fix this?

The perl command issues some output, but the output will be overwritten
by zsh's prompt.


 Thomas Köhler Email:   jean-luc@xxxxxxxxxxxxxxxxx     | LCARS - Linux
     <><        WWW:     http://jeanluc-picard.de      | for Computers
                IRC:             jeanluc               | on All Real
               PGP public key available from Homepage! | Starships

Attachment: pgpSZ3JjcnR77.pgp
Description: PGP signature

Messages sorted by: Reverse Date, Date, Thread, Author