Open mobluse opened 2 years ago
Nice idea
I think colorama
doesn't have to be supported, the important thing is to support some of the escape codes that colorama
supports. I.e. the above mentioned for color and some for positioning on a line, and clear line and screen.
Thonny 4.1.4 supports:
ESC [ n C # move cursor n characters forward
ESC [ n D # move cursor n characters backward
Mu 1.0.3 supports:
# clear the screen
ESC [ mode J # clear the screen (Mu seems to always do ESC [ 2 J even if 0 or 1 is used.)
# clear the line
ESC [ mode K # clear the line (Mu tries to use the different modes (0, 1, 2) correctly.)
Problem you'd like to fix
To just have black on white in the shell is boring. It would be nice and educational if you could set some colors and styles of output in the shell.
The Python3 module colorama has these colors and styles, but DIM is the same as NORMAL in some systems: Fore: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET Back: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET Style: DIM, NORMAL, BRIGHT, RESET_ALL
One should also be able to use the corresponding ANSI/VT100/xterm escape codes for these colors and styles. This should work for both the large and small font.
Some shells in IDE:s for computers handles this, e.g. Thonny and Mu.
Describe the solution you'd like
These examples should work as in Thonny, Mu, and Python3 in e.g. LXTerminal with colorama installed:
Describe alternatives you've considered
I would bring up screen and line clearing, and cursor positioning in other issues, because Thonny and Mu doesn't support these in my versions now.
Additional context
In general I think the shell should work more like Pyhon3 in xterm, see also issue https://github.com/numworks/epsilon/issues/1892.