Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

COLOR /F issues

Charles Dye

Super Moderator
May
4,948
126
Staff member
Two or three issues with COLOR /F:


1. If the cursor is at the bottom of the window when COLOR /F is issued, and if the palette load succeeds, the console window shrinks by one line. If TCC is in a standalone console window, the console window actually gets smaller. If running in a tab window, you can't see the console window change, but one line at the bottom of the tab window becomes inaccessible.

I think this is due to a bug, or doc error, in SetConsoleScreenBufferInfoEx(). If you pick up console info via GetConsoleScreenBufferInfoEx() and then write it back with SetConsoleScreenBufferInfoEx(), you need to increment the values of BufferInfo.srWindow.Right and BufferInfo.srWindow.Bottom between the two.


2. I've tested a number of the themes at Iterm Themes - Color Schemes and Themes for Iterm2 (*.itermcolors format). Some work with COLOR /F; many do not.

It looks like COLOR /F's itermcolors parser requires components to be in this order:

Color Space (optional, ignored)​
Blue Component​
Green Component​
Red Component​

If these components are out of order in any way — if, for example, "Color Space" comes between "Blue Component" and "Red Component", or if there's an "Alpha Component" at the top — COLOR gorks with an error message, and keeps a handle to the file open.


3. After a successful palette load, I think that COLOR /F really ought to force a redraw of the console window or tab window, e.g. with RedrawWindow().
 

Similar threads

Back
Top