zsh-users
 help / color / mirror / code / Atom feed
From: Roman Perepelitsa <roman.perepelitsa@gmail.com>
To: Seth House <seth@eseth.com>
Cc: Bart Schaefer <schaefer@brasslantern.com>, Zsh Users <zsh-users@zsh.org>
Subject: Re: Cursor save/restore is redrawing over existing output
Date: Fri, 18 Dec 2020 09:44:45 +0100	[thread overview]
Message-ID: <CAN=4vMqnweP7nHPeMHmdnJCbNjvXxdtL-YZsMz9DcRhepmKNpQ@mail.gmail.com> (raw)
In-Reply-To: <20201218061536.GA128900@ellen>

On Fri, Dec 18, 2020 at 7:16 AM Seth House <seth@eseth.com> wrote:
>
> I'm experimenting with the (probably dumb) idea of only displaying the
> output from a single command at a time for a rudimentary TUI-like-thing.
>
> For example, if you type `ls` the directory listing appears below the
> prompt as normal, but then the cursor returns to the original row and
> clears the prompt so the next command you type, say `uptime`, outputs as
> normal but also clears the directory listing output. The idea being that
> you can run several commands in succession without moving the cursor or
> scrolling the terminal.

I also prefer my prompt to stay at a fixed position. However, having
command output *below* prompt is not a good idea. I've listed a few
reasons in https://github.com/romkatv/powerlevel10k-media/issues/2#issuecomment-725415740.
What I do instead is put prompt *at the bottom* and make it stay
there. The latter is a bit tricky because completion listings can push
prompt up. With a bit of work this can be changed so that completion
listings appear above prompt in a sort of temporary overlay. This
setup is quite ergonomic as it allows you to position your terminal
window so that important information (prompt and the end of the output
of the last command) is always at the same position. You can see it in
action here: https://asciinema.org/a/372068. You can also try it in
docker: https://github.com/romkatv/zsh4humans/tree/v5#try-it-in-docker.

Roman.


  reply	other threads:[~2020-12-18  8:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18  2:25 Seth House
2020-12-18  5:40 ` Bart Schaefer
2020-12-18  6:15   ` Seth House
2020-12-18  8:44     ` Roman Perepelitsa [this message]
2020-12-19 20:29       ` Seth House

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='CAN=4vMqnweP7nHPeMHmdnJCbNjvXxdtL-YZsMz9DcRhepmKNpQ@mail.gmail.com' \
    --to=roman.perepelitsa@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=seth@eseth.com \
    --cc=zsh-users@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).