zsh-users
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@zsh.org>
To: Roman Perepelitsa <roman.perepelitsa@gmail.com>
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:01:20 +0200	[thread overview]
Message-ID: <34003-1694620880.833890@ywcd.55nf.YL_G> (raw)
In-Reply-To: <CAN=4vMqDf3-rzCMqQ8TevU9VyLsqbCSC6-jEcODMgM7yfMW3YQ@mail.gmail.com>

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

Oliver


  reply	other threads:[~2023-09-13 16:02 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 [this message]
2023-09-13 16:10       ` Roman Perepelitsa
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=34003-1694620880.833890@ywcd.55nf.YL_G \
    --to=opk@zsh.org \
    --cc=gtaylor@tnetconsulting.net \
    --cc=roman.perepelitsa@gmail.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).