Re: clobbering of last line by zsh prompt

From: Boyd Adamson (boydhyphenadamson_at_nospam.usa.net)
Date: 12/27/04


Date: Mon, 27 Dec 2004 17:33:39 +1100

kj <socyl@987jk.com.invalid> writes:

> I'm generally very impressed by the design of zsh, but the way zsh
> handles the case when the output to stdout does not end with a new
> line is just terrible. E.g.
>
> % echo foo
> foo
> % echo -n foo
> %
>
> The second 'foo' got clobbered by the zsh prompt. There's *no*
> excuse for such design. I understand that if PS1 doesn't begin in
> column 0 this can confuse the code for the RPROMPT, etc., etc.,
> etc., but would it have been so difficult to have the shell simply
> do this
>
> % echo -n foo
> foo
> zsh: appended newline to output
> %

This would require the shell watching the entire output of every command
to react accordingly, and probably a redesign of portions of the OS.

However, your first example is a nearly exact match for one in the zsh
FAQ:

http://zsh.sunsite.dk/FAQ/zshfaq03.html#l39



Relevant Pages

  • Re: [zsh] what goes in .zshenv, .zprofile, .zshrc, etc?
    ... Some zsh-related operations (e.g. starting a new interactive shell, ... or running zsh scripts) have gotten pretty slow for me, ... foo: aliased to frobozz ... is that the latter do not inherit aliases, ...
    (comp.unix.shell)
  • Re: bash -c
    ... echo foo ... taken as a command string. ... but no. Bash doesn't seem to do that in any ...
    (comp.unix.shell)
  • Re: zsh: how to make a function fail?
    ... I am trying to define a zsh function that fails (i.e. exits setting ... the enclosing shell terminates when one executes the resulting foo ... out basic information about shell programming, ...
    (comp.unix.shell)
  • zsh: how to make a function fail?
    ... I am trying to define a zsh function that fails (i.e. exits setting ... the enclosing shell terminates when one executes the resulting foo ... out basic information about shell programming, and zsh programming ...
    (comp.unix.shell)
  • zsh puzzle: passing arrays in for-loop var
    ... I want to run foo on a list of pairs,, etc. ... bash, ... This doesn't work with "standard" zsh (foo gets called with one ...
    (comp.unix.shell)