OS/2, eCS & ArcaOS - Technical > Programming
again colored text output of commandline programs (MeShell)
Martin Vieregg:
OK, an interesting hint. So in GCC, a MeShell user has to use
-fdiagnostics-color=always
But by default, the stderr output is shown in red color in MeShell. So I have to turn this functionlity off in these circumstances. A checkbox is an option, perhaps in the Top Panel for fast access. Or I implement another more intelligent mechanism (?). Any ideas are appreciated. Turning off the color when ESC sequences are coming could be too late because the output already began in red color. Perhaps I could correct the output in the editor if an ESC sequence comes through the stderr pipe. An automatic solution would be preffered.
Dave Yeo:
--- Quote from: Martin Vieregg on May 08, 2020, 06:33:09 pm ---OK, an interesting hint. So in GCC, a MeShell user has to use
-fdiagnostics-color=always
--- End quote ---
It seems to be enabled here whether fdiagnostics-color=always is in the CFLAGS or not. I believe our port is built with it enabled so would need something like fdiagnostics-color=no to turn off.
--- Quote ---But by default, the stderr output is shown in red color in MeShell. So I have to turn this functionlity off in these circumstances. A checkbox is an option, perhaps in the Top Panel for fast access. Or I implement another more intelligent mechanism (?). Any ideas are appreciated. Turning off the color when ESC sequences are coming could be too late because the output already began in red color. Perhaps I could correct the output in the editor if an ESC sequence comes through the stderr pipe. An automatic solution would be preffered.
--- End quote ---
I wonder how it is turned off when piping the output or redirecting? It seems automatic.
Martin Vieregg:
--- Quote ---I wonder how it is turned off when piping the output or redirecting? It seems automatic.
--- End quote ---
Yes, in the gcc docu, you can read that the default setting is "automatic".
Now, I have thaught about the color problem. The correct color handling with ESC sequences in stderr is not programmed yet, only for stdout. In MeShell 0.61, I will implement user settings for two different foreground (text) default colors for stdout and stderr output. If you use such compilers where a lot of (colored) output is running via stderr, the red color is definitely not the first choice. I will implement both default colors in the ini file and program parameters and I will implement a mechanism where you can easy transfer the current color settings to a string for the program parameters.
Do you use batch files for executing your compilers and tools?
Another idea for useful MeShell functionality would be to define unique shortcut strings which are simply replaced when sending the prompt string to cmd.exe. It would simplify this work. This would be more handy in some cases than writing tiny batch files.
Compilers from Unix often use Unix EOL encoded output. This is supported since MeShell 0.60 and was defective/not supported before.
Navigation
[0] Message Index
[*] Previous page
Go to full version