Why is there no platform independent way of clearing a terminal?

Tim Harig usernet at ilthio.net
Wed Jul 28 16:28:04 EDT 2010


On 2010-07-28, Thomas Jollans <thomas at jollans.com> wrote:
> It might be possible to write a curses-compatible library that works
> with cmd.exe. Maybe. But, even if it's possible, I don't think it's
> easy, and I especially don't think it would be particularly rewarding.

http://pdcurses.sourceforge.net/

It would be rewarding as it would make writing cross-platform charactor
mode applications possible.  Using curses for the interface makes a lot of
sense because it is already supported by almost every Unix/POSIX platorm,
so re-implementation is only required for those odd platforms (Windows)
where it does not exist natively,; because well documented on the internet
and in print; and because a huge number of people are already familiar with
its API.

If licensing permits, I don't think it would be too difficult difficult to
embed something like pdcurses into the existing curses module to use as a
backup for platforms where curses does not already exist.  If not, there
cannot be much difference to writing a terminal emulator that runs inside
the windows console and there are a *huge* number of terminal emulators
available for ansi/vt100 terminals.  Add a termcap database mechanism and
an embedded emulator can easily convert the excape codes into actions for
the console.



More information about the Python-list mailing list