BigDumbDinosaur wrote:
...
Your editor should be able to “talk” to any console by use of a separate driver that knows how to run the display, as well as how to decode what is coming from the keyboard.
...
Correct, but you have to start with a driver of some sort if you don't have one. If you look at the code I was working on, I was working towards trying to keep the ANSI escape stuff isolated from the editor; distilling down the "key presses" into more or less single "command" bytes indicated by the carry flag in the 6502. The idea being that I might want to interface with a PS/2 or custom keyboard later on.
E.g.:
Convert: <esc>[0 ==> KEY_HOME
The actual editor portion then figures out what to do with KEY_HOME, and has little care that the sequence was an ANSI escape or a direct key press on a keyboard.
This will get refined later down the road as I keep working on this of course.
That being said things can get complex regardless of it being ANSI or not depending on how much you need to update the display.
Wozmon for example leaves the characters on my terminal when I hit backspace. (Guessing it did this on the Apple I as well, but I wouldn't know for sure)
If I wanted to "erase" the character I'd have to actually start adding some code to blank that character out, one way or another.
Adding a character in the middle of the line? Now you need to shift multiple characters around; adds up quick.