ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/command.C
(Generate patch)

Comparing rxvt-unicode/src/command.C (file contents):
Revision 1.145 by root, Mon Aug 16 12:04:57 2004 UTC vs.
Revision 1.163 by root, Wed Aug 25 03:47:20 2004 UTC

133 { 133 {
134 text_t t = screen.text[y + TermWin.saveLines - TermWin.view_start][x]; 134 text_t t = screen.text[y + TermWin.saveLines - TermWin.view_start][x];
135 135
136 if (t != NOCHAR || !x) 136 if (t != NOCHAR || !x)
137 { 137 {
138 iso14755_51 (screen.text[y + TermWin.saveLines - TermWin.view_start][x]); 138 iso14755_51 (screen.text[y + TermWin.saveLines - TermWin.view_start][x],
139 screen.rend[y + TermWin.saveLines - TermWin.view_start][x]);
139 iso14755buf = ISO_14755_54; 140 iso14755buf = ISO_14755_54;
140 break; 141 break;
141 } 142 }
142 143
143 x--; 144 x--;
146} 147}
147#endif 148#endif
148 149
149#if ENABLE_OVERLAY 150#if ENABLE_OVERLAY
150void 151void
151rxvt_term::iso14755_51 (wchar_t ch) 152rxvt_term::iso14755_51 (unicode_t ch, rend_t r)
152{ 153{
154 rxvt_fontset *fs = FONTSET (r);
155 rxvt_font *f = (*fs)[fs->find_font (ch)];
153 wchar_t *chr, *alloc; 156 wchar_t *chr, *alloc, ch2;
154 int len; 157 int len;
155 158
156#if ENABLE_COMBINING 159#if ENABLE_COMBINING
157 if (IS_COMPOSE (ch)) 160 if (IS_COMPOSE (ch))
158 { 161 {
161 rxvt_composite.expand (ch, chr); 164 rxvt_composite.expand (ch, chr);
162 } 165 }
163 else 166 else
164#endif 167#endif
165 { 168 {
169 ch2 = ch;
170
166 alloc = 0; 171 alloc = 0;
167 chr = &ch; 172 chr = &ch2;
168 len = 1; 173 len = 1;
169 } 174 }
170 175
171 scr_overlay_new (0, -1, 8 + 5, len); 176 int width = strlen (f->name);
177
178 scr_overlay_new (0, -1, width < 8+5 ? 8+5 : width, len + 1);
179
180 r = SET_STYLE (OVERLAY_RSTYLE, GET_STYLE (r));
172 181
173 for (int y = 0; y < len; y++) 182 for (int y = 0; y < len; y++)
174 { 183 {
175 char buf[9]; 184 char buf[9];
176 185
181 scr_overlay_set (9, y, '='); 190 scr_overlay_set (9, y, '=');
182#if !UNICODE3 191#if !UNICODE3
183 if (ch >= 0x10000) 192 if (ch >= 0x10000)
184 ch = 0xfffd; 193 ch = 0xfffd;
185#endif 194#endif
186 scr_overlay_set (11, y, ch); 195 scr_overlay_set (11, y, ch, r);
187 scr_overlay_set (12, y, NOCHAR); 196 scr_overlay_set (12, y, NOCHAR, r);
188 } 197 }
198
199 scr_overlay_set (0, len, f->name);
189 200
190#if ENABLE_COMBINING 201#if ENABLE_COMBINING
191 if (alloc) 202 if (alloc)
192 delete [] alloc; 203 delete [] alloc;
193#endif 204#endif
1137 + ((MEvent.state & ModMetaMask) ? 8 : 0) 1148 + ((MEvent.state & ModMetaMask) ? 8 : 0)
1138 + ((MEvent.state & ControlMask) ? 16 : 0); 1149 + ((MEvent.state & ControlMask) ? 16 : 0);
1139#ifdef MOUSE_REPORT_DOUBLECLICK 1150#ifdef MOUSE_REPORT_DOUBLECLICK
1140 key_state += ((MEvent.clicks > 1) ? 32 : 0); 1151 key_state += ((MEvent.clicks > 1) ? 32 : 0);
1141#endif 1152#endif
1142
1143 } 1153 }
1144 1154
1145#ifdef DEBUG_MOUSEREPORT 1155#if DEBUG_MOUSEREPORT
1146 fprintf (stderr, "Mouse ["); 1156 fprintf (stderr, "Mouse [");
1147 if (key_state & 16) 1157 if (key_state & 16)
1148 fputc ('C', stderr); 1158 fputc ('C', stderr);
1149 if (key_state & 4) 1159 if (key_state & 4)
1150 fputc ('S', stderr); 1160 fputc ('S', stderr);
1154 fputc ('2', stderr); 1164 fputc ('2', stderr);
1155 fprintf (stderr, "]: <%d>, %d/%d\n", 1165 fprintf (stderr, "]: <%d>, %d/%d\n",
1156 button_number, 1166 button_number,
1157 x + 1, 1167 x + 1,
1158 y + 1); 1168 y + 1);
1159#else 1169#endif
1170
1160 tt_printf ("\033[M%c%c%c", 1171 tt_printf ("\033[M%c%c%c",
1161 (32 + button_number + key_state), 1172 (32 + button_number + key_state),
1162 (32 + x + 1), 1173 (32 + x + 1),
1163 (32 + y + 1)); 1174 (32 + y + 1));
1164#endif
1165} 1175}
1166 1176
1167#ifdef USING_W11LIB 1177#ifdef USING_W11LIB
1168void 1178void
1169rxvt_W11_process_x_event (XEvent *ev) 1179rxvt_W11_process_x_event (XEvent *ev)
1227 1237
1228 break; 1238 break;
1229 1239
1230 case KeyRelease: 1240 case KeyRelease:
1231 { 1241 {
1232#if (defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING)) || defined (ENABLE_FRILLS) 1242#if (MOUSE_WHEEL && MOUSE_SLIP_WHEELING) || ISO_14755
1233 KeySym ks; 1243 KeySym ks;
1234 1244
1235 ks = XLookupKeysym (&ev.xkey, ev.xkey.state & ShiftMask ? 1 : 0); // sorry, only shift supported :/ 1245 ks = XLookupKeysym (&ev.xkey, ev.xkey.state & ShiftMask ? 1 : 0); // sorry, only shift supported :/
1236#endif 1246#endif
1237 1247
1388#endif 1398#endif
1389#ifdef OFF_FOCUS_FADING 1399#ifdef OFF_FOCUS_FADING
1390 if (rs[Rs_fade]) 1400 if (rs[Rs_fade])
1391 { 1401 {
1392 pix_colors = pix_colors_focused; 1402 pix_colors = pix_colors_focused;
1393 set_colorfgbg ();
1394 scr_clear (); 1403 scr_recolour ();
1395 scr_touch (true);
1396 } 1404 }
1397#endif 1405#endif
1398 1406
1399 } 1407 }
1400 break; 1408 break;
1402 case FocusOut: 1410 case FocusOut:
1403 if (TermWin.focus) 1411 if (TermWin.focus)
1404 { 1412 {
1405 TermWin.focus = 0; 1413 TermWin.focus = 0;
1406 want_refresh = 1; 1414 want_refresh = 1;
1415
1416#if ENABLE_FRILLS || ISO_14755
1417 iso14755buf = 0;
1418#endif
1419#if ENABLE_OVERLAY
1420 scr_overlay_off ();
1421#endif
1407#ifdef USE_XIM 1422#ifdef USE_XIM
1408 if (Input_Context != NULL) 1423 if (Input_Context != NULL)
1409 XUnsetICFocus (Input_Context); 1424 XUnsetICFocus (Input_Context);
1410#endif 1425#endif
1411#ifdef CURSOR_BLINK 1426#ifdef CURSOR_BLINK
1415#endif 1430#endif
1416#ifdef OFF_FOCUS_FADING 1431#ifdef OFF_FOCUS_FADING
1417 if (rs[Rs_fade]) 1432 if (rs[Rs_fade])
1418 { 1433 {
1419 pix_colors = pix_colors_unfocused; 1434 pix_colors = pix_colors_unfocused;
1420 set_colorfgbg ();
1421 scr_clear (); 1435 scr_recolour ();
1422 scr_touch (true);
1423 } 1436 }
1424#endif 1437#endif
1425
1426 } 1438 }
1427 break; 1439 break;
1428 1440
1429 case ConfigureNotify: 1441 case ConfigureNotify:
1430 if (ev.xconfigure.window == TermWin.parent[0]) 1442 if (ev.xconfigure.window == TermWin.parent[0])
1438 D_SIZE ((stderr, "Size: ConfigureNotify: %4d x %4d", width, height)); 1450 D_SIZE ((stderr, "Size: ConfigureNotify: %4d x %4d", width, height));
1439 } 1451 }
1440 while (XCheckTypedWindowEvent (display->display, ev.xconfigure.window, ConfigureNotify, &ev)); 1452 while (XCheckTypedWindowEvent (display->display, ev.xconfigure.window, ConfigureNotify, &ev));
1441 1453
1442 if (szHint.width != width || szHint.height != height) 1454 if (szHint.width != width || szHint.height != height)
1455 {
1456 seen_resize = 1;
1443 resize_all_windows (width, height, 1); 1457 resize_all_windows (width, height, 1);
1458 }
1444 1459
1445#ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ 1460#ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */
1446 if (options & Opt_transparent) 1461 if (options & Opt_transparent)
1447 { 1462 {
1448 check_our_parents (); 1463 check_our_parents ();
2515 2530
2516 for (; i < (int) (sizeof (TermWin.parent) / sizeof (Window)); i++) 2531 for (; i < (int) (sizeof (TermWin.parent) / sizeof (Window)); i++)
2517 TermWin.parent[i] = None; 2532 TermWin.parent[i] = None;
2518 } 2533 }
2519 2534
2520 // this is experimental
2521 if (scrollBar.win) 2535 if (scrollBar.win)
2522 { 2536 {
2523 XSetWindowBackgroundPixmap (display->display, scrollBar.win, ParentRelative); 2537 XSetWindowBackgroundPixmap (display->display, scrollBar.win, ParentRelative);
2524 XClearWindow (display->display, scrollBar.win);
2525 scrollBar.setIdle (); 2538 scrollBar.setIdle ();
2526 scrollbar_show (0); 2539 scrollbar_show (0);
2527 } 2540 }
2528 2541
2529 return pchanged; 2542 return pchanged;
2557 seen_input = 1; 2570 seen_input = 1;
2558 // many badly-written programs (e.g. jed) contain a race condition: 2571 // many badly-written programs (e.g. jed) contain a race condition:
2559 // they first read the screensize and then install a SIGWINCH handler. 2572 // they first read the screensize and then install a SIGWINCH handler.
2560 // some window managers resize the window early, and these programs 2573 // some window managers resize the window early, and these programs
2561 // then sometimes get the size wrong. 2574 // then sometimes get the size wrong.
2575 // unfortunately other programs are even more buggy and dislike
2576 // being sent SIGWINCH, so only do it when we were in fact being
2577 // resized.
2578 if (seen_resize)
2562 kill (-cmd_pid, SIGWINCH); 2579 kill (-cmd_pid, SIGWINCH);
2563 } 2580 }
2564 2581
2565 /* Read a text string from the input buffer */ 2582 /* Read a text string from the input buffer */
2566 unicode_t buf[UBUFSIZ]; 2583 unicode_t buf[UBUFSIZ];
2567 bool refreshnow = false; 2584 bool refreshnow = false;
3487 * ends_how is terminator used. returned input must be free()'d 3504 * ends_how is terminator used. returned input must be free()'d
3488 */ 3505 */
3489unsigned char * 3506unsigned char *
3490rxvt_term::get_to_st (unicode_t &ends_how) 3507rxvt_term::get_to_st (unicode_t &ends_how)
3491{ 3508{
3492 unicode_t prev = 0, ch; 3509 unicode_t seen_esc = 0, ch;
3493 unsigned int n = 0; 3510 unsigned int n = 0;
3494 unsigned char *s; 3511 unsigned char *s;
3495 unsigned char string[STRING_MAX]; 3512 unsigned char string[STRING_MAX];
3496 3513
3497 while ((ch = cmd_getc ()) != NOCHAR) 3514 while ((ch = cmd_getc ()) != NOCHAR)
3498 { 3515 {
3499 if (prev == C0_ESC) 3516 if (seen_esc)
3500 { 3517 {
3501 if (ch == 0x5c) /* 7bit ST */ 3518 if (ch == 0x5c) /* 7bit ST */
3502 break; 3519 break;
3503 else 3520 else
3504 return NULL; 3521 return NULL;
3505 } 3522 }
3523 else if (ch == C0_ESC)
3524 {
3525 seen_esc = 1;
3526 continue;
3527 }
3506 else if (ch == C0_BEL || ch == CHAR_ST) 3528 else if (ch == C0_BEL || ch == CHAR_ST)
3507 break; 3529 break;
3508 else if (ch < 0x20) 3530 else if (ch < 0x20)
3509 return NULL; /* other control character - exit */ 3531 return NULL; /* other control character - exit */
3532
3533 seen_esc = 0;
3510 3534
3511 if (n >= sizeof (string) - 1) 3535 if (n >= sizeof (string) - 1)
3512 // stop at some sane length 3536 // stop at some sane length
3513 return NULL; 3537 return NULL;
3514 3538
3515 if (ch == C0_SYN) 3539 if (ch == C0_SYN)
3516 {
3517 string[n++] = cmd_get8 (); 3540 string[n++] = cmd_get8 ();
3518 prev = 0;
3519 }
3520 else 3541 else
3521 string[n++] = prev = ch; 3542 string[n++] = ch;
3522 } 3543 }
3523 3544
3524 string[n++] = '\0'; 3545 string[n++] = '\0';
3525 3546
3526 if ((s = (unsigned char *)rxvt_malloc (n)) == NULL) 3547 if ((s = (unsigned char *)rxvt_malloc (n)) == NULL)
3620{ 3641{
3621 int changed = 0; 3642 int changed = 0;
3622 int color; 3643 int color;
3623 char *buf, *name; 3644 char *buf, *name;
3624 bool query = str[0] == '?' && !str[1]; 3645 bool query = str[0] == '?' && !str[1];
3646 int saveop = op;
3625 3647
3626 assert (str != NULL); 3648 assert (str != NULL);
3627 switch (op) 3649 switch (op)
3628 { 3650 {
3629 case XTerm_name: 3651 case XTerm_name:
3721 break; 3743 break;
3722#ifndef NO_BOLD_UNDERLINE_REVERSE 3744#ifndef NO_BOLD_UNDERLINE_REVERSE
3723 case XTerm_Color_BD: 3745 case XTerm_Color_BD:
3724 process_color_seq (XTerm_Color_BD, Color_BD, str, resp); 3746 process_color_seq (XTerm_Color_BD, Color_BD, str, resp);
3725 break; 3747 break;
3748 case XTerm_Color_IT:
3749 process_color_seq (XTerm_Color_IT, Color_IT, str, resp);
3750 break;
3726 case XTerm_Color_UL: 3751 case XTerm_Color_UL:
3727 process_color_seq (XTerm_Color_UL, Color_UL, str, resp); 3752 process_color_seq (XTerm_Color_UL, Color_UL, str, resp);
3728 break; 3753 break;
3729 case XTerm_Color_RV: 3754 case XTerm_Color_RV:
3730 process_color_seq (XTerm_Color_RV, Color_RV, str, resp); 3755 process_color_seq (XTerm_Color_RV, Color_RV, str, resp);
3756 break;
3757#endif
3758#if TRANSPARENT || TINTING
3759 case XTerm_Color_tint:
3760 process_color_seq (XTerm_Color_tint, Color_tint, str, resp);
3761 check_our_parents ();
3762 if (am_transparent)
3763 want_full_refresh = want_refresh = 1;
3731 break; 3764 break;
3732#endif 3765#endif
3733 3766
3734 case XTerm_Pixmap: 3767 case XTerm_Pixmap:
3735 if (*str != ';') 3768 if (*str != ';')
3767 case XTerm_logfile: 3800 case XTerm_logfile:
3768 // TODO, when secure mode? 3801 // TODO, when secure mode?
3769 break; 3802 break;
3770 3803
3771 case XTerm_font: 3804 case XTerm_font:
3805 op = URxvt_font;
3806 case URxvt_font:
3807#if ENABLE_STYLES
3808 case URxvt_boldFont:
3809 case URxvt_italicFont:
3810 case URxvt_boldItalicFont:
3811#endif
3772 if (query) 3812 if (query)
3773 tt_printf ("\33]%d;%-.250s%c", XTerm_font, 3813 tt_printf ("\33]%d;%-.250s%c", saveop,
3774 (options & Opt_insecure) && TermWin.fontset->fontdesc 3814 (options & Opt_insecure) && TermWin.fontset[op - URxvt_font]->fontdesc
3775 ? TermWin.fontset->fontdesc : "", 3815 ? TermWin.fontset[op - URxvt_font]->fontdesc : "",
3776 resp); 3816 resp);
3777 else 3817 else
3818 {
3819 const char *&res = rs[Rs_font + (op - URxvt_font)];
3820
3821 res = strdup (str);
3822 allocated.push_back ((void *)res);
3778 change_font (str); 3823 set_fonts ();
3824 }
3779 break; 3825 break;
3780 3826
3781#if ENABLE_FRILLS 3827#if ENABLE_FRILLS
3782 case XTerm_locale: 3828 case XTerm_locale:
3783 if (query) 3829 if (query)
3787 set_locale (str); 3833 set_locale (str);
3788# ifdef USE_XIM 3834# ifdef USE_XIM
3789 im_cb (); 3835 im_cb ();
3790# endif 3836# endif
3791 } 3837 }
3792 break;
3793
3794 case XTerm_findfont:
3795 {
3796 int fid = TermWin.fontset->find_font (atoi (str));
3797 tt_printf ("\33]%d;%d;%-.250s%c", XTerm_findfont,
3798 fid,
3799 (options & Opt_insecure) ? (*TermWin.fontset)[fid]->name : "",
3800 resp);
3801 }
3802 break; 3838 break;
3803#endif 3839#endif
3804 3840
3805#ifdef MENUBAR 3841#ifdef MENUBAR
3806 case XTerm_Menu: 3842 case XTerm_Menu:
3935 3971
3936 /* extra handling for values with state unkept */ 3972 /* extra handling for values with state unkept */
3937 switch (arg[i]) 3973 switch (arg[i])
3938 { 3974 {
3939 case 1048: /* alternative cursor save */ 3975 case 1048: /* alternative cursor save */
3976 case 1049:
3940 if (options & Opt_secondaryScreen) 3977 if (options & Opt_secondaryScreen)
3941 if (mode == 0) 3978 if (mode == 0)
3942 scr_cursor (RESTORE); 3979 scr_cursor (RESTORE);
3943 else if (mode == 1) 3980 else if (mode == 1)
3944 scr_cursor (SAVE); 3981 scr_cursor (SAVE);
4069 rendset = 0, rendstyle = ~RS_None; 4106 rendset = 0, rendstyle = ~RS_None;
4070 break; 4107 break;
4071 case 1: 4108 case 1:
4072 rendset = 1, rendstyle = RS_Bold; 4109 rendset = 1, rendstyle = RS_Bold;
4073 break; 4110 break;
4074 //case 2: // faint or second colour 4111 //case 2: // low intensity
4075 //case 3: // italic 4112 case 3:
4113 rendset = 1, rendstyle = RS_Italic;
4114 break;
4076 case 4: 4115 case 4:
4077 rendset = 1, rendstyle = RS_Uline; 4116 rendset = 1, rendstyle = RS_Uline;
4078 break; 4117 break;
4079 case 5: // slowly blinking 4118 case 5: // slowly blinking
4080 case 6: // rapidly blinking 4119 case 6: // rapidly blinking
4092 //case 11: // scoansi acs on, first alt font 4131 //case 11: // scoansi acs on, first alt font
4093 //case 12: // scoansi acs on, |0x80, second alt font 4132 //case 12: // scoansi acs on, |0x80, second alt font
4094 //... 4133 //...
4095 //case 19: // ninth alt font 4134 //case 19: // ninth alt font
4096 //case 20: // gothic 4135 //case 20: // gothic
4097 case 21: // disable bold, faint 4136 case 21: // disable bold, faint, sometimes doubly underlined (iso 8613)
4098 rendset = 0, rendstyle = RS_Bold; 4137 rendset = 0, rendstyle = RS_Bold;
4099 break; 4138 break;
4100 case 22: 4139 case 22: // normal intensity
4101 rendset = 0, rendstyle = RS_Bold; 4140 rendset = 0, rendstyle = RS_Bold;
4102 break; 4141 break;
4103 //case 23: disable italic 4142 case 23: // disable italic
4143 rendset = 0, rendstyle = RS_Italic;
4144 break;
4104 case 24: 4145 case 24:
4105 rendset = 0, rendstyle = RS_Uline; 4146 rendset = 0, rendstyle = RS_Uline;
4106 break; 4147 break;
4107 case 25: 4148 case 25:
4108 rendset = 0, rendstyle = RS_Blink; 4149 rendset = 0, rendstyle = RS_Blink;
4109 break; 4150 break;
4110 case 26: 4151 case 26: // variable spacing (iso 8613)
4111 rendset = 0, rendstyle = RS_Blink; 4152 rendset = 0, rendstyle = RS_Blink;
4112 break; 4153 break;
4113 case 27: 4154 case 27:
4114 rendset = 0, rendstyle = RS_RVid; 4155 rendset = 0, rendstyle = RS_RVid;
4115 break; 4156 break;
4133 case 35: 4174 case 35:
4134 case 36: 4175 case 36:
4135 case 37: 4176 case 37:
4136 scr_color ((unsigned int) (minCOLOR + (arg[i] - 30)), Color_fg); 4177 scr_color ((unsigned int) (minCOLOR + (arg[i] - 30)), Color_fg);
4137 break; 4178 break;
4138#ifdef TTY_256COLOR 4179 case 38: // set fg color, ISO 8613-6
4139 case 38:
4140 if (nargs > i + 2 && arg[i + 1] == 5) 4180 if (nargs > i + 2 && arg[i + 1] == 5)
4141 { 4181 {
4142 scr_color ((unsigned int) (minCOLOR + arg[i + 2]), Color_fg); 4182 scr_color ((unsigned int) (minCOLOR + arg[i + 2]), Color_fg);
4143 i += 2; 4183 i += 2;
4144 } 4184 }
4145 break; 4185 break;
4146#endif
4147 case 39: /* default fg */ 4186 case 39: /* default fg */
4148 scr_color (Color_fg, Color_fg); 4187 scr_color (Color_fg, Color_fg);
4149 break; 4188 break;
4150 4189
4151 case 40: 4190 case 40:
4156 case 45: 4195 case 45:
4157 case 46: 4196 case 46:
4158 case 47: 4197 case 47:
4159 scr_color ((unsigned int) (minCOLOR + (arg[i] - 40)), Color_bg); 4198 scr_color ((unsigned int) (minCOLOR + (arg[i] - 40)), Color_bg);
4160 break; 4199 break;
4161#ifdef TTY_256COLOR 4200 case 48: // set bg color, ISO 8613-6
4162 case 48:
4163 if (nargs > i + 2 && arg[i + 1] == 5) 4201 if (nargs > i + 2 && arg[i + 1] == 5)
4164 { 4202 {
4165 scr_color ((unsigned int) (minCOLOR + arg[i + 2]), Color_bg); 4203 scr_color ((unsigned int) (minCOLOR + arg[i + 2]), Color_bg);
4166 i += 2; 4204 i += 2;
4167 } 4205 }
4168 break; 4206 break;
4169#endif
4170 case 49: /* default bg */ 4207 case 49: /* default bg */
4171 scr_color (Color_bg, Color_bg); 4208 scr_color (Color_bg, Color_bg);
4172 break; 4209 break;
4210
4211 //case 50: // not variable spacing
4173 4212
4174#ifndef NO_BRIGHTCOLOR 4213#ifndef NO_BRIGHTCOLOR
4175 case 90: 4214 case 90:
4176 case 91: /* set bright fg color */ 4215 case 91: /* set bright fg color */
4177 case 92: 4216 case 92:
4178 case 93: 4217 case 93:
4179 case 94: 4218 case 94:
4180 case 95: 4219 case 95:
4181 case 96: 4220 case 96:
4182 case 97: 4221 case 97:
4183 scr_color ((unsigned int) (minBrightCOLOR + (arg[i] - 90)), 4222 scr_color ((unsigned int) (minBrightCOLOR + (arg[i] - 90)), Color_fg);
4184 Color_fg);
4185 break; 4223 break;
4186 case 100: 4224 case 100:
4187 case 101: /* set bright bg color */ 4225 case 101: /* set bright bg color */
4188 case 102: 4226 case 102:
4189 case 103: 4227 case 103:
4190 case 104: 4228 case 104:
4191 case 105: 4229 case 105:
4192 case 106: 4230 case 106:
4193 case 107: 4231 case 107:
4194 scr_color ((unsigned int) (minBrightCOLOR + (arg[i] - 100)), 4232 scr_color ((unsigned int) (minBrightCOLOR + (arg[i] - 100)), Color_bg);
4195 Color_bg);
4196 break; 4233 break;
4197#endif 4234#endif
4198 4235
4199 } 4236 }
4200 } 4237 }
4242 * or generated by us in response to a query ESC sequence. 4279 * or generated by us in response to a query ESC sequence.
4243 */ 4280 */
4244void 4281void
4245rxvt_term::tt_write (const unsigned char *data, unsigned int len) 4282rxvt_term::tt_write (const unsigned char *data, unsigned int len)
4246{ 4283{
4247 enum { MAX_PTY_WRITE = 255 }; // minimum MAX_INPUT 4284 const unsigned int MAX_PTY_WRITE = 255; // minimum MAX_INPUT
4248 4285
4249 if (len) 4286 if (len)
4250 { 4287 {
4251 if (v_buflen == 0) 4288 if (v_buflen == 0)
4252 { 4289 {
4266 v_buflen += len; 4303 v_buflen += len;
4267 } 4304 }
4268 4305
4269 for (;;) 4306 for (;;)
4270 { 4307 {
4271 int written = write (pty.pty, v_buffer, min (MAX_PTY_WRITE, v_buflen)); 4308 int written = write (pty.pty, v_buffer, min (v_buflen, MAX_PTY_WRITE));
4272 4309
4273 if (written > 0) 4310 if (written > 0)
4274 { 4311 {
4275 v_buflen -= written; 4312 v_buflen -= written;
4276 4313

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines