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 23866 invoked from network); 20 Sep 2023 05:28:15 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 20 Sep 2023 05:28:15 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1695187695; b=NTqXInlQoNaZXx5XgEq5GmMbHjdCQH9SyoFNX+AYpyqF7b8JwFLKEKpkeEQZQ5eKfKHfZHvRho hpSfRNCRS+6imcsHMVYHdh1nOeUBG4+IxflP0Ih1B3QdANC0O1SqjJjbIFCodnRcnT9JkLhzkn vX9DwBY9WO+RwGK+ndgD0MIO8VwfsN6v1HW/dv3fBxJO4wTypyJFN4rE+OM97L/x46eZJFqZs0 pP6/f/PEnzhBLkcipom55SOmBpmfYs1b04Rx4FEO7qMlJ58DERHRGrSIjr3Gf2ZhRLgXJ8rCeY WO+bNOit6vohcGI9ag6VWMkWTtWcx7eQXDxVVyRLvX6ktQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lf1-f51.google.com) smtp.remote-ip=209.85.167.51; 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=1695187695; bh=149Hw0+/RhOPpkeNLcYqXwPxo2t0CulUwKgWcuoYcE8=; 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=qznxMKd3LR6r61aseJmFLXqMSSbNEH1yF8JcE07i3Pc/KiwU/zf/JpOd5wYF25HE5HsC7Dn2Es Ubi7+4XF8frPUeq4c/veZb3k53B3/lUq+VyaqVJ5XmEkbJKTqerBH2h1t9y6pcwg2ghnV1y7gl ZtpW7y9L9zOAHNLys2m7haXPJTfosU8CncoTWhYFO496pDMuunnookn3XQd6gVBWaI5aFndsd6 aPIEHV/k4g9tFCelO/SNoCkqx3h9ZdOmS1wemVp0KNHbzK3Pkq1MTz4Ofb4u8+Br8Sb4cwxFbZ 7e9fpA/QPMAeKaI15SIxgV8FV2Bo9/KeDCd36ieYnAepzg==; 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=iKlKQ1jjxP3Txdy2OUaXFZayoGzJDjMK3BF5K0U7t6E=; b=cpkD0qtScaGa4MbgSMlbYPPB6a sLHCzUwoka2RB857bA+o/zl1QsAQyrirmzd6lPOTCTqkwixfZQi+56vvmvFceUxBE8Fi9r9GdQbSe c3gYTLlbNYr5LUBVkaP1oMgcxP/xjLMFlWKa8yGMvb/f3dOJNXTYyxEmkBcd48ow8do97X//taTtz RwJuTdR+K1MH4U7fzcivA2zdojcND+U7EuKdGTnk3R/oc144wirFOtBJ2tXm8GyKWF45vwp9RH1yY bfOKpPiber0CvqjSSszpVMMn+auSD6WqFJ7GBGG/C67oaQWZ6AiPb8hUp3siqHRN2gKLVjik+2Huk uEy/Mqbg==; Received: by zero.zsh.org with local id 1qipl1-000K0J-4T; Wed, 20 Sep 2023 05:28:15 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lf1-f51.google.com) smtp.remote-ip=209.85.167.51; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lf1-f51.google.com ([209.85.167.51]:61909) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qipjt-000JHP-4O; Wed, 20 Sep 2023 05:27:07 +0000 Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-5031426b626so5037198e87.3 for ; Tue, 19 Sep 2023 22:27:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695187624; x=1695792424; 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=iKlKQ1jjxP3Txdy2OUaXFZayoGzJDjMK3BF5K0U7t6E=; b=TVxrLt7jtlT5Ftzc1OjRvpE4nJBszpYW+veV3ICtvCmgUEON/7oAWmWVfrCouvDQxJ vSIJWZW+VGDcooQrS8/wFRvycHu0BtHO5pMVYVy+cGJ/HKM+xSS1PBbdu5NiJ+BEcOJy TCmY0uDFQU9c9NJqSFFN1XQaN79hNb+m5+fc2asKKPhkb4yB1cQr/1JBLahJjKUVf6La frXo3+sZLHRdfc3jW0jnwGc4/pCWE27gBP6ctc8Okv9YrMGIbofMQxmUoJ7bpoyvQ56B WD7BtsZ9zF/J9vrhZhjyWaWU2pPOCYHw89I2a0AP/U2OfEQX/SmPmyrgpBG9KE3U7EBq qbaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695187624; x=1695792424; 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=iKlKQ1jjxP3Txdy2OUaXFZayoGzJDjMK3BF5K0U7t6E=; b=jgsBQEGmnny02gqQy+pKl23GUOWF0ujfnTt8FjuLW452YOgm/w0NqDrR8q4sPFejJC Ma1bLOU5UIA7EhNwOJ2IfzrgCMI6NjMfBwvEm9SY4rlwDXF8jGezczm4BUELpK8HBLzC gqMW443+keCb+/jwfsbtS5bVDKOFn7yQxHoLs2KCllYUFuPe7hJgzdAXWORB8rSLZQ5M HfRvYZD270dDdTepFJ/pq1TE4z5CIC0oTDwzW0nMcuzAhbG9FHRR7MAcyrCpCS83BcyL eB8W2RtbDguh/mXENokstuHHFw+/GsDRmCznd1byS5L/46h6OT7wuY0b73W+QhgUzyju +O/w== X-Gm-Message-State: AOJu0Yy/9JT9CsTuH3uxliuHfwXNqO3A7+IBK1dYO11USXDgtVXMDHMC GOste8rFUZfNgBa+UReJZ88Y2Ns7oNALYbtyLO4CFdWI X-Google-Smtp-Source: AGHT+IGeJH30IKqj6Um6nKrVEvMdw8M+kyBero7bndNVnOlHfBmJMQ3Wx3l1XWteDHEd36Jc79ob+VAAwpZuU+QzLG0= X-Received: by 2002:ac2:5f73:0:b0:502:ff3b:7671 with SMTP id c19-20020ac25f73000000b00502ff3b7671mr1159147lfc.9.1695187623713; Tue, 19 Sep 2023 22:27:03 -0700 (PDT) MIME-Version: 1.0 References: <34003-1694620880.833890@ywcd.55nf.YL_G> <4e08010c-b452-a807-ab0a-d40af8983203@tnetconsulting.net> <667f3f2c-eb20-34b0-0e4e-8efe8b106ab1@tnetconsulting.net> In-Reply-To: <667f3f2c-eb20-34b0-0e4e-8efe8b106ab1@tnetconsulting.net> From: Sebastian Gniazdowski Date: Wed, 20 Sep 2023 07:28:19 -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="00000000000023a0700605c3a0ec" X-Seq: 29272 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: --00000000000023a0700605c3a0ec Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks. For completing screen-words, I would it seems need something different =E2=80=93 so that the screen contents gets saved to the file in background, causing no visual or other effects for the user. Is this possible? On Tue, 19 Sept 2023 at 22:06, Grant Taylor wrote: > On 9/19/23 5:21=E2=80=AFPM, Sebastian Gniazdowski wrote: > > It fine to save the screen copy to a file, I can read it via $( > Fair enough. > > > Does xterm can save the screen to a file, via the "media-copy" control > > seq that you've mentioned? > > XTerm can be configured to save content sent via media copy to a file. > > N.B. media copy doesn't capture the screen to a file. Rather media copy > causes XTerm to take subsequent data and send it to the file. > > You set media copy on, send data to -- ostensibly -- print to media, and > then set media copy off to return the terminal to normal operations. > > > Is there some example available of how to use it? > > I've got things somewhere. > > Hand typing this between terminals for $REASONS. > > --8<-- > #!/bin/bash > # Media Copy On > echo -n "^[[5i" > cat - > # Media Copy Off > echo -n "^[[4i" > -->8-- > > ^[ is a stand in for the escape character. > > This is the standard Control Sequence Introducer (CSI). Escape followed > by an open square bracket. > > I use this with something like the following: > > % uname -a | mediacopy > > That causes uname's STDOUT to go into the mediacopy script's STDIN which > gets wrapped with the CSI 5 i or CSI 4 i. > > I have the following configured in my ~/.Xdefaults: > > --8<-- > XTerm.vt100.printerCommand: /path/to/XTerm.vt100.printerCommand.sh > -->8-- > > My XTerm.vt100.printerCommand.sh is fairly simple. > > --8<-- > #!/bin/bash > cat - > `date +/path/to/destination.d/XTerm-printout-%Y%m%d-%H%M%S.txt` > -->8-- > > Remember to use xrdb et al. to load the updated ~/.Xdefaults file. Or > otherwise get the XTerm.vt100.printerCommand setting into X11. > > > > -- > Grant. . . . > unix || die > > > --=20 Best regards, Sebastian Gniazdowski --00000000000023a0700605c3a0ec Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks. For completing screen-words, I would it = seems need something different =E2=80=93 so that the screen contents gets s= aved to the file in background, causing no visual or other effects for the = user. Is this possible?

On Tue, 19 Sept 2023 at 22:06, Grant Taylor &= lt;gtaylor@tnetconsulting.net= > wrote:
= On 9/19/23 5:21=E2=80=AFPM, Sebastian Gniazdowski wrote:
> It fine to save the screen copy to a file, I can read it via $(<fil= e).

Fair enough.

> Does xterm can save the screen to a file, via the "media-copy&quo= t; control
> seq that you've mentioned?

XTerm can be configured to save content sent via media copy to a file.

N.B. media copy doesn't capture the screen to a file.=C2=A0 Rather medi= a copy
causes XTerm to take subsequent data and send it to the file.

You set media copy on, send data to -- ostensibly -- print to media, and then set media copy off to return the terminal to normal operations.

> Is there some example available of how to use it?

I've got things somewhere.

Hand typing this between terminals for $REASONS.

--8<--
#!/bin/bash
# Media Copy On
echo -n "^[[5i"
cat -
# Media Copy Off
echo -n "^[[4i"
-->8--

^[ is a stand in for the escape character.

This is the standard Control Sequence Introducer (CSI). Escape followed by an open square bracket.

I use this with something like the following:

=C2=A0 =C2=A0 % uname -a | mediacopy

That causes uname's STDOUT to go into the mediacopy script's STDIN = which
gets wrapped with the CSI 5 i or CSI 4 i.

I have the following configured in my ~/.Xdefaults:

--8<--
XTerm.vt100.printerCommand: /path/to/XTerm.vt100.printerCommand.= sh
-->8--

My XTerm.vt100.printerCommand.sh is fairly simple.

--8<--
#!/bin/bash
cat - > `date +/path/to/destination.d/XTerm-printout-%Y%m%d-%H%M%S.txt`<= br> -->8--

Remember to use xrdb et al. to load the updated ~/.Xdefaults file.=C2=A0 Or=
otherwise get the XTerm.vt100.printerCommand setting into X11.



--
Grant. . . .
unix || die




--
Best regards,
Sebastian Gniazdowski

--00000000000023a0700605c3a0ec--