zsh-users
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Grant Taylor <gtaylor@tnetconsulting.net>
Cc: zsh-users@zsh.org
Subject: Re: Is there a way of getting current xterm buffer?
Date: Tue, 19 Sep 2023 17:21:07 -0500	[thread overview]
Message-ID: <CAKc7PVAWcQ7HokZAF0LzoLciY3_cDSp0wzTkP=25ov+waKYmig@mail.gmail.com> (raw)
In-Reply-To: <4e08010c-b452-a807-ab0a-d40af8983203@tnetconsulting.net>

[-- Attachment #1: Type: text/plain, Size: 2440 bytes --]

It fine to save the screen copy to a file, I can read it via $(<file). Does
xterm can save the screen to a file, via the "media-copy" control seq that
you've mentioned? Is there some example available of how to use it?

On Wed, 13 Sept 2023 at 14:01, Grant Taylor <gtaylor@tnetconsulting.net>
wrote:

> On 9/13/23 11:01 AM, Oliver Kiddle wrote:
> > Within limits, it's possible with rxvt-unicode.
>
> I may be wrong, or have misunderstood what the OP is wanting to do.  But
> I disagree.
>
> > 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
>
> XTerm supports DEC's "Media Copy" feature.
>
> > 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.
>
> My understanding is that the OP wanted the data to go back to the host
> sending the control sequences, not a local file / printer.  Ergo why I
> say that rxvt's feature you're talking about and XTerm's Media Copy
> feature won't do what I understand the OP to want to do.
>
> My understanding is that the OP wanted the host to be able to scrape the
> screen so that it could intelligently modify something on the screen,
> ostensibly something like command completion or such such handy behavior.
>
> > 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.
>
> I'm okay with the idea of having the terminal switch it's output to a
> local AUXiliary port -- ostensibly connected to a printer -- redirect
> /future/ output to said AUX port & printer.  At least until the terminal
> is directed to start sending things to the screen again.
>
> > Aside from tmux, screen also has the feature with screen -X hardcopy
>
> Sending existing screen contents back to the host is considerably
> different than sending new content to an alternate location.
>
>
>
> --
> Grant. . . .
> unix || die
>
>

-- 
Best regards,
Sebastian Gniazdowski

[-- Attachment #2: Type: text/html, Size: 3214 bytes --]

  reply	other threads:[~2023-09-19 15:21 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
2023-09-13 18:59       ` Grant Taylor
2023-09-19 22:21         ` Sebastian Gniazdowski [this message]
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='CAKc7PVAWcQ7HokZAF0LzoLciY3_cDSp0wzTkP=25ov+waKYmig@mail.gmail.com' \
    --to=sgniazdowski@gmail.com \
    --cc=gtaylor@tnetconsulting.net \
    --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).