Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Is there a way of getting current xterm buffer?



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