zsh-users
 help / color / mirror / code / Atom feed
From: Roman Perepelitsa <roman.perepelitsa@gmail.com>
To: Oliver Kiddle <opk@zsh.org>
Cc: Grant Taylor <gtaylor@tnetconsulting.net>, zsh-users@zsh.org
Subject: Re: Is there a way of getting current xterm buffer?
Date: Wed, 13 Sep 2023 18:10:07 +0200	[thread overview]
Message-ID: <CAN=4vMpuXXyjXbmdoHyshvKxTPs+KhSdc9pLoxVQwdyA0jeZTA@mail.gmail.com> (raw)
In-Reply-To: <34003-1694620880.833890@ywcd.55nf.YL_G>

On Wed, Sep 13, 2023 at 6:01 PM Oliver Kiddle <opk@zsh.org> wrote:
>
> Roman Perepelitsa wrote:
> > xterm does not have this capability and neither do any of the most
> > popular 10 terminals. The only exception among popular terminals is
> > tmux. I don't know of any other terminal with this capability but if
> > it exists it's not a popular one.
>
> Within limits, it's possible with rxvt-unicode. The escape sequence
> \e[0i is equivalent to pressing Shift-Print_Screen which is for
> sending the scrollback buffer to a printer. To actually capture the
> output you need to send it to a file instead of a printer which is
> configured from .Xresources, e.g. as
>   Rxvt.print-pipe: umask 077;cat >/tmp/XXX
> Same basic concept may work with other terminals but the data is
> being dumped to a file rather than sent down the tty line. So given
> ssh connections or permission changes the zsh completion widget at
> the other end won't be able to read it.
>
> And I'd agree with Grant that the entire concept is questionable
> from a security perspective. Many terminals removed even the feature
> for retrieving the title bar text.
>
> Aside from tmux, screen also has the feature with screen -X hardcopy

I stand corrected. Thanks, Oliver.

Now that you mentioned it, I remember `screen hardcopy` but it's news
to me that rxvt-unicode also has something of this sort.

Roman.

P.S.

zsh4humans has an option to wrap the TTY in order to implement two
capabilities: save screen and restore screen. The TTY wrapping is
supposed to be transparent but the abstraction is a bit leaky. The
capability to save and restore screen allows one to implement a pop up
window. zsh4humans uses it to display the completion menu above the
prompt line. This in turn allows it to keep prompt at the bottom at
all times without it jumping around. For the sake of consistency,
there is also an option to put prompt at the bottom when zsh is
starting so that it's always in the same location.


  reply	other threads:[~2023-09-13 16:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-13  7:48 Sebastian Gniazdowski
2023-09-13  9:16 ` Roman Perepelitsa
2023-09-13 14:35   ` A. Wik
2023-09-13 15:14 ` Grant Taylor
2023-09-13 15:18   ` Roman Perepelitsa
2023-09-13 16:01     ` Oliver Kiddle
2023-09-13 16:10       ` Roman Perepelitsa [this message]
2023-09-13 18:59       ` Grant Taylor
2023-09-19 22:21         ` Sebastian Gniazdowski
2023-09-20  3:05           ` Grant Taylor
2023-09-20 12:28             ` Sebastian Gniazdowski
2023-09-21 18:05               ` Grant Taylor

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=4vMpuXXyjXbmdoHyshvKxTPs+KhSdc9pLoxVQwdyA0jeZTA@mail.gmail.com' \
    --to=roman.perepelitsa@gmail.com \
    --cc=gtaylor@tnetconsulting.net \
    --cc=opk@zsh.org \
    --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).