From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DATE_IN_FUTURE_06_12, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24304 invoked from network); 19 Sep 2023 15:21:16 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 19 Sep 2023 15:21:16 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1695136877; b=D/txXD8va0buNGNcgu3hwrJvuWHdUwJ7Vd54okPo4Ql40Qok9IvWQItEHApEXIO11ceucB7bLv UzTXl6G9eYLrrFT2Uilcjwn5qmZ5OX/A0MiQnahGnWj8Vkj53xUqcR3rSaJvozlFwXcCDtEFG6 22etDjW2w6LhTinEBc1IuCnsxQy0ji152hHVjDQJlYfICLPYVZtxEjG7XWc/Rw8AmXzLRSC+74 kOQBvE/7fVdI0UJAkEB2tg0Skxy+MAj1qik1EuE779VwxWVhDpRzit1oM+GAwijGCj+ZuTYgiq JPAqJkzY3ULDzqt4s/Vqf/WbdSsEEmVhqqW+R5uWj/UsZQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f171.google.com) smtp.remote-ip=209.85.208.171; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1695136877; bh=kwOUzDnxF5zlZoiFc29Pa5LjZnh6+XU+7wkAX5vhbDs=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=A69VuMJ0l+iVRlQ3bgGPDwvtdi9/CwJs3TdLC4OWmWGNNIHdraJGIIc2nQwhFD5sh7itAFntdm IZlYSYZ5sGO3zTq0Fzx7AETJIPHhJkp86dYK5vHjQ1m1PD8Ca8ll1VIY7hv9VJiDMFCKzTZClP M7dEABRsHrFzJxiagmma++kvTKmkLepiWMhMkxWFIZrrtHjlaohs4wQsej6vOZPP04Ce/Bopdm XW/3gbJi/6aWe/fm2MbFaOuKvnYhunlojTwwIUMfUtoo2f77/2L9WyXqvE6VrxjgwTwIFmShW2 Yngjp8V3FResOxqpgYHSZWpXojp9tyWIH6UQVcegfJD08A==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=8/hrKoh0S2uL023KEm9IjaI/TmnKb6WYz9TrSaRSegA=; b=ojkeSchCwO12NvUhXJexfbXaee qlFaM6PlXxcnVJoIEMu0lu/hZvgbriLjFJisFeRiSo5oBW3OGzpCvzsJCHrHfM1IRZUyuCEq07g8X BzERjup81orHt9IiyJd6Qdd3CzlywSHjOVSiEAifYiLiYKnB9U3ff1JGQb5eYEp72wy4qyhljOVi+ BBgeyGEHQ8s6OVzMEGmAf3vr15HlRfKeD0+oVZAwn9RDQyuzwCi+orv0JFSRi+rsoyyWqpyvM4pep 99hkKFOpeja2ePClS2Ic1O59qr3BEFtMj8tka2h/w/4DDXNCTU2kzAOKIcxwNlvuGtXtdazTstS3A SQMFNS+Q==; Received: by zero.zsh.org with local id 1qicXM-000KDH-1P; Tue, 19 Sep 2023 15:21:16 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f171.google.com) smtp.remote-ip=209.85.208.171; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lj1-f171.google.com ([209.85.208.171]:59500) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qicW0-000JQI-7i; Tue, 19 Sep 2023 15:19:53 +0000 Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2bffc55af02so41951991fa.2 for ; Tue, 19 Sep 2023 08:19:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695136791; x=1695741591; darn=zsh.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=8/hrKoh0S2uL023KEm9IjaI/TmnKb6WYz9TrSaRSegA=; b=hhTlkPHNa1JSyXFZ2bhptRLWefWPxPlYT+7i31ebQfKHuxbWQSuCOQLqiV4Zr23PZI FqU4b1nrvMXFK2k1uYuKgKV7CjWdAVfKuQjIBKff0LBCK+QgjBlhB2xYq0lIvMQ9RHhm jWHJzPRhTRqDXt6VFEtJDvflGj8O9DQ33xilaIq1VdWKcIhfavOOr9MD5alrzCEC18uu /EhGoVuLDtWFsj/Tua8856qb8kOd5RhxmVHJSGzJsvSkFToXSAhhGUVzu38jIbLIhj17 h2HRsgH4tInVreFtRXuh99f4FmHPjFZDPIbVKjRDc9NELz54VvEfpa+vmsExJ+ayiI0B l94Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695136791; x=1695741591; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8/hrKoh0S2uL023KEm9IjaI/TmnKb6WYz9TrSaRSegA=; b=QRaL15DO9PpVpkv/y0//XCA/qpIh5Zg3IN20k3XGAo9myqG7AJW9NPeu34BDgl/F1v zEFJf4uWusKNbEY7jXbHAEOP3+85qJOPf7ueEoDixw9mhZR9QWmdaMqwfTQribu5yht7 ZvCh1CdnrGsrkx6vq8lQ17hoYcj5R4g2xJlSF6rZWDibDfNjwZb8fvyYmkzwlkI8gVYv r92yQUmYqp0rB+mZe9RYHezYTk8YrPM+f1mKPPWbdcOO5x1+G4ARr0NW97xSrC95ted6 8ghGiAd1oRp1efhLO1UJvvqBaj020SRxyj4ZuXlv32rsxPBca2tHApvMX+2ynSUk5XYu kM+w== X-Gm-Message-State: AOJu0YyJk1GhQrd9Yj6+vzjwB8s86OuXOI2QVWGzxrLzbI4PkG3v0E69 mYZodrVI2Cq1kCrZNCsmJKnW9UOpGNYzMq8clB0= X-Google-Smtp-Source: AGHT+IHCeKyHi5Z8bnk2szkB9rUkEXFVG3OKpZW5UCRH5XUuknl+a43KXNs9JZIYFGfBYTUmiiPHqPamMb903f5wfD0= X-Received: by 2002:a05:6512:281a:b0:503:17c0:5374 with SMTP id cf26-20020a056512281a00b0050317c05374mr6015910lfb.65.1695136791334; Tue, 19 Sep 2023 08:19:51 -0700 (PDT) MIME-Version: 1.0 References: <34003-1694620880.833890@ywcd.55nf.YL_G> <4e08010c-b452-a807-ab0a-d40af8983203@tnetconsulting.net> In-Reply-To: <4e08010c-b452-a807-ab0a-d40af8983203@tnetconsulting.net> From: Sebastian Gniazdowski Date: Tue, 19 Sep 2023 17:21:07 -0500 Message-ID: Subject: Re: Is there a way of getting current xterm buffer? To: Grant Taylor Cc: zsh-users@zsh.org Content-Type: multipart/alternative; boundary="0000000000004b147c0605b7cacb" X-Seq: 29269 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --0000000000004b147c0605b7cacb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable It fine to save the screen copy to a file, I can read it via $( wrote: > On 9/13/23 11:01=E2=80=AFAM, 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 > > --=20 Best regards, Sebastian Gniazdowski --0000000000004b147c0605b7cacb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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 av= ailable of how to use it?

On Wed, 13 Sept 2023 at 14:01, Grant Taylor = <gtaylor@tnetconsulting.ne= t> wrote:
On 9/13/23 11:01=E2=80=AFAM, 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.=C2=A0 B= ut
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 <= br> > capture the output you need to send it to a file instead of a printer =
> which is configured from .Xresources, e.g. as
>
>=C2=A0 =C2=A0 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.=C2=A0 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 f= rom
> 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.=C2=A0 At least until the te= rminal
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

--0000000000004b147c0605b7cacb--