mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 11:02:48 -05:00
Support OSC 4 terminal colour-palette queries.
Markus Gans points out that some applications which (not at all unreasonably) don't trust $TERM to tell them the full capabilities of their terminal will use the sequence "OSC 4 ; nn ; ? BEL" to ask for the colour-palette value in position nn, and they may not particularly care _what_ the results are but they will use them to decide whether the right number of colour palette entries even exist.
This commit is contained in:
@ -2222,6 +2222,17 @@ void palette_set(void *frontend, int n, int r, int g, int b)
|
||||
}
|
||||
}
|
||||
|
||||
int palette_get(void *frontend, int n, int *r, int *g, int *b)
|
||||
{
|
||||
struct gui_data *inst = (struct gui_data *)frontend;
|
||||
if (n < 0 || n >= NALLCOLOURS)
|
||||
return FALSE;
|
||||
*r = inst->cols[n].red >> 8;
|
||||
*g = inst->cols[n].green >> 8;
|
||||
*b = inst->cols[n].blue >> 8;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void palette_reset(void *frontend)
|
||||
{
|
||||
struct gui_data *inst = (struct gui_data *)frontend;
|
||||
|
Reference in New Issue
Block a user