Terminal support for handling color text display with ANSI escape sequences #154
Formalising suggested enhancement to provide support for the display of coloured text in the terminal window of the WebIDE (and other usage of the core terminal module) as per forum discussion https://forum.espruino.com/conversations/380403/#comment16713624.
The text was updated successfully, but these errors were encountered:
Happy to be assigned the task
Investigations show the change can be effected in https://github.com/espruino/EspruinoTools/blob/master/core/terminal.js. In summary the new escape sequences need to be trapped and used to effect the creation of additional HTML to be sent to the terminal canvas in the browser plugin.
In more detail terminal.js functions handleRecievedCharacter() and updateTerminal() will be modified and a new function terminalCodesToHtml() (a modified version of Osteele's library) will be added.
Initial versions of these changes have been made and will be tested in the fork https://github.com/SimonGAndrews/EspruinoTools
Notes on testing to follow here (all comments welcome)
This sounds like a great idea to me.
However, I'm not entirely sure about: master...SimonGAndrews:EspruinoTools:master
Specifically I'm very unsure about including escape characters in termText. I think this will break other things (clicking, deleting, and also stepping over coloured text with arrow keys) as we assume that
As far as I can tell if you set the cursor color, right now it only sets the color for that line, not for subsequent lines?
I'm open to suggestions, but it feels like in
For each terminal line we could have an array of
ok, thanks Gordon,
Ill get a test for the areas you suggest would break, as Ive not seen that in a node standalone build of the WebIDE.
What other builds would need testing ?
will have another go next week.