visually compare (sdiff -with colours?). two panes of split screen?

66 views
Skip to first unread message

mat...@koerber.org

unread,
Mar 29, 2023, 4:34:32 AM3/29/23
to iterm2-discuss
Is there an easy way to have iterm2 compare the current viewport of a split screen and mark the differences (eg by underlaying them with a colour)?
It would be useful to also have a means to make it ignore certain types of differences (eg if the differing parts match a certain regex (in either one or both tabs), eg to ignore timestamp changes etc. (or even better: to allow interpreting the timestamps or such and mark only difference larger/smaller than a given cutoff)?

Richard Mitchell

unread,
Mar 30, 2023, 10:40:02 AM3/30/23
to iterm2-discuss
Instead of comparing two side-by-side panes, use a window with just two tabs.  Using keystrokes to cycle thru them, you can animate the display like those old flip pages people used to do to see (very short) movies.

If both are displaying almost the same thing, the differences really pop out.

Granted, you won't get color, unless you  have the right form of synesthesia.

George Nachman

unread,
Mar 31, 2023, 2:06:22 PM3/31/23
to iterm2-...@googlegroups.com
That’s a neat idea! It could be done using the Python API, although it would be a little ungainly. What you’d do is grab the content of both panes using Session.async_get_contents() (https://iterm2.com/python-api/session.html#iterm2.Session.async_get_contents), compare them, and then use Session.async_inject (https://iterm2.com/python-api/session.html#iterm2.Session.async_inject) to change the color of the text onscreen. The control sequence to change text color is DECCARA (https://vt100.net/docs/vt510-rm/DECCARA.html). If you’re new to the Python API you can get started here: https://iterm2.com/python-api/tutorial Let me know if you need help with this. 

On Mar 29, 2023 at 1:34:32 AM, mat...@koerber.org <mat...@koerber.org> wrote:
Is there an easy way to have iterm2 compare the current viewport of a split screen and mark the differences (eg by underlaying them with a colour)?
It would be useful to also have a means to make it ignore certain types of differences (eg if the differing parts match a certain regex (in either one or both tabs), eg to ignore timestamp changes etc. (or even better: to allow interpreting the timestamps or such and mark only difference larger/smaller than a given cutoff)?

--
You received this message because you are subscribed to the Google Groups "iterm2-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iterm2-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/iterm2-discuss/60ba7076-eb87-4295-8ef5-adc72ca1e9c5n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages