[dev] a terminal transformer, analogous to a unix filter

From: Greg Reagle <list_AT_speedpost.net>
Date: Sat, 07 Jan 2023 21:30:55 -0500

I have coined the phrase terminal transformer for a class of programs
like tmux, dvtm, tcvt, and splitvt. Perhaps there is already a phrase.
A terminal transformer runs on top of a terminal emulator and acts as
a terminal emulator itself, with an application like nano running on
top of it. In other words, it uses a terminal emulator and is used
as a terminal emulator.

I would like to experiment with a completely transparent transformer as
a starting point. A transparent transformer passes through everything.
Ideally it does nothing. Just as a--not useful--example, if I want
hitting the left cursor key to move the cursor left then right then left
again, I can add code to intercept that escape sequence and program it
to do that. That is how I imagine experimenting with more sophisticated
and useful transformations.

I would like some guidance on developing a program that is a transparent
terminal transformer in a way that is as simple and stupid as possible.
Do you have any idea how short or long it would be? What I could look at
as an example? I am thinking that in order to make it a simple and stupid
as possible, it runs on top of st and masquerades as st. It uses no
library like curses or libvte. It deals directly with escape sequences.
Is such a thing possible or practical? It would be analogous to using
cat as a filter, and would be as simple as sbase's cat.c (as an ideal, I
know it does a lot more than cat).

If or when I come up with a useful transformation, I might want to
make it terminal independent by using curses or libvte, but that is for
the future.

Can anyone help?
Received on Sun Jan 08 2023 - 03:30:55 CET

This archive was generated by hypermail 2.3.0 : Sun Jan 08 2023 - 04:12:08 CET