From: W. Trevor King Date: Sun, 13 Jan 2013 14:34:24 +0000 (-0500) Subject: script-publish.py: Add more control codes (reset1, reset2, ...) X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e6770b308c9fea0c0916669c312f9f0c90eed460;p=mw2txt.git script-publish.py: Add more control codes (reset1, reset2, ...) These new codes were from a typescript where I had used the `reset` command. Xterm doesn't support rs3, but I thought I'd add it for completeness. The reset commands are listed in order of decreasing complication (rs3, rs2, rs1), so that if rs1 is a subset of rs2, we don't match part of an rs2 entry with our rs1 regexp and leave the rest unmatched. Ideally, we'll only match the low level escape codes, and compound escapes like rs2 will be handled automatically by taking care of their constituent parts. Until we get to that point, we'll need to be careful about the order of ControlCodes. --- diff --git a/posts/script/script-publish.py b/posts/script/script-publish.py index c156fde..b772e8b 100755 --- a/posts/script/script-publish.py +++ b/posts/script/script-publish.py @@ -407,8 +407,14 @@ class ControlParser (object): ControlCode('cursor normal visibility', 'cnorm', term=self._term), # Funky stuff ControlCode('horizontal tab', 'ht', term=self._term), + ControlCode('set tab', 'hts', term=self._term), + ControlCode('clear all tabs', 'tbc', term=self._term), + ControlCode('reset 3', 'rs3', term=self._term), + ControlCode('reset 2', 'rs2', term=self._term), + ControlCode('reset 1', 'rs1', term=self._term), ControlCode('insert line', 'il1', term=self._term), ControlCode('insert line', 'il', term=self._term), + ControlCode('insert character', 'ich'), ControlCode('erase characters', 'ech', term=self._term), ControlCode('operating system command', regexp=_re.compile(b'\x1b]'), term=self._term), # [1]