How to create scrollable console application that support ANSI escape code
sequences
I am making some assumptions here on technology based on what I know, but
other technology recommendations are welcome.
My goal: Write an ANSI Art viewer that as closely as possible resembles
viewing on a DOS machine as possible, preferably without the overhead of
running dosbox. This will run on a Raspberry Pi.
I have gotten my console to properly cat an ANSI with proper characters,
colors, etc. The catch with the "viewer" is that I would like to be able
to use the arrow keys to scroll up and down through the document, much
like, say, the "less" command does.
From what I have been able to research, curses is a perfect candidate for
this. The problem is that curses does not support ANSI escape code
sequences. There is an ANSI editor written in C++ that uses curses, but it
builds its own support for parsing the escape code sequences. Right now
this is my last resort.
So my question is: Is there a better route to creating a scrollable
console-mode application for viewing ANSI Art (Code Page 437 + ANSI escape
code sequences) in python on linux?
No comments:
Post a Comment