zsh-users
 help / color / mirror / code / Atom feed
From: Grant Taylor <gtaylor@tnetconsulting.net>
To: zsh-users@zsh.org
Subject: Re: Is there a way of getting current xterm buffer?
Date: Wed, 13 Sep 2023 13:59:33 -0500	[thread overview]
Message-ID: <4e08010c-b452-a807-ab0a-d40af8983203@tnetconsulting.net> (raw)
In-Reply-To: <34003-1694620880.833890@ywcd.55nf.YL_G>

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


  parent reply	other threads:[~2023-09-13 19:01 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 [this message]
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=4e08010c-b452-a807-ab0a-d40af8983203@tnetconsulting.net \
    --to=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).