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=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 30168 invoked from network); 13 Sep 2023 16:12:05 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 13 Sep 2023 16:12:05 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1694621525; b=EOHZBGH0HL/ab3o0AODNh1RETYRz8P4S55tsQocSHIZxCoPHMwlvnC7xTPlhgXXnOYtvCK+yyd zq/OGaVBmpJ358j8mHhTp01y7cvR+VxHLHG06R7vSEiM5F3Dfu888YuHvOoSUNd3xbMSk5U1lO 752XqVM7A0G9bBMBEkUhnk6cN64Byx9wwHKws+OjJHh8bAQulwi+CWWU1SxjSsNQgLgWElON83 JCGEGxmYYsrDQFLGVygwR4UKJTJps8LSw5KaElZgmmXEnh7UhsKk2WMrB5IL8T8TS1tfFvWJXX KTiT9bP8exLeMtSg+TkRfngmwTy77638q385fvlPXjKjtA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lf1-f53.google.com) smtp.remote-ip=209.85.167.53; dkim=pass header.d=gmail.com header.s=20221208 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=1694621525; bh=XJX76RLy/URgz/NEu8Nv4isA05ZJ+m1BPDtSLyEZVpg=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=Uo1HxvL4Rt9+KBO79jM+r+yCqsqY6hy9S6f6QDYo1Mtr9b44Qbf8ZAYUzVxSeQUSXycJoC+yx7 kMDFjDagXe2wg5zruvHwjcn/GnuaMW1gx2BIQIQG0vsJ0GSCfMFn8wTkIwyJP58yfRqkZxKST3 utv0mqwcyJEB/ZjHTuZA/vU4u+3AF1Vkmpl/Lw+cPzxy5X4Vd7GAKTv9Ga7kRM89E+JsYga7uu QBK77zDTK1lkdCHrJ1qBAUSc5mVu+fx8lz7YGIdsiOzzL5CqwqANfkb0K3NVFK0Ob1uMBunihh fe4uoThmfIsAScNzLgkwRvn8aSygfZki6PJGpn9vD4W0xw==; 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:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=i14s4Cy3RpsDug3yBHtP9KOZSDR+uBbwinrTbBykZU0=; b=VPg+34YFxg7bNwvNW4SRkOXrFu 7mdUn50uoNJoQ1SVHmdXOpnSJ9F6WjTJM+X1Npjv2ZHH626v+urvvcta0C2d5R2h6edQ7oUtmUSgo nfQ0wIeUv57Z4CEWFLj7phrmKL4KQvtx6+6kAWEsW4UmfLDW25sEg3b1IuLLKMz7z7q53Zh20UUlx ClGXaQqzuR3ewMiU/YBnRCEznehIGQUphPkKwCX9xvkrO4ox0Ws6b8ly5aTla3ei4YqCHUTbW/LFe uLtTHaTy05YpxZqmxyjlsKGrbMjahS4t9P5qbAe3Vgc6JVxB/Ga4+3bzjE07/3GJU27d66eemp6bD IvGTs7uA==; Received: by zero.zsh.org with local id 1qgSTE-0008FC-EO; Wed, 13 Sep 2023 16:12:04 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lf1-f53.google.com) smtp.remote-ip=209.85.167.53; dkim=pass header.d=gmail.com header.s=20221208 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lf1-f53.google.com ([209.85.167.53]:56337) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qgSRY-0007QC-N0; Wed, 13 Sep 2023 16:10:22 +0000 Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-500a8b2b73eso11315101e87.0; Wed, 13 Sep 2023 09:10:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694621419; x=1695226219; darn=zsh.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=i14s4Cy3RpsDug3yBHtP9KOZSDR+uBbwinrTbBykZU0=; b=L0xioAiqjDMHAveSNHAlxc1f9EVTIPuB4sDKL/I2BBCUayjr/ZuCBOQhT/5JVhq+zF hYNXsK9YLejrbQ+yGynAmqxBzFZLAgPP6Hgn929JqzlEvZB2hsmZIRYXdNzb9KPQL0LD msZPV23Opu2yOCoirg+yXSs7dBkB5DRw11RHEaZlH3nclwM5hPXJBVObQPbtDyaj7C/D 3G0xPB9ZWvIOGvRIJbLcOiVCbZu1KCS4CXQtytsLYkH+dWcCEN8+MkIHquoZ9iN8qjyZ KqXBDOun4AvPZX/XBPFbQ67MlJDJoFrP3i6/IjfRzqaobdgA3ZW9zlkLK5wmY2nOV+J9 jNKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694621419; x=1695226219; h=content-transfer-encoding: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=i14s4Cy3RpsDug3yBHtP9KOZSDR+uBbwinrTbBykZU0=; b=HXbekue5Iv26gIkpXvdD1t28Swh+kdlivwGVzV3r0tRhF9xnePzitbhMkpcGhYXQ09 5e/Kp7/DkziICc2Wwm8C0bDjFipqgyEf2f3ZI6Y9IYg65CfkGevZybBQYt5l/Ym6x/gf jTCRoAZOcGt48AHeXjY4VgZDIyI4O35WbiL6c6nnIIl7I3hH1X1F8oWTK092TlNRn5ds Qh/FLxZyWD6kg/oOJwzN4b1rarTymf4xiaggrfoFQxGJaKpn/sPkvn0K38ROx0AfSelp VJ9+gf6Xzg+JpZTdxmC8F3vdk0+XCfbp4sYosrdYZl9ZdDhzqhHDaT6tdPbb75cry2+S qKQA== X-Gm-Message-State: AOJu0YxWBXppgbOkGOGUK8ayff33rerRwdE01ncDEr2l7U2L9h+AMYNl strIzW63L3d1ljRzbEkC4Yj/kZkktaDqiNEWT7l/k1z7UbJLBQ== X-Google-Smtp-Source: AGHT+IFypZ6exezoxp0Ew3fan3FH3d+Y7e3Xhrvc/RM+eMfk60e/zz5eXRUJnMdZKxXIii3SoStxJZplbPLTZmv4udM= X-Received: by 2002:a2e:9889:0:b0:2bb:aaab:b42f with SMTP id b9-20020a2e9889000000b002bbaaabb42fmr2678191ljj.49.1694621419331; Wed, 13 Sep 2023 09:10:19 -0700 (PDT) MIME-Version: 1.0 References: <34003-1694620880.833890@ywcd.55nf.YL_G> In-Reply-To: <34003-1694620880.833890@ywcd.55nf.YL_G> From: Roman Perepelitsa Date: Wed, 13 Sep 2023 18:10:07 +0200 Message-ID: Subject: Re: Is there a way of getting current xterm buffer? To: Oliver Kiddle Cc: Grant Taylor , zsh-users@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 29253 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 Wed, Sep 13, 2023 at 6:01=E2=80=AFPM Oliver Kiddle wrote: > > Roman Perepelitsa wrote: > > xterm does not have this capability and neither do any of the most > > popular 10 terminals. The only exception among popular terminals is > > tmux. I don't know of any other terminal with this capability but if > > it exists it's not a popular one. > > Within limits, it's possible with rxvt-unicode. 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 > 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. > > 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. > > Aside from tmux, screen also has the feature with screen -X hardcopy I stand corrected. Thanks, Oliver. Now that you mentioned it, I remember `screen hardcopy` but it's news to me that rxvt-unicode also has something of this sort. Roman. P.S. zsh4humans has an option to wrap the TTY in order to implement two capabilities: save screen and restore screen. The TTY wrapping is supposed to be transparent but the abstraction is a bit leaky. The capability to save and restore screen allows one to implement a pop up window. zsh4humans uses it to display the completion menu above the prompt line. This in turn allows it to keep prompt at the bottom at all times without it jumping around. For the sake of consistency, there is also an option to put prompt at the bottom when zsh is starting so that it's always in the same location.