simon-git: filter (main): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Fri May 9 23:01:45 BST 2025
TL;DR:
00b865a Experimental 'recolour' filter.
Repository: https://git.tartarus.org/simon/filter.git
On the web: https://git.tartarus.org/?p=simon/filter.git
Branch updated: main
Committer: Simon Tatham <anakin at pobox.com>
Date: 2025-05-09 23:01:45
commit 00b865abfcbd27940ef634c5ed683dc14bc02827
web diff https://git.tartarus.org/?p=simon/filter.git;a=commitdiff;h=00b865abfcbd27940ef634c5ed683dc14bc02827;hp=9ac21195d1c4ec5cf46c624512e24300da1b7479
Author: Simon Tatham <anakin at pobox.com>
Date: Fri May 9 19:33:52 2025 +0100
Experimental 'recolour' filter.
This came out of a suggestion on Mastodon
https://mastodon.me.uk/@Diziet/114478700142767736
that for certain kinds of colour vision, it would be helpful for a
terminal to remap foreground _and_ background colours as a pair, e.g.
changing 'red on black' into 'white on red'.
It's hard to hack that into a terminal, but easier to make a pty-based
filter between the stream of escape sequences and the terminal itself,
which intercepts SGR sequences and rewrites them. So this is an
experimental platform for doing that.
At present, the only way to reconfigure its mapping rules is to edit
the source code and recompile. The function sgr_rewrite() contains a
simple example mapping rule that simply permutes the red, green and
blue channels of all the colours. So the idea is that you'd delete
that and replace it with whatever mapping rule you really wanted.
CMakeLists.txt | 1 +
recolour.c | 551 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 552 insertions(+)
More information about the tartarus-commits
mailing list