zsh-users
 help / color / mirror / code / Atom feed
* Saving physical Zle buffers to snapshot escape codes
@ 2018-08-07  4:44 Sebastian Gniazdowski
  2018-08-07 12:27 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Gniazdowski @ 2018-08-07  4:44 UTC (permalink / raw)
  To: Zsh Users

Hello,
would it be hard to snapshot current Zle buffers (basically BUFFER and
POSTDISPLAY) sent to terminal? I.e. with all escape codes used to
drive terminal into e.g. changing color of text. Basically a
"screenshot" feature.

A user asked how to use F-Sy-H as a highlighter like pygments. That's
rather impossible currently, but I thought about at least getting
escaped Zle text into e.g. ZSH_RAW_BUFFER by calling a Zle widget, to
then e.g. use some converter and obtain HTML. This might be useful.
Maybe even pygments-like setup would be possible, Zsh would be started
in background as a server and print-out ZSH_RAW_BUFFER on demand,
after receiving request via zle -F handler.

-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Saving physical Zle buffers to snapshot escape codes
  2018-08-07  4:44 Saving physical Zle buffers to snapshot escape codes Sebastian Gniazdowski
@ 2018-08-07 12:27 ` Bart Schaefer
  2018-09-19  5:24   ` Sebastian Gniazdowski
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2018-08-07 12:27 UTC (permalink / raw)
  To: Sebastian Gniazdowski; +Cc: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 186 bytes --]

Seems to me it would be possible to do this with zpty?  I don't think
there's anyplace internally where the "raw buffer" that you're describing
is stored in the form that you want here.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Saving physical Zle buffers to snapshot escape codes
  2018-08-07 12:27 ` Bart Schaefer
@ 2018-09-19  5:24   ` Sebastian Gniazdowski
  0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Gniazdowski @ 2018-09-19  5:24 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 698 bytes --]

Wt., 7.08.2018, 14:27 użytkownik Bart Schaefer <schaefer@brasslantern.com>
napisał:

> Seems to me it would be possible to do this with zpty?  I don't think
> there's anyplace internally where the "raw buffer" that you're describing
> is stored in the form that you want here.
>

I'm thinking to approach this. I once stressed zpty a little and it
revealed limit on the output that can accumulate without reading from it
(from the pty allocated, afair).  This would be an obstacle, wouldn't it
be, or maybe you see a solution to this? It seems to limit max size of
highlighted block, basically. I now have also hard time seeing
region_higlight being applied to zpty buffer hmm

>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-19  5:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-07  4:44 Saving physical Zle buffers to snapshot escape codes Sebastian Gniazdowski
2018-08-07 12:27 ` Bart Schaefer
2018-09-19  5:24   ` Sebastian Gniazdowski

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).