mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-05-08 05:02:09 -05:00
Improve SCOANSI emulation: The colours that SGR 0 returns to are now changed
by the SCO SNF and SNB sequences, which seems to be what the SCO console does (at least in the new mode documented for OpenServer 5.0.6). [originally from svn r3286]
This commit is contained in:
parent
4c8bd3a8dd
commit
b287bd5606
22
terminal.c
22
terminal.c
@ -201,7 +201,7 @@ static void power_on(Terminal *term)
|
|||||||
term->in_vbell = FALSE;
|
term->in_vbell = FALSE;
|
||||||
term->cursor_on = 1;
|
term->cursor_on = 1;
|
||||||
term->big_cursor = 0;
|
term->big_cursor = 0;
|
||||||
term->save_attr = term->curr_attr = ATTR_DEFAULT;
|
term->default_attr = term->save_attr = term->curr_attr = ATTR_DEFAULT;
|
||||||
term->term_editing = term->term_echoing = FALSE;
|
term->term_editing = term->term_echoing = FALSE;
|
||||||
term->app_cursor_keys = term->cfg.app_cursor;
|
term->app_cursor_keys = term->cfg.app_cursor;
|
||||||
term->app_keypad_keys = term->cfg.app_keypad;
|
term->app_keypad_keys = term->cfg.app_keypad;
|
||||||
@ -2376,7 +2376,7 @@ void term_out(Terminal *term)
|
|||||||
for (i = 0; i < term->esc_nargs; i++) {
|
for (i = 0; i < term->esc_nargs; i++) {
|
||||||
switch (def(term->esc_args[i], 0)) {
|
switch (def(term->esc_args[i], 0)) {
|
||||||
case 0: /* restore defaults */
|
case 0: /* restore defaults */
|
||||||
term->curr_attr = ATTR_DEFAULT;
|
term->curr_attr = term->default_attr;
|
||||||
break;
|
break;
|
||||||
case 1: /* enable bold */
|
case 1: /* enable bold */
|
||||||
compatibility(VT100AVO);
|
compatibility(VT100AVO);
|
||||||
@ -2782,21 +2782,27 @@ void term_out(Terminal *term)
|
|||||||
case ANSI('F', '='): /* set normal foreground */
|
case ANSI('F', '='): /* set normal foreground */
|
||||||
compatibility(SCOANSI);
|
compatibility(SCOANSI);
|
||||||
if (term->esc_args[0] >= 0 && term->esc_args[0] < 16) {
|
if (term->esc_args[0] >= 0 && term->esc_args[0] < 16) {
|
||||||
term->curr_attr &= ~ATTR_FGMASK;
|
long colour =
|
||||||
term->curr_attr |=
|
(sco2ansicolour[term->esc_args[0] & 0x7] |
|
||||||
(sco2ansicolour[term->esc_args[0] & 0x7] |
|
|
||||||
((term->esc_args[0] & 0x8) << 1)) <<
|
((term->esc_args[0] & 0x8) << 1)) <<
|
||||||
ATTR_FGSHIFT;
|
ATTR_FGSHIFT;
|
||||||
|
term->curr_attr &= ~ATTR_FGMASK;
|
||||||
|
term->curr_attr |= colour;
|
||||||
|
term->default_attr &= ~ATTR_FGMASK;
|
||||||
|
term->default_attr |= colour;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ANSI('G', '='): /* set normal background */
|
case ANSI('G', '='): /* set normal background */
|
||||||
compatibility(SCOANSI);
|
compatibility(SCOANSI);
|
||||||
if (term->esc_args[0] >= 0 && term->esc_args[0] < 16) {
|
if (term->esc_args[0] >= 0 && term->esc_args[0] < 16) {
|
||||||
term->curr_attr &= ~ATTR_BGMASK;
|
long colour =
|
||||||
term->curr_attr |=
|
(sco2ansicolour[term->esc_args[0] & 0x7] |
|
||||||
(sco2ansicolour[term->esc_args[0] & 0x7] |
|
|
||||||
((term->esc_args[0] & 0x8) << 1)) <<
|
((term->esc_args[0] & 0x8) << 1)) <<
|
||||||
ATTR_BGSHIFT;
|
ATTR_BGSHIFT;
|
||||||
|
term->curr_attr &= ~ATTR_BGMASK;
|
||||||
|
term->curr_attr |= colour;
|
||||||
|
term->default_attr &= ~ATTR_BGMASK;
|
||||||
|
term->default_attr |= colour;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ANSI('L', '='):
|
case ANSI('L', '='):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user