Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Is there a way of getting current xterm buffer?
- X-seq: zsh-users 29252
- From: Oliver Kiddle <opk@xxxxxxx>
- To: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Cc: Grant Taylor <gtaylor@xxxxxxxxxxxxxxxxxx>, zsh-users@xxxxxxx
- Subject: Re: Is there a way of getting current xterm buffer?
- Date: Wed, 13 Sep 2023 18:01:20 +0200
- Archived-at: <https://zsh.org/users/29252>
- In-reply-to: <CAN=4vMqDf3-rzCMqQ8TevU9VyLsqbCSC6-jEcODMgM7yfMW3YQ@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAKc7PVDmdYC+7k5gLTabqmm=iSQg0W7oMLN3R=Na4W=Qmaz-8w@mail.gmail.com> <ee1f04c1-5203-7b92-a5d9-6f98c6414413@tnetconsulting.net> <CAN=4vMqDf3-rzCMqQ8TevU9VyLsqbCSC6-jEcODMgM7yfMW3YQ@mail.gmail.com>
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
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author