dyna
dyna copied to clipboard
special color for user input in REPL
Could user input be shown at the REPL in a special color? Or perhaps in bold? It's nice to distinguish input from output when scrolling. And it would also be helpful to distinguish them in doctests and when showing REPL traces in the tutorial or manual.
(If user input needs to be in the default color, I imagine everything else could be in a special color ...)
How about a compromise: only the >
will be a special color. This is what other REPLs seem to do (e.g. IPython, bash terminals are often configures to have colorful PS1).
Compromise because what I suggested is hard? The compromise is better than what we have now, but the version I suggested seems nicer if we could get it. Especially better for distinguishing input from output in the manual, and for clarifying where there's multi-line input.
Compromise because what I suggested is hard?
Yup. It's pretty tricky to get colors in the terminal to be well-behaved. For example, If you ^C in the middle of an ANSI control code, it will break your terminal (e.g. you wont be able to see what your typing). Limiting the use of color is generally a good idea. This is why you don't tend to see very many colorful terminal applications (unless it's curses).
Should probably xref:#11
Seems like the ^C problem would bite us for using any amount of color: limiting the amount doesn't really fix it, does it? But to fix it, isn't there a reset-terminal ANSI code that we could emit after ^C?
How about the idea of having user input in the default color, but all output in other colors? Does that help? The output is pretty darn colorful already ...