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=-4.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 18229 invoked from network); 20 Sep 2023 03:07:08 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 20 Sep 2023 03:07:08 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1695179229; b=KpPXdgSc6dwY8afKwzkBwqb4a6j/Cvhr9HKYbvaTQEXBSdZIbyXidvkfgX/WAMFxYY12erzVkT pVx8fBqmC4pewVc/m3oyl6L0/kQhitL6D8Oqdpl6Z0UZ/7aVPaoCfEdbyMiM6D4GtHBq5qGB+p JYC8THjW8mHQpduoePHWi9lc6H9oenQoLNQEzuHjqOlyBTog49Z/gzw9ruuN1TizmREAF+LAYy ZPGqFf0ctazUvq5QhmFFIxnF0k3HZgAS02IpS1G4shOTKh2E0iHRJmbechVeSG0ZwzilqqRvWD i47PmGp6LPuT60ysh+S/5Q2QMfo0Rz+G+QP4kZJUkll4+g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (tncsrv06.tnetconsulting.net) smtp.remote-ip=45.33.28.24; dkim=pass header.d=tnetconsulting.net header.s=2019 header.a=rsa-sha256; dmarc=pass header.from=tnetconsulting.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1695179229; bh=TgBiNwAj03OGwbnekGo9fguoePokmKCRXTbVqLoJTlY=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID:DKIM-Signature: DKIM-Signature; b=RLS7qUx+pRB2AqIL4pRal/VV4Ce9ZkEmTMdl6o6j27lKBZKd+Jb3EoRhKWvAYtR+3GwpilfIBq JribhJZvjrS8KOOZFUko7SgrjeOwfiWuQOiedlT6tTmqJ2krEczkrUoDpt6fKKrA2VHOGnnoTF FnUk9oZgrUYepiJCuWpZcVQxwxTvOYoLdK8zSkarkWm3Ir8n7tLmbF2ogTMcIV7Ga7tVYPvG7S vNwm0c/TsmBWSRo0EfsQl+h3H2PHytlboLSCVZH8XOh1g/iupQ8fsElc3my8GJFn70J7ga43ei OBhWNPyXQcPJhVNx4lcw7aSvCYhusrMfAJibH60UWRWyKQ==; 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-Transfer-Encoding: Content-Type:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=MV1NT/7crBI56wNFKfrKBZFzNx/Dgl9cFIPwdT+FDYc=; b=Bo1Tg3cHEBAofqHOCZMPXASn1Y QV0U9ds/0M5O2k21aaI5RPwho9pmjgAEraawSIaWqMy0eptpUHhB+WNbnGypdlJ+uOjuTEzC7ydpI 2oj9YeqeiM/5mbE8qqNoQ1f61KfY6GwfKLdUTs1EP2S334nVfJSTDfW0EgtSgeOMLqLiXMBdhBLZn 8PSMhgDcMbkLYPOnZmQmdW/SSEqbe93x4po2rQ+nZzrqDyvJthqzN2h0KeHIpyaLF9NlLpaZYxyK4 A2U6WVYeF7RflEizapCpwNEnUhrwi1iqXXBEJNqAjUJP7myWrpoQc+mGyyTsCW7toLRTyUU8chDN6 jXwhPVmA==; Received: by zero.zsh.org with local id 1qinYS-000FFH-B1; Wed, 20 Sep 2023 03:07:08 +0000 Authentication-Results: zsh.org; iprev=pass (tncsrv06.tnetconsulting.net) smtp.remote-ip=45.33.28.24; dkim=pass header.d=tnetconsulting.net header.s=2019 header.a=rsa-sha256; dmarc=pass header.from=tnetconsulting.net; arc=none Received: from tncsrv06.tnetconsulting.net ([45.33.28.24]:37406) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1qinXE-000EXb-9J; Wed, 20 Sep 2023 03:06:00 +0000 Received: from Contact-TNet-Consulting-Abuse-for-assistance by tncsrv06.tnetconsulting.net (8.15.2/8.15.2/Debian-3) with ESMTPSA id 38K35nNo009252 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 19 Sep 2023 22:05:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tnetconsulting.net; s=2019; t=1695179150; bh=MV1NT/7crBI56wNFKfrKBZFzNx/Dgl9cFIPwdT+FDYc=; h=Message-ID:Date:MIME-Version:User-Agent:Subject:Content-Language: To:References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:Cc:Content-Disposition:Content-Language: Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To: Message-ID:MIME-Version:References:Reply-To:Resent-Date: Resent-From:Resent-To:Resent-Cc:Sender:Subject:To:User-Agent; b=I5NNtX3EBxlg2mUJKZz13mz2VjEdNlsIb77wTFsdXDR2sR8cKsVywB+ZKHDQmeRsp TDezMBheEdnFBJkJ+cmBT2Bh+3geuQ+w+X1Y26+haDRgzh3p3spvbtlVd2RsK1UMdO zDk9h3wmeUjq/VBgFMBybvNbJZtAxsH+TC3klpVE= Message-ID: <667f3f2c-eb20-34b0-0e4e-8efe8b106ab1@tnetconsulting.net> Date: Tue, 19 Sep 2023 22:05:41 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: Is there a way of getting current xterm buffer? Content-Language: en-US To: zsh-users@zsh.org References: <34003-1694620880.833890@ywcd.55nf.YL_G> <4e08010c-b452-a807-ab0a-d40af8983203@tnetconsulting.net> From: Grant Taylor In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Seq: 29271 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: On 9/19/23 5:21 PM, Sebastian Gniazdowski wrote: > It fine to save the screen copy to a file, I can read it via $( 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