cant find the code that handles the terminal window
it is in EspruinoTools submodule
Don't see anything about color and also any html printed by js code is escaped. Special case are inline images produced by
g.dump()- handled here https://github.com/espruino/EspruinoTools/blob/master/core/terminal.js#L438
escape codes handled here https://github.com/espruino/EspruinoTools/blob/master/core/terminal.js#L521
Thanks @fanoush , that's a great start.
Is there an existing way to colour text being displayed in the Web IDE Terminal window.
Specifically for colouring the text from the execution of console.log('string') in espruino.
It seems a common method would be to prefix the string with an ANSI escape sequence such as
Red: \u001b[31m. or green
This works in node in vscode.
Ive tried this in Espruino WebIDE
and it looks like the the escape sequence is being trapped , because not all of it is printed.
Ive had a poke around the WebIDE code on github but I cant find the code that handles the terminal window. I can see that there is colour styling of the code editor window.
My use case is im having a quick look at the feasability of a simple jest style unit testing tool and would like to colour the output to the console. Which looks good so far. (colour is a bit of a nice to have I would agree)
Any cluse on an approach to implement the coloured output text appreciated. And a high level of how the terminal window is driven ??. Is there is some escape sequence to HTML going on somehwere ??
Thanks in advance, Simon