zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh workers <zsh-workers@zsh.org>
Subject: Re: unwanted scrolling of the terminal
Date: Thu, 23 Jun 2016 13:19:59 +0100	[thread overview]
Message-ID: <20160623131959.03fef86b@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <30660.1466683131@thecus.kiddle.eu>

On Thu, 23 Jun 2016 13:58:51 +0200
Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
> Looking at the output in a script log for an 84 char width terminal, I get:
>   x
>   \e[39m  - colour
>   \e[K    - clear to eol
>   \r
>   \e[8@   - insert 8 characters
>   \e[34m
>   eight spaces
>   \e[75C  - cursor right 75 chars
>   \e[39m
>   two spaces
>   \r
> 
> So why the two spaces? The second of those is what caused the scrolling.
> The first one is printed from line 1958 in zle_refresh.c
> The second is from line 2175 in the moveto function

It appears to be specific to terminals with automatic margins (hasam).  I
*think* that code is supposed to have the effect of ensuring if we
subsequently more the cursor right without printing then it knows that
the new line is actually a logical continuation of the previous one ---
hence the subsequent carriage return to get back from there.

So I would guess this hasn't been thought through in the case where
you're at the end of the screen and don't really want to go right unless
you have to.

This code is all originally 1990s --- I have no idea if modern terminals
even respond to these tricks.  I think automatic margin problems were
much more trendy twenty years ago.

pws


  reply	other threads:[~2016-06-23 12:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-23 11:58 Oliver Kiddle
2016-06-23 12:19 ` Peter Stephenson [this message]
2016-06-23 23:30   ` Bart Schaefer

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=20160623131959.03fef86b@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /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).