zsh-users
 help / color / mirror / code / Atom feed
From: jr@scms.rgu.ac.uk
To: zsh-users@sunsite.auc.dk
Subject: Re: 3.0.5: PROMPT and output on the same line
Date: Wed, 31 Mar 1999 09:31:25 +0100 (BST)	[thread overview]
Message-ID: <19990331083126.26318.qmail@master.scms.rgu.ac.uk> (raw)

>hal:/usr/src# zsh -f
>hal# echo -n hi
>hal# sh
># echo -n hi
>hi# csh -f
># echo -n hi
>hi# tcsh -f
># echo -n hi
>hi# ksh
># echo -n hi
>hi# exit
>
>Note that between lines 2 and 3, there's no ``hi''.
>
>This is on FreeBSD -current, using the stock /bin/{c,}sh, pdksh-5.2.13 and
>tcsh-6.08.00.

Using script, I get this:

Script started on Wed 31 Mar 1999 09:24:59 BST
^M^[[m^[[m^[[m^[[Jair% ^[[Kl^H ^He^Hecho -n hi^M^M
hi^M^[[m^[[m^[[m^[[Jair% ^[[Ke^Hexit
script done on Wed 31 Mar 1999 09:25:08 BST

Basically, zsh puts some control characters at the start of the prompt, 
forcing itself to the start of the line.  This also happens with:
#!/usr/local/bin/perl
print "hello";

Since there is no \n, the prompt overwrites the "hello".

Also:
air% echo -n hi; echo ""
hi
air% 

The second echo sends a newline, and the "hi" is visible.

I don't know whether to consider this action a bug or a feature;  certainly, 
it's easy enough to work around and probably simple enough to patch a fix for 
(simply remove the control characters before printing $PS1)

-- 
John Riddoch	Email: jr@scms.rgu.ac.uk	Telephone: (01224)262730
Room C4, School of Computer and Mathematical Science
Robert Gordon University, Aberdeen, AB25 1HG
I am Homer of Borg. Resistance is Fu... Ooooh! Donuts!


             reply	other threads:[~1999-03-31  8:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-31  8:31 jr [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-03-31  8:29 Sven Wischnowsky
1999-03-31  8:45 ` Jos Backus
1999-03-31  8:22 Jos Backus

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=19990331083126.26318.qmail@master.scms.rgu.ac.uk \
    --to=jr@scms.rgu.ac.uk \
    --cc=jr@master.scms.rgu.ac.uk \
    --cc=zsh-users@sunsite.auc.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).