… | |
… | |
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 |
… | |
… | |
1016 | /* checks whether a refresh is requested and starts the refresh timer */ |
1016 | /* checks whether a refresh is requested and starts the refresh timer */ |
1017 | void |
1017 | void |
1018 | rxvt_term::refresh_check () |
1018 | rxvt_term::refresh_check () |
1019 | { |
1019 | { |
1020 | if (want_refresh && !flush_ev.is_active ()) |
1020 | if (want_refresh && !flush_ev.is_active ()) |
1021 | flush_ev.start (1. / 60.); // refresh at max. 60 Hz normally |
1021 | flush_ev.start (); |
1022 | |
1022 | |
1023 | display->flush (); |
1023 | display->flush (); |
1024 | } |
1024 | } |
1025 | |
1025 | |
1026 | void |
1026 | void |
… | |
… | |
1281 | { |
1281 | { |
1282 | int button_number, state = 0; |
1282 | int button_number, state = 0; |
1283 | int x, y; |
1283 | int x, y; |
1284 | bool release = ev.type == ButtonRelease; |
1284 | bool release = ev.type == ButtonRelease; |
1285 | |
1285 | |
1286 | x = Pixel2Col (ev.x) + 1; |
1286 | x = 1 + clamp (Pixel2Col (ev.x), 0, ncol - 1); |
1287 | y = Pixel2Row (ev.y) + 1; |
1287 | y = 1 + clamp (Pixel2Row (ev.y), 0, nrow - 1); |
1288 | |
1288 | |
1289 | if (ev.type == MotionNotify) |
1289 | if (ev.type == MotionNotify) |
1290 | { |
1290 | { |
1291 | if (x == mouse_row && y == mouse_col) |
1291 | if (x == mouse_row && y == mouse_col) |
1292 | return; |
1292 | return; |
… | |
… | |
1295 | mouse_col = y; |
1295 | mouse_col = y; |
1296 | state += 32; |
1296 | state += 32; |
1297 | } |
1297 | } |
1298 | |
1298 | |
1299 | button_number = MEvent.button - Button1; |
1299 | button_number = MEvent.button - Button1; |
1300 | /* add 0x3D for wheel events, like xterm does */ |
1300 | if (button_number > 10) |
|
|
1301 | return; |
|
|
1302 | else if (button_number >= 7) |
|
|
1303 | button_number += 128 - 7; |
1301 | if (button_number >= 3) |
1304 | else if (button_number >= 3) |
1302 | button_number += 64 - 3; |
1305 | button_number += 64 - 3; |
1303 | |
1306 | |
1304 | if (priv_modes & PrivMode_MouseX10) |
1307 | if (priv_modes & PrivMode_MouseX10) |
1305 | { |
1308 | { |
1306 | /* |
1309 | /* |
… | |
… | |
1356 | tt_printf ("\033[%d;%d;%dM", |
1359 | tt_printf ("\033[%d;%d;%dM", |
1357 | code, |
1360 | code, |
1358 | x, |
1361 | x, |
1359 | y); |
1362 | y); |
1360 | else if (priv_modes & PrivMode_ExtMouseUTF8) |
1363 | else if (priv_modes & PrivMode_ExtMouseUTF8) |
|
|
1364 | if (code < 128) |
1361 | tt_printf ("\033[M%c%lc%lc", |
1365 | tt_printf ("\033[M%c%lc%lc", |
1362 | code, |
1366 | code, |
1363 | wint_t (32 + x), |
1367 | wint_t (32 + x), |
1364 | wint_t (32 + y)); |
1368 | wint_t (32 + y)); |
|
|
1369 | else |
|
|
1370 | tt_printf ("\033[M%c%c%lc%lc", |
|
|
1371 | 0xc0 + (code >> 6), |
|
|
1372 | 0x80 + (code & 0x3f), |
|
|
1373 | wint_t (32 + x), |
|
|
1374 | wint_t (32 + y)); |
1365 | else |
1375 | else |
1366 | #endif |
1376 | #endif |
1367 | tt_printf ("\033[M%c%c%c", |
1377 | tt_printf ("\033[M%c%c%c", |
1368 | code, |
1378 | code, |
1369 | 32 + x, |
1379 | 32 + x, |
… | |
… | |
2141 | |
2151 | |
2142 | if (reportmode) |
2152 | if (reportmode) |
2143 | { |
2153 | { |
2144 | /* mouse report from vt window */ |
2154 | /* mouse report from vt window */ |
2145 | /* don't report release of wheel "buttons" */ |
2155 | /* don't report release of wheel "buttons" */ |
2146 | if (ev.button >= 4) |
2156 | if (ev.button >= 4 && ev.button <= 7) |
2147 | return; |
2157 | return; |
2148 | #ifdef MOUSE_REPORT_DOUBLECLICK |
2158 | #ifdef MOUSE_REPORT_DOUBLECLICK |
2149 | /* only report the release of 'slow' single clicks */ |
2159 | /* only report the release of 'slow' single clicks */ |
2150 | if (MEvent.button != AnyButton |
2160 | if (MEvent.button != AnyButton |
2151 | && (ev.button != MEvent.button |
2161 | && (ev.button != MEvent.button |
… | |
… | |
3019 | case 7: /* unofficial extension */ |
3029 | case 7: /* unofficial extension */ |
3020 | if (option (Opt_insecure)) |
3030 | if (option (Opt_insecure)) |
3021 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3031 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3022 | break; |
3032 | break; |
3023 | case 8: /* unofficial extension */ |
3033 | case 8: /* unofficial extension */ |
|
|
3034 | { |
|
|
3035 | string_term st; |
|
|
3036 | st.v[0] = CHAR_ST; |
|
|
3037 | st.v[1] = '\0'; |
3024 | process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); |
3038 | process_xterm_seq (XTerm_title, (char *)RESNAME "-" VERSION, st); // char * cast verified |
3025 | break; |
3039 | break; |
|
|
3040 | } |
3026 | } |
3041 | } |
3027 | break; |
3042 | break; |
3028 | |
3043 | |
3029 | case CSI_TBC: /* 8.3.155: (0) TABULATION CLEAR */ |
3044 | case CSI_TBC: /* 8.3.155: (0) TABULATION CLEAR */ |
3030 | switch (arg[0]) |
3045 | switch (arg[0]) |
… | |
… | |
3215 | /* |
3230 | /* |
3216 | * get input up until STRING TERMINATOR (or BEL) |
3231 | * get input up until STRING TERMINATOR (or BEL) |
3217 | * ends_how is terminator used. returned input must be free()'d |
3232 | * ends_how is terminator used. returned input must be free()'d |
3218 | */ |
3233 | */ |
3219 | char * |
3234 | char * |
3220 | rxvt_term::get_to_st (unicode_t &ends_how) |
3235 | rxvt_term::get_to_st (string_term &st) |
3221 | { |
3236 | { |
3222 | unicode_t ch; |
3237 | unicode_t ch; |
3223 | bool seen_esc = false; |
3238 | bool seen_esc = false; |
3224 | unsigned int n = 0; |
3239 | unsigned int n = 0; |
3225 | wchar_t string[CBUFSIZ]; |
3240 | wchar_t string[CBUFSIZ]; |
… | |
… | |
3254 | string[n++] = ch; |
3269 | string[n++] = ch; |
3255 | } |
3270 | } |
3256 | |
3271 | |
3257 | string[n++] = '\0'; |
3272 | string[n++] = '\0'; |
3258 | |
3273 | |
3259 | ends_how = (ch == 0x5c ? C0_ESC : ch); |
3274 | n = 0; |
|
|
3275 | if (ch == 0x5c) |
|
|
3276 | st.v[n++] = C0_ESC; |
|
|
3277 | st.v[n++] = ch; |
|
|
3278 | st.v[n] = '\0'; |
3260 | |
3279 | |
3261 | return rxvt_wcstombs (string); |
3280 | return rxvt_wcstombs (string); |
3262 | } |
3281 | } |
3263 | |
3282 | |
3264 | /*----------------------------------------------------------------------*/ |
3283 | /*----------------------------------------------------------------------*/ |
… | |
… | |
3270 | { |
3289 | { |
3271 | /* |
3290 | /* |
3272 | * Not handled yet |
3291 | * Not handled yet |
3273 | */ |
3292 | */ |
3274 | |
3293 | |
3275 | unicode_t eh; |
3294 | string_term st; |
3276 | char *s = get_to_st (eh); |
3295 | char *s = get_to_st (st); |
3277 | if (s) |
3296 | if (s) |
3278 | free (s); |
3297 | free (s); |
3279 | |
3298 | |
3280 | return; |
3299 | return; |
3281 | } |
3300 | } |
… | |
… | |
3293 | for (arg = 0; isdigit (ch); ch = cmd_getc ()) |
3312 | for (arg = 0; isdigit (ch); ch = cmd_getc ()) |
3294 | arg = arg * 10 + (ch - '0'); |
3313 | arg = arg * 10 + (ch - '0'); |
3295 | |
3314 | |
3296 | if (ch == ';') |
3315 | if (ch == ';') |
3297 | { |
3316 | { |
3298 | unicode_t eh; |
3317 | string_term st; |
3299 | char *s = get_to_st (eh); |
3318 | char *s = get_to_st (st); |
3300 | |
3319 | |
3301 | if (s) |
3320 | if (s) |
3302 | { |
3321 | { |
3303 | process_xterm_seq (arg, s, eh); |
3322 | process_xterm_seq (arg, s, st); |
3304 | free (s); |
3323 | free (s); |
3305 | } |
3324 | } |
3306 | } |
3325 | } |
3307 | } |
3326 | } |
3308 | |
3327 | |
… | |
… | |
3334 | |
3353 | |
3335 | uint32_t color = (a << 24) | (r << 16) | (g << 8) | b; |
3354 | uint32_t color = (a << 24) | (r << 16) | (g << 8) | b; |
3336 | |
3355 | |
3337 | /* we allow one of the 6 closest neighbouring colours */ |
3356 | /* we allow one of the 6 closest neighbouring colours */ |
3338 | /* to replace the current color, if they not used recently */ |
3357 | /* to replace the current color, if they not used recently */ |
|
|
3358 | #if 0 |
3339 | static const signed char dxyz[][3] = { |
3359 | static const unsigned char dxyz[][3] = { |
3340 | 0, 0, 0, |
3360 | 0, 0, 0, |
3341 | 0, 0, 4, |
3361 | 0, 0, 4, |
3342 | 0, 4, 0, |
|
|
3343 | 4, 0, 0, |
|
|
3344 | 0, 4, 4, |
3362 | 0, 4, 4, |
3345 | 4, 4, 0, |
3363 | 4, 4, 0, |
3346 | 4, 0, 4, |
3364 | 4, 0, 4, |
|
|
3365 | 0, 4, 0, |
|
|
3366 | 4, 0, 0, |
3347 | }; |
3367 | }; |
|
|
3368 | #else |
|
|
3369 | // silly compressed verlapping triplets version of above |
|
|
3370 | static const unsigned char dxyz[] = { |
|
|
3371 | 0, 0, 0, 4, 4, 0, 4, 0, 0, |
|
|
3372 | }; |
|
|
3373 | #endif |
3348 | |
3374 | |
3349 | static const unsigned char color_level[8][32] = { |
3375 | static const unsigned char color_level[8][32] = { |
3350 | // neighbour index |
3376 | // 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}, |
3377 | {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}, |
3378 | {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}, |
3385 | {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 | }; |
3386 | }; |
3361 | |
3387 | |
3362 | unsigned int idx; |
3388 | unsigned int idx; |
3363 | |
3389 | |
3364 | for (int n = 0; n < ecb_array_length (dxyz); ++n) |
3390 | for (int n = 0; n < ecb_array_length (dxyz) - 2; ++n) |
3365 | { |
3391 | { |
3366 | unsigned int idx_r = color_level[ Red_levels - dxyz[n][0]][r / 8]; |
3392 | 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]; |
3393 | 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]; |
3394 | 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); |
3395 | unsigned int index = colorcube_index (idx_r, idx_g, idx_b); |
3370 | |
3396 | |
3371 | if (n == 0) |
3397 | if (n == 0) |
3372 | idx = index; |
3398 | idx = index; |
3373 | |
3399 | |
… | |
… | |
3383 | idx = index; |
3409 | idx = index; |
3384 | goto update; |
3410 | goto update; |
3385 | } |
3411 | } |
3386 | |
3412 | |
3387 | // like (rgb24_seqno[idx] > rgb24_seqno[index]) |
3413 | // like (rgb24_seqno[idx] > rgb24_seqno[index]) |
3388 | // but also handles wrap around values good enough |
3414 | // but also handles wrap around values well enough |
3389 | if ((uint16_t)(rgb24_seqno[idx] - rgb24_seqno[index]) < 0x7fff) |
3415 | if ((uint16_t)(rgb24_seqno[idx] - rgb24_seqno[index]) < 0x8000) |
3390 | idx = index; |
3416 | idx = index; |
3391 | } |
3417 | } |
3392 | |
3418 | |
3393 | update: |
3419 | update: |
3394 | rgb24_color[idx] = color; |
3420 | rgb24_color[idx] = color; |
… | |
… | |
3401 | |
3427 | |
3402 | return idx; |
3428 | return idx; |
3403 | } |
3429 | } |
3404 | |
3430 | |
3405 | void |
3431 | void |
3406 | rxvt_term::process_color_seq (int report, int color, const char *str, char resp) |
3432 | rxvt_term::process_color_seq (int report, int color, const char *str, string_term &st) |
3407 | { |
3433 | { |
3408 | if (str[0] == '?' && !str[1]) |
3434 | if (str[0] == '?' && !str[1]) |
3409 | { |
3435 | { |
3410 | if (!IN_RANGE_INC (color, minCOLOR, maxTermCOLOR)) |
|
|
3411 | return; |
|
|
3412 | |
|
|
3413 | rgba c; |
3436 | rgba c; |
3414 | pix_colors_focused[color].get (c); |
3437 | pix_colors_focused[color].get (c); |
3415 | color -= minCOLOR; |
3438 | char rgba_str[32]; |
3416 | |
3439 | |
3417 | #if XFT |
3440 | #if XFT |
3418 | if (c.a != rgba::MAX_CC) |
3441 | 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); |
3442 | snprintf (rgba_str, sizeof (rgba_str), "rgba:%04x/%04x/%04x/%04x", c.r, c.g, c.b, c.a); |
3420 | else |
3443 | else |
3421 | #endif |
3444 | #endif |
3422 | tt_printf ("\033]%d;%d;rgb:%04x/%04x/%04x%c", report, color, c.r, c.g, c.b, resp); |
3445 | snprintf (rgba_str, sizeof (rgba_str), "rgb:%04x/%04x/%04x", c.r, c.g, c.b); |
|
|
3446 | |
|
|
3447 | if (IN_RANGE_INC (color, minCOLOR, maxTermCOLOR)) |
|
|
3448 | tt_printf ("\033]%d;%d;%s%s", report, color - minCOLOR, rgba_str, st.v); |
|
|
3449 | else |
|
|
3450 | tt_printf ("\033]%d;%s%s", report, rgba_str, st.v); |
3423 | } |
3451 | } |
3424 | else |
3452 | else |
3425 | set_window_color (color, str); |
3453 | set_window_color (color, str); |
3426 | } |
3454 | } |
3427 | |
3455 | |
3428 | /* |
3456 | /* |
3429 | * XTerm escape sequences: ESC ] Ps;Pt (ST|BEL) |
3457 | * XTerm escape sequences: ESC ] Ps;Pt (ST|BEL) |
3430 | */ |
3458 | */ |
3431 | void |
3459 | void |
3432 | rxvt_term::process_xterm_seq (int op, char *str, char resp) |
3460 | rxvt_term::process_xterm_seq (int op, char *str, string_term &st) |
3433 | { |
3461 | { |
3434 | int color; |
3462 | int color; |
3435 | char *buf, *name; |
3463 | char *buf, *name; |
3436 | bool query = str[0] == '?' && !str[1]; |
3464 | bool query = str[0] == '?' && !str[1]; |
3437 | int saveop = op; |
3465 | int saveop = op; |
… | |
… | |
3472 | &nitems, &bytes_after, &value) == Success |
3500 | &nitems, &bytes_after, &value) == Success |
3473 | && actual_type != None |
3501 | && actual_type != None |
3474 | && actual_format == 8) |
3502 | && actual_format == 8) |
3475 | str = (const char *)(value); |
3503 | str = (const char *)(value); |
3476 | |
3504 | |
3477 | tt_printf ("\033]%d;%s%c", op, option (Opt_insecure) ? str : "", resp); |
3505 | tt_printf ("\033]%d;%s%s", op, option (Opt_insecure) ? str : "", st.v); |
3478 | |
3506 | |
3479 | XFree (value); |
3507 | XFree (value); |
3480 | } |
3508 | } |
3481 | else |
3509 | else |
3482 | { |
3510 | { |
… | |
… | |
3506 | break; |
3534 | break; |
3507 | |
3535 | |
3508 | if ((buf = strchr (name, ';')) != NULL) |
3536 | if ((buf = strchr (name, ';')) != NULL) |
3509 | *buf++ = '\0'; |
3537 | *buf++ = '\0'; |
3510 | |
3538 | |
3511 | process_color_seq (op, color, name, resp); |
3539 | process_color_seq (op, color, name, st); |
3512 | } |
3540 | } |
3513 | break; |
3541 | break; |
3514 | case Rxvt_restoreFG: |
3542 | case Rxvt_restoreFG: |
3515 | case XTerm_Color00: |
3543 | case XTerm_Color00: |
3516 | process_color_seq (op, Color_fg, str, resp); |
3544 | process_color_seq (op, Color_fg, str, st); |
3517 | break; |
3545 | break; |
3518 | case Rxvt_restoreBG: |
3546 | case Rxvt_restoreBG: |
3519 | case XTerm_Color01: |
3547 | case XTerm_Color01: |
3520 | process_color_seq (op, Color_bg, str, resp); |
3548 | process_color_seq (op, Color_bg, str, st); |
3521 | break; |
3549 | break; |
3522 | #ifndef NO_CURSORCOLOR |
3550 | #ifndef NO_CURSORCOLOR |
3523 | case XTerm_Color_cursor: |
3551 | case XTerm_Color_cursor: |
3524 | process_color_seq (op, Color_cursor, str, resp); |
3552 | process_color_seq (op, Color_cursor, str, st); |
3525 | break; |
3553 | break; |
3526 | #endif |
3554 | #endif |
3527 | case XTerm_Color_pointer_fg: |
3555 | case XTerm_Color_pointer_fg: |
3528 | process_color_seq (op, Color_pointer_fg, str, resp); |
3556 | process_color_seq (op, Color_pointer_fg, str, st); |
3529 | break; |
3557 | break; |
3530 | case XTerm_Color_pointer_bg: |
3558 | case XTerm_Color_pointer_bg: |
3531 | process_color_seq (op, Color_pointer_bg, str, resp); |
3559 | process_color_seq (op, Color_pointer_bg, str, st); |
3532 | break; |
3560 | break; |
3533 | #ifdef OPTION_HC |
3561 | #ifdef OPTION_HC |
3534 | case XTerm_Color_HC: |
3562 | case XTerm_Color_HC: |
3535 | process_color_seq (op, Color_HC, str, resp); |
3563 | process_color_seq (op, Color_HC, str, st); |
3536 | break; |
3564 | break; |
3537 | case XTerm_Color_HTC: |
3565 | case XTerm_Color_HTC: |
3538 | process_color_seq (op, Color_HTC, str, resp); |
3566 | process_color_seq (op, Color_HTC, str, st); |
3539 | break; |
3567 | break; |
3540 | #endif |
3568 | #endif |
3541 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
3569 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
3542 | case URxvt_Color_BD: |
3570 | case URxvt_Color_BD: |
3543 | process_color_seq (op, Color_BD, str, resp); |
3571 | process_color_seq (op, Color_BD, str, st); |
3544 | break; |
3572 | break; |
3545 | case URxvt_Color_UL: |
3573 | case URxvt_Color_UL: |
3546 | process_color_seq (op, Color_UL, str, resp); |
3574 | process_color_seq (op, Color_UL, str, st); |
3547 | break; |
3575 | break; |
3548 | case URxvt_Color_IT: |
3576 | case URxvt_Color_IT: |
3549 | process_color_seq (op, Color_IT, str, resp); |
3577 | process_color_seq (op, Color_IT, str, st); |
3550 | break; |
3578 | break; |
3551 | #endif |
3579 | #endif |
3552 | case URxvt_Color_border: |
3580 | case URxvt_Color_border: |
3553 | process_color_seq (op, Color_border, str, resp); |
3581 | process_color_seq (op, Color_border, str, st); |
3554 | break; |
3582 | break; |
3555 | |
3583 | |
3556 | case XTerm_logfile: |
3584 | case XTerm_logfile: |
3557 | // TODO, when secure mode? |
3585 | // TODO, when secure mode? |
3558 | break; |
3586 | break; |
… | |
… | |
3576 | case URxvt_boldFont: |
3604 | case URxvt_boldFont: |
3577 | case URxvt_italicFont: |
3605 | case URxvt_italicFont: |
3578 | case URxvt_boldItalicFont: |
3606 | case URxvt_boldItalicFont: |
3579 | #endif |
3607 | #endif |
3580 | if (query) |
3608 | if (query) |
3581 | tt_printf ("\33]%d;%-.250s%c", saveop, |
3609 | tt_printf ("\33]%d;%-.250s%s", saveop, |
3582 | option (Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3610 | option (Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3583 | ? fontset[op - URxvt_font]->fontdesc : "", |
3611 | ? fontset[op - URxvt_font]->fontdesc : "", |
3584 | resp); |
3612 | st.v); |
3585 | else |
3613 | else |
3586 | { |
3614 | { |
3587 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
3615 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
3588 | |
3616 | |
3589 | res = strdup (str); |
3617 | res = strdup (str); |
… | |
… | |
3592 | } |
3620 | } |
3593 | break; |
3621 | break; |
3594 | |
3622 | |
3595 | case URxvt_version: |
3623 | case URxvt_version: |
3596 | if (query) |
3624 | if (query) |
3597 | tt_printf ("\33]%d;rxvt-unicode;%-.20s;%c;%c%c", |
3625 | tt_printf ("\33]%d;rxvt-unicode;%-.20s;%c;%c%s", |
3598 | op, |
3626 | op, |
3599 | rs[Rs_name], VERSION[0], VERSION[2], |
3627 | rs[Rs_name], VERSION[0], VERSION[2], |
3600 | resp); |
3628 | st.v); |
3601 | break; |
3629 | break; |
3602 | |
3630 | |
3603 | #if !ENABLE_MINIMAL |
3631 | #if !ENABLE_MINIMAL |
|
|
3632 | case URxvt_cellinfo: |
|
|
3633 | if (query) |
|
|
3634 | tt_printf ("\33]%d;%d;%d;%d%s", saveop, |
|
|
3635 | fwidth, fheight, fbase, |
|
|
3636 | st.v); |
|
|
3637 | break; |
|
|
3638 | |
3604 | case URxvt_locale: |
3639 | case URxvt_locale: |
3605 | if (query) |
3640 | if (query) |
3606 | tt_printf ("\33]%d;%-.250s%c", op, option (Opt_insecure) ? locale : "", resp); |
3641 | tt_printf ("\33]%d;%-.250s%s", op, option (Opt_insecure) ? locale : "", st.v); |
3607 | else |
3642 | else |
3608 | { |
3643 | { |
3609 | set_locale (str); |
3644 | set_locale (str); |
3610 | pty->set_utf8_mode (enc_utf8); |
3645 | pty->set_utf8_mode (enc_utf8); |
3611 | init_xlocale (); |
3646 | init_xlocale (); |
… | |
… | |
3626 | break; |
3661 | break; |
3627 | #endif |
3662 | #endif |
3628 | |
3663 | |
3629 | #if ENABLE_PERL |
3664 | #if ENABLE_PERL |
3630 | case URxvt_perl: |
3665 | case URxvt_perl: |
3631 | HOOK_INVOKE ((this, HOOK_OSC_SEQ_PERL, DT_STR, str, DT_STR_LEN, &resp, 1, DT_END)); |
3666 | HOOK_INVOKE ((this, HOOK_OSC_SEQ_PERL, DT_STR, str, DT_STR, st.v, DT_END)); |
3632 | break; |
3667 | break; |
3633 | #endif |
3668 | #endif |
3634 | } |
3669 | } |
3635 | } |
3670 | } |
3636 | /*----------------------------------------------------------------------*/ |
3671 | /*----------------------------------------------------------------------*/ |
… | |
… | |
3731 | // 1037 send DEL for keypad delete NYI |
3766 | // 1037 send DEL for keypad delete NYI |
3732 | { 1047, PrivMode_Screen }, |
3767 | { 1047, PrivMode_Screen }, |
3733 | // 1048 save and restore cursor, implemented in code |
3768 | // 1048 save and restore cursor, implemented in code |
3734 | { 1049, PrivMode_Screen }, /* xterm extension, clear screen on ti rather than te */ |
3769 | { 1049, PrivMode_Screen }, /* xterm extension, clear screen on ti rather than te */ |
3735 | // 1051, 1052, 1060, 1061 keyboard emulation NYI |
3770 | // 1051, 1052, 1060, 1061 keyboard emulation NYI |
|
|
3771 | #if ENABLE_FRILLS |
3736 | { 2004, PrivMode_BracketPaste }, |
3772 | { 2004, PrivMode_BracketPaste }, |
|
|
3773 | #endif |
3737 | }; |
3774 | }; |
3738 | |
3775 | |
3739 | if (nargs == 0) |
3776 | if (nargs == 0) |
3740 | return; |
3777 | return; |
3741 | |
3778 | |