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.592 by root, Thu Jun 17 00:49:20 2021 UTC vs.
Revision 1.604 by sf-exg, Sat Feb 3 15:47:24 2024 UTC

25 * - extensive modifications 25 * - extensive modifications
26 * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org> 26 * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org>
27 * Copyright (c) 2001 Marius Gedminas 27 * Copyright (c) 2001 Marius Gedminas
28 * - Ctrl/Mod4+Tab works like Meta+Tab (options) 28 * - Ctrl/Mod4+Tab works like Meta+Tab (options)
29 * Copyright (c) 2003 Rob McMullen <robm@flipturn.org> 29 * Copyright (c) 2003 Rob McMullen <robm@flipturn.org>
30 * Copyright (c) 2003-2014 Marc Lehmann <schmorp@schmorp.de> 30 * Copyright (c) 2003-2021 Marc Lehmann <schmorp@schmorp.de>
31 * Copyright (c) 2007,2015 Emanuele Giaquinta <e.giaquinta@glauco.it> 31 * Copyright (c) 2007,2015 Emanuele Giaquinta <e.giaquinta@glauco.it>
32 * 32 *
33 * This program is free software; you can redistribute it and/or modify 33 * This program is free software; you can redistribute it and/or modify
34 * it under the terms of the GNU General Public License as published by 34 * it under the terms of the GNU General Public License as published by
35 * the Free Software Foundation; either version 3 of the License, or 35 * the Free Software Foundation; either version 3 of the License, or
84 XK_Right, 0x2192, 84 XK_Right, 0x2192,
85 XK_KP_Right, 0x2192, 85 XK_KP_Right, 0x2192,
86 XK_Down, 0x2193, 86 XK_Down, 0x2193,
87 XK_KP_Down, 0x2193, 87 XK_KP_Down, 0x2193,
88 XK_Linefeed, 0x21b4, 88 XK_Linefeed, 0x21b4,
89 XK_Return, 0x21b5,
90 XK_KP_Enter, 0x21b5,
91 89
92 XK_Prior, 0x21de, 90 XK_Prior, 0x21de,
93 XK_Next, 0x21df, 91 XK_Next, 0x21df,
94 XK_Tab, 0x21e5, 92 XK_Tab, 0x21e5,
95 XK_ISO_Left_Tab, 0x21e6, 93 XK_ISO_Left_Tab, 0x21e6,
110 XK_Begin, 0x2320, 108 XK_Begin, 0x2320,
111 XK_Delete, 0x2326, 109 XK_Delete, 0x2326,
112 XK_Clear, 0x2327, 110 XK_Clear, 0x2327,
113 XK_BackSpace, 0x232b, 111 XK_BackSpace, 0x232b,
114 XK_Insert, 0x2380, 112 XK_Insert, 0x2380,
113 XK_KP_Enter, 0x2386,
114 XK_Alt_L, 0x2387,
115 XK_Alt_R, 0x2387,
115 XK_Control_L, 0x2388, 116 XK_Control_L, 0x2388,
116 XK_Control_R, 0x2388, 117 XK_Control_R, 0x2388,
117 XK_Pause, 0x2389, 118 XK_Pause, 0x2389,
118 XK_Break, 0x238a, 119 XK_Break, 0x238a,
119 XK_Escape, 0x238b, 120 XK_Escape, 0x238b,
120 XK_Undo, 0x238c, 121 XK_Undo, 0x238c,
121 XK_Print, 0x2399, 122 XK_Print, 0x2399,
123 XK_Return, 0x23ce,
122 124
123 XK_space, 0x2423, 125 XK_space, 0x2423,
124 126
125#ifdef XK_KP_Begin 127#ifdef XK_KP_Begin
126 XK_KP_Prior, 0x21de, 128 XK_KP_Prior, 0x21de,
1016/* checks whether a refresh is requested and starts the refresh timer */ 1018/* checks whether a refresh is requested and starts the refresh timer */
1017void 1019void
1018rxvt_term::refresh_check () 1020rxvt_term::refresh_check ()
1019{ 1021{
1020 if (want_refresh && !flush_ev.is_active ()) 1022 if (want_refresh && !flush_ev.is_active ())
1021 flush_ev.start (1. / 60.); // refresh at max. 60 Hz normally 1023 flush_ev.start ();
1022 1024
1023 display->flush (); 1025 display->flush ();
1024} 1026}
1025 1027
1026void 1028void
1281{ 1283{
1282 int button_number, state = 0; 1284 int button_number, state = 0;
1283 int x, y; 1285 int x, y;
1284 bool release = ev.type == ButtonRelease; 1286 bool release = ev.type == ButtonRelease;
1285 1287
1286 x = Pixel2Col (ev.x) + 1; 1288 x = 1 + clamp (Pixel2Col (ev.x), 0, ncol - 1);
1287 y = Pixel2Row (ev.y) + 1; 1289 y = 1 + clamp (Pixel2Row (ev.y), 0, nrow - 1);
1288 1290
1289 if (ev.type == MotionNotify) 1291 if (ev.type == MotionNotify)
1290 { 1292 {
1291 if (x == mouse_row && y == mouse_col) 1293 if (x == mouse_row && y == mouse_col)
1292 return; 1294 return;
1294 mouse_row = x; 1296 mouse_row = x;
1295 mouse_col = y; 1297 mouse_col = y;
1296 state += 32; 1298 state += 32;
1297 } 1299 }
1298 1300
1301 if (MEvent.button == AnyButton)
1302 button_number = 3;
1303 else
1304 {
1299 button_number = MEvent.button - Button1; 1305 button_number = MEvent.button - Button1;
1300 /* add 0x3D for wheel events, like xterm does */ 1306 if (button_number > 10)
1307 return;
1308 else if (button_number >= 7)
1309 button_number += 128 - 7;
1301 if (button_number >= 3) 1310 else if (button_number >= 3)
1302 button_number += 64 - 3; 1311 button_number += 64 - 3;
1312 }
1303 1313
1304 if (priv_modes & PrivMode_MouseX10) 1314 if (priv_modes & PrivMode_MouseX10)
1305 { 1315 {
1306 /* 1316 /*
1307 * do not report ButtonRelease 1317 * do not report ButtonRelease
1356 tt_printf ("\033[%d;%d;%dM", 1366 tt_printf ("\033[%d;%d;%dM",
1357 code, 1367 code,
1358 x, 1368 x,
1359 y); 1369 y);
1360 else if (priv_modes & PrivMode_ExtMouseUTF8) 1370 else if (priv_modes & PrivMode_ExtMouseUTF8)
1371 if (code < 128)
1361 tt_printf ("\033[M%c%lc%lc", 1372 tt_printf ("\033[M%c%lc%lc",
1362 code, 1373 code,
1363 wint_t (32 + x), 1374 wint_t (32 + x),
1364 wint_t (32 + y)); 1375 wint_t (32 + y));
1376 else
1377 tt_printf ("\033[M%c%c%lc%lc",
1378 0xc0 + (code >> 6),
1379 0x80 + (code & 0x3f),
1380 wint_t (32 + x),
1381 wint_t (32 + y));
1365 else 1382 else
1366#endif 1383#endif
1367 tt_printf ("\033[M%c%c%c", 1384 tt_printf ("\033[M%c%c%c",
1368 code, 1385 code,
1369 32 + x, 1386 32 + x,
2141 2158
2142 if (reportmode) 2159 if (reportmode)
2143 { 2160 {
2144 /* mouse report from vt window */ 2161 /* mouse report from vt window */
2145 /* don't report release of wheel "buttons" */ 2162 /* don't report release of wheel "buttons" */
2146 if (ev.button >= 4) 2163 if (ev.button >= 4 && ev.button <= 7)
2147 return; 2164 return;
2148#ifdef MOUSE_REPORT_DOUBLECLICK 2165#ifdef MOUSE_REPORT_DOUBLECLICK
2149 /* only report the release of 'slow' single clicks */ 2166 /* only report the release of 'slow' single clicks */
2150 if (MEvent.button != AnyButton 2167 if (MEvent.button != AnyButton
2151 && (ev.button != MEvent.button 2168 && (ev.button != MEvent.button
2157 mouse_report (ev); 2174 mouse_report (ev);
2158 } 2175 }
2159#else /* MOUSE_REPORT_DOUBLECLICK */ 2176#else /* MOUSE_REPORT_DOUBLECLICK */
2160 MEvent.button = ev.button; 2177 MEvent.button = ev.button;
2161 mouse_report (ev); 2178 mouse_report (ev);
2179 MEvent.button = AnyButton;
2162#endif /* MOUSE_REPORT_DOUBLECLICK */ 2180#endif /* MOUSE_REPORT_DOUBLECLICK */
2163 return; 2181 return;
2164 } 2182 }
2165 2183
2166 /* 2184 /*
3019 case 7: /* unofficial extension */ 3037 case 7: /* unofficial extension */
3020 if (option (Opt_insecure)) 3038 if (option (Opt_insecure))
3021 tt_printf ("%-.250s\012", rs[Rs_display_name]); 3039 tt_printf ("%-.250s\012", rs[Rs_display_name]);
3022 break; 3040 break;
3023 case 8: /* unofficial extension */ 3041 case 8: /* unofficial extension */
3042 {
3043 string_term st;
3044 st.v[0] = CHAR_ST;
3045 st.v[1] = '\0';
3024 process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); 3046 process_xterm_seq (XTerm_title, (char *)RESNAME "-" VERSION, st); // char * cast verified
3025 break; 3047 break;
3048 }
3026 } 3049 }
3027 break; 3050 break;
3028 3051
3029 case CSI_TBC: /* 8.3.155: (0) TABULATION CLEAR */ 3052 case CSI_TBC: /* 8.3.155: (0) TABULATION CLEAR */
3030 switch (arg[0]) 3053 switch (arg[0])
3215/* 3238/*
3216 * get input up until STRING TERMINATOR (or BEL) 3239 * get input up until STRING TERMINATOR (or BEL)
3217 * ends_how is terminator used. returned input must be free()'d 3240 * ends_how is terminator used. returned input must be free()'d
3218 */ 3241 */
3219char * 3242char *
3220rxvt_term::get_to_st (unicode_t &ends_how) 3243rxvt_term::get_to_st (string_term &st)
3221{ 3244{
3222 unicode_t ch; 3245 unicode_t ch;
3223 bool seen_esc = false; 3246 bool seen_esc = false;
3224 unsigned int n = 0; 3247 unsigned int n = 0;
3225 wchar_t string[CBUFSIZ]; 3248 wchar_t string[CBUFSIZ];
3254 string[n++] = ch; 3277 string[n++] = ch;
3255 } 3278 }
3256 3279
3257 string[n++] = '\0'; 3280 string[n++] = '\0';
3258 3281
3259 ends_how = (ch == 0x5c ? C0_ESC : ch); 3282 n = 0;
3283 if (ch == 0x5c)
3284 st.v[n++] = C0_ESC;
3285 st.v[n++] = ch;
3286 st.v[n] = '\0';
3260 3287
3261 return rxvt_wcstombs (string); 3288 return rxvt_wcstombs (string);
3262} 3289}
3263 3290
3264/*----------------------------------------------------------------------*/ 3291/*----------------------------------------------------------------------*/
3270{ 3297{
3271 /* 3298 /*
3272 * Not handled yet 3299 * Not handled yet
3273 */ 3300 */
3274 3301
3275 unicode_t eh; 3302 string_term st;
3276 char *s = get_to_st (eh); 3303 char *s = get_to_st (st);
3277 if (s) 3304 if (s)
3278 free (s); 3305 free (s);
3279 3306
3280 return; 3307 return;
3281} 3308}
3293 for (arg = 0; isdigit (ch); ch = cmd_getc ()) 3320 for (arg = 0; isdigit (ch); ch = cmd_getc ())
3294 arg = arg * 10 + (ch - '0'); 3321 arg = arg * 10 + (ch - '0');
3295 3322
3296 if (ch == ';') 3323 if (ch == ';')
3297 { 3324 {
3298 unicode_t eh; 3325 string_term st;
3299 char *s = get_to_st (eh); 3326 char *s = get_to_st (st);
3300 3327
3301 if (s) 3328 if (s)
3302 { 3329 {
3303 process_xterm_seq (arg, s, eh); 3330 process_xterm_seq (arg, s, st);
3304 free (s); 3331 free (s);
3305 } 3332 }
3306 } 3333 }
3307} 3334}
3308 3335
3334 3361
3335 uint32_t color = (a << 24) | (r << 16) | (g << 8) | b; 3362 uint32_t color = (a << 24) | (r << 16) | (g << 8) | b;
3336 3363
3337 /* we allow one of the 6 closest neighbouring colours */ 3364 /* we allow one of the 6 closest neighbouring colours */
3338 /* to replace the current color, if they not used recently */ 3365 /* to replace the current color, if they not used recently */
3366 #if 0
3339 static const signed char dxyz[][3] = { 3367 static const unsigned char dxyz[][3] = {
3340 0, 0, 0, 3368 0, 0, 0,
3341 0, 0, 4, 3369 0, 0, 4,
3342 0, 4, 0,
3343 4, 0, 0,
3344 0, 4, 4, 3370 0, 4, 4,
3345 4, 4, 0, 3371 4, 4, 0,
3346 4, 0, 4, 3372 4, 0, 4,
3373 0, 4, 0,
3374 4, 0, 0,
3347 }; 3375 };
3376 #else
3377 // silly compressed verlapping triplets version of above
3378 static const unsigned char dxyz[] = {
3379 0, 0, 0, 4, 4, 0, 4, 0, 0,
3380 };
3381 #endif
3348 3382
3349 static const unsigned char color_level[8][32] = { 3383 static const unsigned char color_level[8][32] = {
3350 // neighbour index 3384 // neighbour index
3351 {0, 0, 1, 0, 0, 1, 1, 2, 2, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3}, 3385 {0, 0, 1, 0, 0, 1, 1, 2, 2, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3},
3352 {0, 1, 0, 1, 1, 2, 1, 1, 2, 2, 3, 3, 2, 2, 2, 3, 3, 3, 4, 4, 4, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4}, 3386 {0, 1, 0, 1, 1, 2, 1, 1, 2, 2, 3, 3, 2, 2, 2, 3, 3, 3, 4, 4, 4, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4},
3359 {0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6}, 3393 {0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6},
3360 }; 3394 };
3361 3395
3362 unsigned int idx; 3396 unsigned int idx;
3363 3397
3364 for (int n = 0; n < ecb_array_length (dxyz); ++n) 3398 for (int n = 0; n < ecb_array_length (dxyz) - 2; ++n)
3365 { 3399 {
3366 unsigned int idx_r = color_level[ Red_levels - dxyz[n][0]][r / 8]; 3400 unsigned int idx_r = color_level[ Red_levels - dxyz[n + 0]][r / 8];
3367 unsigned int idx_g = color_level[Green_levels - dxyz[n][1]][g / 8]; 3401 unsigned int idx_g = color_level[Green_levels - dxyz[n + 1]][g / 8];
3368 unsigned int idx_b = color_level[ Blue_levels - dxyz[n][2]][b / 8]; 3402 unsigned int idx_b = color_level[ Blue_levels - dxyz[n + 2]][b / 8];
3369 unsigned int index = colorcube_index (idx_r, idx_g, idx_b); 3403 unsigned int index = colorcube_index (idx_r, idx_g, idx_b);
3370 3404
3371 if (n == 0) 3405 if (n == 0)
3372 idx = index; 3406 idx = index;
3373 3407
3383 idx = index; 3417 idx = index;
3384 goto update; 3418 goto update;
3385 } 3419 }
3386 3420
3387 // like (rgb24_seqno[idx] > rgb24_seqno[index]) 3421 // like (rgb24_seqno[idx] > rgb24_seqno[index])
3388 // but also handles wrap around values good enough 3422 // but also handles wrap around values well enough
3389 if ((uint16_t)(rgb24_seqno[idx] - rgb24_seqno[index]) < 0x7fff) 3423 if ((uint16_t)(rgb24_seqno[idx] - rgb24_seqno[index]) < 0x8000)
3390 idx = index; 3424 idx = index;
3391 } 3425 }
3392 3426
3393update: 3427update:
3394 rgb24_color[idx] = color; 3428 rgb24_color[idx] = color;
3401 3435
3402 return idx; 3436 return idx;
3403} 3437}
3404 3438
3405void 3439void
3406rxvt_term::process_color_seq (int report, int color, const char *str, char resp) 3440rxvt_term::process_color_seq (int report, int color, const char *str, string_term &st)
3407{ 3441{
3408 if (str[0] == '?' && !str[1]) 3442 if (str[0] == '?' && !str[1])
3409 { 3443 {
3410 if (!IN_RANGE_INC (color, minCOLOR, maxTermCOLOR))
3411 return;
3412
3413 rgba c; 3444 rgba c;
3414 pix_colors_focused[color].get (c); 3445 pix_colors_focused[color].get (c);
3415 color -= minCOLOR; 3446 char rgba_str[32];
3416 3447
3417#if XFT 3448#if XFT
3418 if (c.a != rgba::MAX_CC) 3449 if (c.a != rgba::MAX_CC)
3419 tt_printf ("\033]%d;%d;rgba:%04x/%04x/%04x/%04x%c", report, color, c.r, c.g, c.b, c.a, resp); 3450 snprintf (rgba_str, sizeof (rgba_str), "rgba:%04x/%04x/%04x/%04x", c.r, c.g, c.b, c.a);
3420 else 3451 else
3421#endif 3452#endif
3422 tt_printf ("\033]%d;%d;rgb:%04x/%04x/%04x%c", report, color, c.r, c.g, c.b, resp); 3453 snprintf (rgba_str, sizeof (rgba_str), "rgb:%04x/%04x/%04x", c.r, c.g, c.b);
3454
3455 if (IN_RANGE_INC (color, minCOLOR, maxTermCOLOR))
3456 tt_printf ("\033]%d;%d;%s%s", report, color - minCOLOR, rgba_str, st.v);
3457 else
3458 tt_printf ("\033]%d;%s%s", report, rgba_str, st.v);
3423 } 3459 }
3424 else 3460 else
3425 set_window_color (color, str); 3461 set_window_color (color, str);
3426} 3462}
3427 3463
3428/* 3464/*
3429 * XTerm escape sequences: ESC ] Ps;Pt (ST|BEL) 3465 * XTerm escape sequences: ESC ] Ps;Pt (ST|BEL)
3430 */ 3466 */
3431void 3467void
3432rxvt_term::process_xterm_seq (int op, char *str, char resp) 3468rxvt_term::process_xterm_seq (int op, char *str, string_term &st)
3433{ 3469{
3434 int color; 3470 int color;
3435 char *buf, *name; 3471 char *buf, *name;
3436 bool query = str[0] == '?' && !str[1]; 3472 bool query = str[0] == '?' && !str[1];
3437 int saveop = op; 3473 int saveop = op;
3472 &nitems, &bytes_after, &value) == Success 3508 &nitems, &bytes_after, &value) == Success
3473 && actual_type != None 3509 && actual_type != None
3474 && actual_format == 8) 3510 && actual_format == 8)
3475 str = (const char *)(value); 3511 str = (const char *)(value);
3476 3512
3477 tt_printf ("\033]%d;%s%c", op, option (Opt_insecure) ? str : "", resp); 3513 tt_printf ("\033]%d;%s%s", op, option (Opt_insecure) ? str : "", st.v);
3478 3514
3479 XFree (value); 3515 XFree (value);
3480 } 3516 }
3481 else 3517 else
3482 { 3518 {
3506 break; 3542 break;
3507 3543
3508 if ((buf = strchr (name, ';')) != NULL) 3544 if ((buf = strchr (name, ';')) != NULL)
3509 *buf++ = '\0'; 3545 *buf++ = '\0';
3510 3546
3511 process_color_seq (op, color, name, resp); 3547 process_color_seq (op, color, name, st);
3512 } 3548 }
3513 break; 3549 break;
3514 case Rxvt_restoreFG: 3550 case Rxvt_restoreFG:
3515 case XTerm_Color00: 3551 case XTerm_Color00:
3516 process_color_seq (op, Color_fg, str, resp); 3552 process_color_seq (op, Color_fg, str, st);
3517 break; 3553 break;
3518 case Rxvt_restoreBG: 3554 case Rxvt_restoreBG:
3519 case XTerm_Color01: 3555 case XTerm_Color01:
3520 process_color_seq (op, Color_bg, str, resp); 3556 process_color_seq (op, Color_bg, str, st);
3521 break; 3557 break;
3522#ifndef NO_CURSORCOLOR 3558#ifndef NO_CURSORCOLOR
3523 case XTerm_Color_cursor: 3559 case XTerm_Color_cursor:
3524 process_color_seq (op, Color_cursor, str, resp); 3560 process_color_seq (op, Color_cursor, str, st);
3525 break; 3561 break;
3526#endif 3562#endif
3527 case XTerm_Color_pointer_fg: 3563 case XTerm_Color_pointer_fg:
3528 process_color_seq (op, Color_pointer_fg, str, resp); 3564 process_color_seq (op, Color_pointer_fg, str, st);
3529 break; 3565 break;
3530 case XTerm_Color_pointer_bg: 3566 case XTerm_Color_pointer_bg:
3531 process_color_seq (op, Color_pointer_bg, str, resp); 3567 process_color_seq (op, Color_pointer_bg, str, st);
3532 break; 3568 break;
3533#ifdef OPTION_HC 3569#ifdef OPTION_HC
3534 case XTerm_Color_HC: 3570 case XTerm_Color_HC:
3535 process_color_seq (op, Color_HC, str, resp); 3571 process_color_seq (op, Color_HC, str, st);
3536 break; 3572 break;
3537 case XTerm_Color_HTC: 3573 case XTerm_Color_HTC:
3538 process_color_seq (op, Color_HTC, str, resp); 3574 process_color_seq (op, Color_HTC, str, st);
3539 break; 3575 break;
3540#endif 3576#endif
3541#ifndef NO_BOLD_UNDERLINE_REVERSE 3577#ifndef NO_BOLD_UNDERLINE_REVERSE
3542 case URxvt_Color_BD: 3578 case URxvt_Color_BD:
3543 process_color_seq (op, Color_BD, str, resp); 3579 process_color_seq (op, Color_BD, str, st);
3544 break; 3580 break;
3545 case URxvt_Color_UL: 3581 case URxvt_Color_UL:
3546 process_color_seq (op, Color_UL, str, resp); 3582 process_color_seq (op, Color_UL, str, st);
3547 break; 3583 break;
3548 case URxvt_Color_IT: 3584 case URxvt_Color_IT:
3549 process_color_seq (op, Color_IT, str, resp); 3585 process_color_seq (op, Color_IT, str, st);
3550 break; 3586 break;
3551#endif 3587#endif
3552 case URxvt_Color_border: 3588 case URxvt_Color_border:
3553 process_color_seq (op, Color_border, str, resp); 3589 process_color_seq (op, Color_border, str, st);
3554 break; 3590 break;
3555 3591
3556 case XTerm_logfile: 3592 case XTerm_logfile:
3557 // TODO, when secure mode? 3593 // TODO, when secure mode?
3558 break; 3594 break;
3576 case URxvt_boldFont: 3612 case URxvt_boldFont:
3577 case URxvt_italicFont: 3613 case URxvt_italicFont:
3578 case URxvt_boldItalicFont: 3614 case URxvt_boldItalicFont:
3579#endif 3615#endif
3580 if (query) 3616 if (query)
3581 tt_printf ("\33]%d;%-.250s%c", saveop, 3617 tt_printf ("\33]%d;%-.250s%s", saveop,
3582 option (Opt_insecure) && fontset[op - URxvt_font]->fontdesc 3618 option (Opt_insecure) && fontset[op - URxvt_font]->fontdesc
3583 ? fontset[op - URxvt_font]->fontdesc : "", 3619 ? fontset[op - URxvt_font]->fontdesc : "",
3584 resp); 3620 st.v);
3585 else 3621 else
3586 { 3622 {
3587 const char *&res = rs[Rs_font + (op - URxvt_font)]; 3623 const char *&res = rs[Rs_font + (op - URxvt_font)];
3588 3624
3589 res = strdup (str); 3625 res = strdup (str);
3592 } 3628 }
3593 break; 3629 break;
3594 3630
3595 case URxvt_version: 3631 case URxvt_version:
3596 if (query) 3632 if (query)
3597 tt_printf ("\33]%d;rxvt-unicode;%-.20s;%c;%c%c", 3633 tt_printf ("\33]%d;rxvt-unicode;%-.20s;%c;%c%s",
3598 op, 3634 op,
3599 rs[Rs_name], VERSION[0], VERSION[2], 3635 rs[Rs_name], VERSION[0], VERSION[2],
3600 resp); 3636 st.v);
3601 break; 3637 break;
3602 3638
3603#if !ENABLE_MINIMAL 3639#if !ENABLE_MINIMAL
3640 case URxvt_cellinfo:
3641 if (query)
3642 tt_printf ("\33]%d;%d;%d;%d%s", saveop,
3643 fwidth, fheight, fbase,
3644 st.v);
3645 break;
3646
3604 case URxvt_locale: 3647 case URxvt_locale:
3605 if (query) 3648 if (query)
3606 tt_printf ("\33]%d;%-.250s%c", op, option (Opt_insecure) ? locale : "", resp); 3649 tt_printf ("\33]%d;%-.250s%s", op, option (Opt_insecure) ? locale : "", st.v);
3607 else 3650 else
3608 { 3651 {
3609 set_locale (str); 3652 set_locale (str);
3610 pty->set_utf8_mode (enc_utf8); 3653 pty->set_utf8_mode (enc_utf8);
3611 init_xlocale (); 3654 init_xlocale ();
3626 break; 3669 break;
3627#endif 3670#endif
3628 3671
3629#if ENABLE_PERL 3672#if ENABLE_PERL
3630 case URxvt_perl: 3673 case URxvt_perl:
3631 HOOK_INVOKE ((this, HOOK_OSC_SEQ_PERL, DT_STR, str, DT_STR_LEN, &resp, 1, DT_END)); 3674 HOOK_INVOKE ((this, HOOK_OSC_SEQ_PERL, DT_STR, str, DT_STR, st.v, DT_END));
3632 break; 3675 break;
3633#endif 3676#endif
3634 } 3677 }
3635} 3678}
3636/*----------------------------------------------------------------------*/ 3679/*----------------------------------------------------------------------*/
3731 // 1037 send DEL for keypad delete NYI 3774 // 1037 send DEL for keypad delete NYI
3732 { 1047, PrivMode_Screen }, 3775 { 1047, PrivMode_Screen },
3733 // 1048 save and restore cursor, implemented in code 3776 // 1048 save and restore cursor, implemented in code
3734 { 1049, PrivMode_Screen }, /* xterm extension, clear screen on ti rather than te */ 3777 { 1049, PrivMode_Screen }, /* xterm extension, clear screen on ti rather than te */
3735 // 1051, 1052, 1060, 1061 keyboard emulation NYI 3778 // 1051, 1052, 1060, 1061 keyboard emulation NYI
3779#if ENABLE_FRILLS
3736 { 2004, PrivMode_BracketPaste }, 3780 { 2004, PrivMode_BracketPaste },
3781#endif
3737 }; 3782 };
3738 3783
3739 if (nargs == 0) 3784 if (nargs == 0)
3740 return; 3785 return;
3741 3786

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines