#!/bin/sed -f
# Removes terminal control sequences from input.
# /lib/ecma/ECMA-035.pdf:
#	13.2.2 Escape sequences of type nF
#	14.3 Designation of sets for grapfic characters
#	(incomplete but enough for local needs.)
s;[(-+./\-][0-?@-_];;g
# /lib/ecma/ECMA-048.pdf
#	5.2 Elements of C0 set
#		- backspace
s;.;;g
#	5.4 Control sequences
s;\[[0-?]*[ -/]*[@-~];;g
#	5.5 Independent control functions
s;[`-~];;g
#	5.6 Control strings
s;[_P\]X][-
 -~]*\\;;g
 
 |