#15: 'color' command doesn't accept ------------------------------------+--------------------------------------- Reporter: hawke@hawkesnest.net | Owner: somebody Type: defect | Status: new Priority: minor | Milestone: Component: FILO | Version: Keywords: | Dependencies: Patchstatus: there is no patch | ------------------------------------+--------------------------------------- using symbolic color names with the 'color' command (as described in 'help color') doesn't work. It just prints 'Error 23: Error while parsing number'.
#15: 'color' command doesn't accept -------------------------------------+-------------------------------------- Reporter: hawke@hawkesnest.net | Owner: somebody Type: defect | Status: new Priority: minor | Milestone: Component: FILO | Version: Resolution: | Keywords: Dependencies: | Patchstatus: there is no patch -------------------------------------+--------------------------------------
Comment(by stepan):
What color names did you try? This seems to work fine here.
#15: 'color' command doesn't accept -------------------------------------+-------------------------------------- Reporter: hawke@hawkesnest.net | Owner: oxygene Type: defect | Status: assigned Priority: minor | Milestone: Component: FILO | Version: Resolution: | Keywords: Dependencies: | Patchstatus: patch needs review -------------------------------------+-------------------------------------- Changes (by oxygene):
* owner: somebody => oxygene * status: new => assigned * patchstatus: there is no patch => patch needs review
Comment:
what is not supposed to work (according to the current code) is using colors 8..15 as background color, ie. any of these: "dark-gray", "light- red", "light-green", "yellow", "light-blue", "light-magenta", "light- cyan", "white"
The attached patch removes the "blink-"-feature (as it doesn't seem to work anyway), and allows all colors for both foreground and background. Tested on QEmu.
#15: 'color' command doesn't accept -------------------------------------+-------------------------------------- Reporter: hawke@hawkesnest.net | Owner: oxygene Type: defect | Status: closed Priority: minor | Milestone: Component: FILO | Version: Resolution: fixed | Keywords: Dependencies: | Patchstatus: patch has been committed -------------------------------------+-------------------------------------- Changes (by oxygene):
* status: assigned => closed * patchstatus: patch needs review => patch has been committed * resolution: => fixed
#15: 'color' command doesn't accept -------------------------------------+-------------------------------------- Reporter: hawke@hawkesnest.net | Owner: oxygene Type: defect | Status: closed Priority: minor | Milestone: Component: FILO | Version: Resolution: fixed | Keywords: Dependencies: | Patchstatus: patch has been committed -------------------------------------+--------------------------------------
Comment(by hawke@hawkesnest.net):
Ah, I had tried with 'red/white'. while that is an invalid background color according to current code (and in help), it shouldn't print 'Error while parsing number'
In fact, it should probably never print that, since there's no requirement that the command have a number.
#15: 'color' command doesn't accept -------------------------------------+-------------------------------------- Reporter: hawke@hawkesnest.net | Owner: oxygene Type: defect | Status: closed Priority: minor | Milestone: Component: FILO | Version: Resolution: fixed | Keywords: Dependencies: | Patchstatus: patch has been committed -------------------------------------+--------------------------------------
Comment(by hawke@hawkesnest.net):
Looks like QEmu doesn't work like a real VGA display then.
This was a bad patch. The background color in traditional VGA has no 'bright' bit, and therefore only 8 colors.
So the problem is definitely in the error message, rather than in how the color strings are interpreted.
It turns out the error message comes in when the fallback from color_number() tries to do a safe_parse_maxint() on the string. It assumes that if it's not a valid color specifier string, then it must be an integer rather than simply an invalid color specifier. Naturally it should try to parse it as an integer as well, but if it's not an integer either it should handle that properly.
On another, related note:
The bits in the color byte *as used in filo* are: 7: foreground bright 6: foreground blue 5: foreground green 4: foreground red 3: foreground blink 2: background blue 1: background green 0: background red
This is in contrast with pretty much every VGA color setting method out there:
7: 1 = blinking on; 0 = blinking off 6: Background red component on/off 5: Background green component on/off 4: Background blue component on/off 3: High-intensity foreground on/off 2: Foreground red component on/off 1: Foreground green component on/off 0: Foreground blue component on/off
I've attached a patch which: * Reverts the previous patch * Makes the FILO color byte match the VGA color byte * Makes the 'BG' part optional (black is assumed if it's not specified) * Makes the color command use ERR_BAD_ARGUMENT instead of the ERR_NUMBER_PARSING from safe_parse_maxint()
#15: 'color' command doesn't accept -------------------------------------+-------------------------------------- Reporter: hawke@hawkesnest.net | Owner: oxygene Type: defect | Status: reopened Priority: minor | Milestone: Component: FILO | Version: Resolution: | Keywords: Dependencies: | Patchstatus: patch has been committed -------------------------------------+-------------------------------------- Changes (by oxygene):
* status: closed => reopened * resolution: fixed =>
#15: 'color' command doesn't accept -------------------------------------+-------------------------------------- Reporter: hawke@hawkesnest.net | Owner: oxygene Type: defect | Status: reopened Priority: minor | Milestone: Component: FILO | Version: Resolution: | Keywords: Dependencies: | Patchstatus: patch has been committed -------------------------------------+--------------------------------------
Comment(by oxygene):
I commited hawke's patches (Changesets 74, 75). Please re-test and close.
#15: 'color' command doesn't accept -------------------------------------+-------------------------------------- Reporter: hawke@hawkesnest.net | Owner: oxygene Type: defect | Status: closed Priority: minor | Milestone: Component: FILO | Version: Resolution: fixed | Keywords: Dependencies: | Patchstatus: patch has been committed -------------------------------------+-------------------------------------- Changes (by oxygene):
* status: reopened => closed * resolution: => fixed