The topic was to re-invent the wheel yet again and create a terminal
emulator.

I hesitate to say this but one approach is to consider the curses module as
described by our very own Alan Gauld in a book:

https://www.amazon.com/Programming-curses-Python-Alan-Gauld-ebook/dp/B091B85
B77

The topic is how to make a terminal emulator and as Alan mentions, each kind
of terminal may accept various kinds of escape sequences. There are files
available the are normally used by curses to get a description of sorts of
the capabilities and details of a terminal like a VT100 that curses can use
to decide what stream of bytes to send to update a screen.

You might be able to use something similar, or better, to see what your
terminal emulator should emulate.

And, it may even be possible for you to emulate lots of terminals with the
same basic code.

-----Original Message-----
From: Python-list <python-list-bounces+avi.e.gross=gmail....@python.org> On
Behalf Of Alan Gauld via Python-list
Sent: Tuesday, May 14, 2024 3:07 PM
To: Gordinator <gordina...@gordinator.org>; python-list@python.org
Subject: Re: Terminal Emulator

On 14/05/2024 18:44, Gordinator via Python-list wrote:
> I wish to write a terminal emulator in Python. I am a fairly competent 
> Python user, and I wish to try a new project idea. What references can I 
> use when writing my terminal emulator? I wish for it to be a true 
> terminal emulator as well, not just a Tk text widget or something like
that.

The first thing is to decide which terminal. A VT100 is very different
from a 3270. And even a VT330 is quite different from a VT100 although
sharing a common subset of control codes. And if you start looking at
graphical terminals things get even more interesting!

The other thing to consider is whether it will be a standalone app or
a GUI component. If the latter do you want to expose your own API or
clone the manufacturers? Or both?!
Or you could make it an object that can be used both in GUIs and in
"robotic" or "batch" mode. So many options.

Most of the specs are available online and there must be dozens of
terminal emulators around written in C so you should have plenty
of sample code to study. Good luck!

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


-- 
https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to