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.553 by sf-exg, Sat Jul 26 15:58:38 2014 UTC vs.
Revision 1.571 by sf-exg, Thu Jun 30 11:33:42 2016 UTC

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-2014 Marc Lehmann <schmorp@schmorp.de>
31 * Copyright (c) 2007 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
36 * (at your option) any later version. 36 * (at your option) any later version.
210 210
211 max_it (width, strlen (attr)); 211 max_it (width, strlen (attr));
212 212
213 if (y >= 0) 213 if (y >= 0)
214 { 214 {
215 y = (y >= nrow - len - 4 && x < width + 2) ? 0 : -1; 215 y = (y >= nrow - len - 5 && x < width + 2) ? 0 : -1;
216 x = 0; 216 x = 0;
217 } 217 }
218 218
219 scr_overlay_new (x, y, width, len * 2 + 2); 219 scr_overlay_new (x, y, width, len * 2 + 2);
220 220
676 { 676 {
677 char *ch; 677 char *ch;
678 678
679 for (ch = kbuf; ch < kbuf + len; ch++) 679 for (ch = kbuf; ch < kbuf + len; ch++)
680 *ch |= 0x80; 680 *ch |= 0x80;
681
682 meta = 0;
683 } 681 }
684#endif 682#endif
685 /* nil */ ; 683 /* nil */ ;
686 } 684 }
687 685
1036 1034
1037#ifdef CURSOR_BLINK 1035#ifdef CURSOR_BLINK
1038void 1036void
1039rxvt_term::cursor_blink_reset () 1037rxvt_term::cursor_blink_reset ()
1040{ 1038{
1039 if (!focus)
1040 return;
1041
1041 if (hidden_cursor) 1042 if (hidden_cursor)
1042 { 1043 {
1043 hidden_cursor = 0; 1044 hidden_cursor = 0;
1044 want_refresh = 1; 1045 want_refresh = 1;
1045 } 1046 }
1046 1047
1047 if (option (Opt_cursorBlink)) 1048 if (option (Opt_cursorBlink) || (priv_modes & PrivMode_BlinkingCursor))
1048 cursor_blink_ev.again (); 1049 cursor_blink_ev.again ();
1049 else 1050 else
1050 cursor_blink_ev.stop (); 1051 cursor_blink_ev.stop ();
1051} 1052}
1052 1053
1241 1242
1242void ecb_cold 1243void ecb_cold
1243rxvt_term::pointer_unblank () 1244rxvt_term::pointer_unblank ()
1244{ 1245{
1245 XDefineCursor (dpy, vt, TermWin_cursor); 1246 XDefineCursor (dpy, vt, TermWin_cursor);
1246 recolour_cursor (); 1247 recolor_cursor ();
1247 1248
1248#ifdef POINTER_BLANK 1249#ifdef POINTER_BLANK
1249 hidden_pointer = 0; 1250 hidden_pointer = 0;
1250 1251
1251 if (option (Opt_pointerBlank)) 1252 if (option (Opt_pointerBlank))
1611 case MotionNotify: 1612 case MotionNotify:
1612#ifdef POINTER_BLANK 1613#ifdef POINTER_BLANK
1613 if (hidden_pointer) 1614 if (hidden_pointer)
1614 pointer_unblank (); 1615 pointer_unblank ();
1615#endif 1616#endif
1617 if (!bypass_keystate
1616 if ((priv_modes & PrivMode_MouseBtnEvent && ev.xbutton.state & (Button1Mask|Button2Mask|Button3Mask)) 1618 && ((priv_modes & PrivMode_MouseBtnEvent && ev.xbutton.state & (Button1Mask|Button2Mask|Button3Mask))
1617 || priv_modes & PrivMode_MouseAnyEvent) 1619 || priv_modes & PrivMode_MouseAnyEvent))
1618 mouse_report (ev.xbutton); 1620 mouse_report (ev.xbutton);
1619 if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate) 1621 if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate)
1620 break; 1622 break;
1621 1623
1622 if (ev.xany.window == vt) 1624 if (ev.xany.window == vt)
1634 &unused_root_x, &unused_root_y, 1636 &unused_root_x, &unused_root_y,
1635 &ev.xbutton.x, &ev.xbutton.y, 1637 &ev.xbutton.x, &ev.xbutton.y,
1636 &ev.xbutton.state); 1638 &ev.xbutton.state);
1637#ifdef MOUSE_THRESHOLD 1639#ifdef MOUSE_THRESHOLD
1638 /* deal with a `jumpy' mouse */ 1640 /* deal with a `jumpy' mouse */
1639 if ((ev.xmotion.time - MEvent.time) > MOUSE_THRESHOLD) 1641 if (ev.xmotion.time - MEvent.time > MOUSE_THRESHOLD)
1642#endif
1640 { 1643 {
1641#endif
1642#if ISO_14755 1644#if ISO_14755
1643 // 5.4 1645 // 5.4
1644 if (iso14755buf & (ISO_14755_STARTED | ISO_14755_54)) 1646 if (iso14755buf & (ISO_14755_STARTED | ISO_14755_54))
1645 { 1647 {
1646 iso14755_54 (ev.xbutton.x, ev.xbutton.y); 1648 iso14755_54 (ev.xbutton.x, ev.xbutton.y);
1695 * shouldn't be scrolling 1697 * shouldn't be scrolling
1696 */ 1698 */
1697 sel_scroll_ev.stop(); 1699 sel_scroll_ev.stop();
1698 } 1700 }
1699#endif 1701#endif
1700#ifdef MOUSE_THRESHOLD
1701 } 1702 }
1702#endif
1703 } 1703 }
1704 } 1704 }
1705 else if (scrollBar.state == SB_STATE_MOTION && ev.xany.window == scrollBar.win) 1705 else if (scrollBar.state == SB_STATE_MOTION && ev.xany.window == scrollBar.win)
1706 { 1706 {
1707 while (XCheckTypedWindowEvent (dpy, scrollBar.win, 1707 while (XCheckTypedWindowEvent (dpy, scrollBar.win,
1781#endif 1781#endif
1782#if OFF_FOCUS_FADING 1782#if OFF_FOCUS_FADING
1783 if (rs[Rs_fade]) 1783 if (rs[Rs_fade])
1784 { 1784 {
1785 pix_colors = pix_colors_focused; 1785 pix_colors = pix_colors_focused;
1786 scr_recolour (); 1786 scr_recolor ();
1787 } 1787 }
1788#endif 1788#endif
1789#if ENABLE_FRILLS 1789#if ENABLE_FRILLS
1790 if (option (Opt_urgentOnBell)) 1790 if (option (Opt_urgentOnBell))
1791 set_urgency (0); 1791 set_urgency (0);
1792
1793 if (priv_modes & PrivMode_FocusEvent)
1794 tt_printf ("\x1b[I");
1792#endif 1795#endif
1793 1796
1794 HOOK_INVOKE ((this, HOOK_FOCUS_IN, DT_END)); 1797 HOOK_INVOKE ((this, HOOK_FOCUS_IN, DT_END));
1795 } 1798 }
1796} 1799}
1804 want_refresh = 1; 1807 want_refresh = 1;
1805 1808
1806#if ENABLE_FRILLS 1809#if ENABLE_FRILLS
1807 if (option (Opt_urgentOnBell)) 1810 if (option (Opt_urgentOnBell))
1808 set_urgency (0); 1811 set_urgency (0);
1812
1813 if (priv_modes & PrivMode_FocusEvent)
1814 tt_printf ("\x1b[O");
1809#endif 1815#endif
1810#if ENABLE_FRILLS || ISO_14755 1816#if ENABLE_FRILLS || ISO_14755
1811 if (iso14755buf) 1817 if (iso14755buf)
1812 { 1818 {
1813 iso14755buf = 0; 1819 iso14755buf = 0;
1828#endif 1834#endif
1829#if OFF_FOCUS_FADING 1835#if OFF_FOCUS_FADING
1830 if (rs[Rs_fade]) 1836 if (rs[Rs_fade])
1831 { 1837 {
1832 pix_colors = pix_colors_unfocused; 1838 pix_colors = pix_colors_unfocused;
1833 scr_recolour (); 1839 scr_recolor ();
1834 } 1840 }
1835#endif 1841#endif
1836 1842
1837 HOOK_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); 1843 HOOK_INVOKE ((this, HOOK_FOCUS_OUT, DT_END));
1838 } 1844 }
1839} 1845}
1840 1846
1841void ecb_cold 1847void ecb_cold
1842rxvt_term::update_fade_color (unsigned int idx) 1848rxvt_term::update_fade_color (unsigned int idx, bool first_time)
1843{ 1849{
1844#if OFF_FOCUS_FADING 1850#if OFF_FOCUS_FADING
1845 if (rs[Rs_fade]) 1851 if (rs[Rs_fade])
1846 { 1852 {
1853 if (!first_time)
1854 pix_colors_focused [idx].free (this);
1855
1847 rgba c; 1856 rgba c;
1848 pix_colors [Color_fade].get (c); 1857 pix_colors [Color_fade].get (c);
1849 pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); 1858 pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c);
1850 } 1859 }
1851#endif 1860#endif
1913 iso14755_54 (ev.x, ev.y); 1922 iso14755_54 (ev.x, ev.y);
1914 return; 1923 return;
1915 } 1924 }
1916#endif 1925#endif
1917 1926
1918 clickintime = ev.time - MEvent.time < MULTICLICK_TIME; 1927 clickintime = ev.time - MEvent.time < multiClickTime;
1919 1928
1920 if (reportmode) 1929 if (reportmode)
1921 { 1930 {
1922 /* mouse report from vt window */ 1931 /* mouse report from vt window */
1923 /* save the xbutton state (for ButtonRelease) */ 1932 /* save the xbutton state (for ButtonRelease) */
2173#ifdef MOUSE_REPORT_DOUBLECLICK 2182#ifdef MOUSE_REPORT_DOUBLECLICK
2174 /* only report the release of 'slow' single clicks */ 2183 /* only report the release of 'slow' single clicks */
2175 if (MEvent.button != AnyButton 2184 if (MEvent.button != AnyButton
2176 && (ev.button != MEvent.button 2185 && (ev.button != MEvent.button
2177 || (ev.time - MEvent.time 2186 || (ev.time - MEvent.time
2178 > MULTICLICK_TIME / 2))) 2187 > multiClickTime / 2)))
2179 { 2188 {
2180 MEvent.clicks = 0; 2189 MEvent.clicks = 0;
2181 MEvent.button = AnyButton; 2190 MEvent.button = AnyButton;
2182 mouse_report (ev); 2191 mouse_report (ev);
2183 } 2192 }
2573 scr_charset_choose (0); 2582 scr_charset_choose (0);
2574 break; 2583 break;
2575 2584
2576#ifdef EIGHT_BIT_CONTROLS 2585#ifdef EIGHT_BIT_CONTROLS
2577 // 8-bit controls 2586 // 8-bit controls
2578 case 0x90: /* DCS */ 2587 case 0x90: /* DCS */
2579 process_dcs_seq (); 2588 process_dcs_seq ();
2580 break; 2589 break;
2581 case 0x9b: /* CSI */ 2590 case 0x9b: /* CSI */
2582 process_csi_seq (); 2591 process_csi_seq ();
2583 break; 2592 break;
2584 case 0x9d: /* OSC */ 2593 case 0x9d: /* OSC */
2585 process_osc_seq (); 2594 process_osc_seq ();
2586 break; 2595 break;
2587#endif 2596#endif
2588 } 2597 }
2589} 2598}
3094 scr_insert_mode (1); 3103 scr_insert_mode (1);
3095 else if (arg[0] == 20) 3104 else if (arg[0] == 20)
3096 priv_modes |= PrivMode_LFNL; 3105 priv_modes |= PrivMode_LFNL;
3097 break; 3106 break;
3098 3107
3099 case CSI_71: // DESCUSR: set cursor style 3108 case CSI_71: // DECSCUSR: set cursor style
3100 if (prev_ch == ' ') 3109 if (prev_ch == ' ')
3101 set_cursor_style (arg[0]); 3110 set_cursor_style (arg[0]);
3102 break; 3111 break;
3103 3112
3104 /* 3113 /*
3325 free (s); 3334 free (s);
3326 } 3335 }
3327 } 3336 }
3328} 3337}
3329 3338
3339static unsigned int
3340colorcube_index (unsigned int idx_r,
3341 unsigned int idx_g,
3342 unsigned int idx_b)
3343{
3344 assert (idx_r < Red_levels);
3345 assert (idx_g < Green_levels);
3346 assert (idx_b < Blue_levels);
3347
3348 return idx_r * Blue_levels * Green_levels +
3349 idx_g * Blue_levels +
3350 idx_b;
3351}
3352
3353/*
3354 * Find the nearest color slot in the hidden color cube,
3355 * adapt its value to the 24bit RGB color.
3356 */
3357unsigned int
3358rxvt_term::map_rgb24_color (unsigned int r, unsigned int g, unsigned int b)
3359{
3360 r &= 0xff;
3361 g &= 0xff;
3362 b &= 0xff;
3363
3364 unsigned int color = (r << 16) | (g << 8) | b;
3365 unsigned int idx_r = r / (0xff / (Red_levels - 1));
3366 unsigned int idx_g = g / (0xff / (Green_levels - 1));
3367 unsigned int idx_b = b / (0xff / (Blue_levels - 1));
3368 unsigned int idx = colorcube_index (idx_r, idx_g, idx_b);
3369
3370 // minor issue: could update idx 0 few more times
3371 if (rgb24_seqno[idx] == 0
3372 && rgb24_color[idx] == 0)
3373 goto update;
3374
3375 if (rgb24_color[idx] == color)
3376 return idx + minTermCOLOR24;
3377
3378 for (int i = idx_r - 1; i <= (signed) idx_r + 1; i++)
3379 {
3380 if (!IN_RANGE_EXC (i, 0, Red_levels))
3381 continue;
3382
3383 for (int j = idx_g - 1; j <= (signed) idx_g + 1; j++)
3384 {
3385 if (!IN_RANGE_EXC (j, 0, Green_levels))
3386 continue;
3387
3388 for (int k = idx_b - 1; k <= (signed) idx_b + 1; k++)
3389 {
3390 if (!IN_RANGE_EXC (k, 0, Blue_levels))
3391 continue;
3392
3393 unsigned int index = colorcube_index (i, j, k);
3394
3395 // minor issue: could update index 0 few more times
3396 if (rgb24_seqno[index] == 0
3397 && rgb24_color[index] == 0)
3398 {
3399 idx = index;
3400 goto update;
3401 }
3402
3403 if (rgb24_color[index] == color)
3404 return index + minTermCOLOR24;
3405
3406 if (IN_RANGE_INC (rgb24_seqno[idx], rgb24_seqno[index], 0x7fff))
3407 idx = index;
3408 }
3409 }
3410 }
3411
3412update:
3413 rgb24_color[idx] = color;
3414 rgb24_seqno[idx] = ++rgb24_sequence;
3415
3416 idx += minTermCOLOR24;
3417 pix_colors_focused [idx].free (this);
3418 pix_colors_focused [idx].set (this, rgba (r * 0x0101,
3419 g * 0x0101,
3420 b * 0x0101));
3421 update_fade_color (idx, false);
3422
3423 return idx;
3424}
3425
3330void 3426void
3331rxvt_term::process_color_seq (int report, int color, const char *str, char resp) 3427rxvt_term::process_color_seq (int report, int color, const char *str, char resp)
3332{ 3428{
3333 if (str[0] == '?' && !str[1]) 3429 if (str[0] == '?' && !str[1])
3334 { 3430 {
3335 rgba c; 3431 rgba c;
3336 pix_colors_focused[color].get (c); 3432 pix_colors_focused[color].get (c);
3337 3433
3338#if XFT 3434#if XFT
3339 if (c.a != rgba::MAX_CC) 3435 if (c.a != rgba::MAX_CC)
3340 tt_printf ("\033]%d;rgba:%04x/%04x/%04x/%04x%c", report, c.a, c.r, c.g, c.b, resp); 3436 tt_printf ("\033]%d;rgba:%04x/%04x/%04x/%04x%c", report, c.r, c.g, c.b, c.a, resp);
3341 else 3437 else
3342#endif 3438#endif
3343 tt_printf ("\033]%d;rgb:%04x/%04x/%04x%c", report, c.r, c.g, c.b, resp); 3439 tt_printf ("\033]%d;rgb:%04x/%04x/%04x%c", report, c.r, c.g, c.b, resp);
3344 } 3440 }
3345 else 3441 else
3682 { 5, PrivMode_rVideo }, // DECSCNM 3778 { 5, PrivMode_rVideo }, // DECSCNM
3683 { 6, PrivMode_relOrigin }, // DECOM 3779 { 6, PrivMode_relOrigin }, // DECOM
3684 { 7, PrivMode_Autowrap }, // DECAWM 3780 { 7, PrivMode_Autowrap }, // DECAWM
3685 // 8, auto-repeat keys // DECARM 3781 // 8, auto-repeat keys // DECARM
3686 { 9, PrivMode_MouseX10 }, 3782 { 9, PrivMode_MouseX10 },
3783 { 12, PrivMode_BlinkingCursor },
3687 // 18 end FF to printer after print screen 3784 // 18 end FF to printer after print screen
3688 // 19 Print screen prints full screen/scroll region 3785 // 19 Print screen prints full screen/scroll region
3689 { 25, PrivMode_VisibleCursor }, // DECTCEM cnorm/cvvis/civis 3786 { 25, PrivMode_VisibleCursor }, // DECTCEM cnorm/cvvis/civis
3690#ifdef scrollBar_esc 3787#ifdef scrollBar_esc
3691 { scrollBar_esc, PrivMode_scrollBar }, 3788 { scrollBar_esc, PrivMode_scrollBar },
3703#endif 3800#endif
3704 { 1000, PrivMode_MouseX11 }, 3801 { 1000, PrivMode_MouseX11 },
3705 { 1002, PrivMode_MouseBtnEvent }, 3802 { 1002, PrivMode_MouseBtnEvent },
3706 { 1003, PrivMode_MouseAnyEvent }, 3803 { 1003, PrivMode_MouseAnyEvent },
3707#if ENABLE_FRILLS 3804#if ENABLE_FRILLS
3805 { 1004, PrivMode_FocusEvent },
3708 { 1005, PrivMode_ExtModeMouse }, 3806 { 1005, PrivMode_ExtModeMouse },
3709#endif 3807#endif
3710 { 1010, PrivMode_TtyOutputInh }, // rxvt extension 3808 { 1010, PrivMode_TtyOutputInh }, // rxvt extension
3711 { 1011, PrivMode_Keypress }, // rxvt extension 3809 { 1011, PrivMode_Keypress }, // rxvt extension
3712#if ENABLE_FRILLS 3810#if ENABLE_FRILLS
3800 scrollBar.map (state); 3898 scrollBar.map (state);
3801 resize_all_windows (0, 0, 0); 3899 resize_all_windows (0, 0, 0);
3802 scr_touch (true); 3900 scr_touch (true);
3803 break; 3901 break;
3804#endif 3902#endif
3903#ifdef CURSOR_BLINK
3904 case 12:
3905 cursor_blink_reset ();
3906 break;
3907#endif
3805 case 25: /* visible/invisible cursor */ 3908 case 25: /* visible/invisible cursor */
3806 scr_cursor_visible (state); 3909 scr_cursor_visible (state);
3807 break; 3910 break;
3808 /* case 35: - shift keys */ 3911 /* case 35: - shift keys */
3809 /* case 40: - 80 <--> 132 mode */ 3912 /* case 40: - 80 <--> 132 mode */
3914 //case 19: // ninth alt font 4017 //case 19: // ninth alt font
3915 //case 20: // gothic 4018 //case 20: // gothic
3916 case 21: // disable bold, faint, sometimes doubly underlined (iso 8613) 4019 case 21: // disable bold, faint, sometimes doubly underlined (iso 8613)
3917 rendset = 0, rendstyle = RS_Bold; 4020 rendset = 0, rendstyle = RS_Bold;
3918 break; 4021 break;
3919 case 22: // normal intensity 4022 case 22: // bold off (vt220)
3920 rendset = 0, rendstyle = RS_Bold; 4023 rendset = 0, rendstyle = RS_Bold;
3921 break; 4024 break;
3922 case 23: // disable italic 4025 case 23: // disable italic
3923 rendset = 0, rendstyle = RS_Italic; 4026 rendset = 0, rendstyle = RS_Italic;
3924 break; 4027 break;
3925 case 24: 4028 case 24: // underline off (vt220)
3926 rendset = 0, rendstyle = RS_Uline; 4029 rendset = 0, rendstyle = RS_Uline;
3927 break; 4030 break;
3928 case 25: 4031 case 25: // blink off (vt220)
3929 rendset = 0, rendstyle = RS_Blink; 4032 rendset = 0, rendstyle = RS_Blink;
3930 break; 4033 break;
3931 case 26: // variable spacing (iso 8613) 4034 case 26: // variable spacing (iso 8613)
3932 rendset = 0, rendstyle = RS_Blink; 4035 rendset = 0, rendstyle = RS_Blink;
3933 break; 4036 break;
3934 case 27: 4037 case 27: // reverse off (vt220)
3935 rendset = 0, rendstyle = RS_RVid; 4038 rendset = 0, rendstyle = RS_RVid;
3936 break; 4039 break;
3937 //case 28: // visible. NYI 4040 //case 28: // visible. NYI
3938 //case 29: // not crossed-out 4041 //case 29: // not crossed-out
3939 } 4042 }
3960 if (nargs > i + 2 && arg[i + 1] == 5) 4063 if (nargs > i + 2 && arg[i + 1] == 5)
3961 { 4064 {
3962 scr_color ((unsigned int) (minCOLOR + arg[i + 2]), Color_fg); 4065 scr_color ((unsigned int) (minCOLOR + arg[i + 2]), Color_fg);
3963 i += 2; 4066 i += 2;
3964 } 4067 }
4068 else if (nargs > i + 4 && arg[i + 1] == 2)
4069 {
4070 unsigned int r = arg[i + 2];
4071 unsigned int g = arg[i + 3];
4072 unsigned int b = arg[i + 4];
4073 unsigned int idx = map_rgb24_color (r, g, b);
4074 scr_color (idx, Color_fg);
4075 i += 4;
4076 }
3965 break; 4077 break;
3966 case 39: /* default fg */ 4078 case 39: /* default fg */
3967 scr_color (Color_fg, Color_fg); 4079 scr_color (Color_fg, Color_fg);
3968 break; 4080 break;
3969 4081
3980 case 48: // set bg color, ISO 8613-6 4092 case 48: // set bg color, ISO 8613-6
3981 if (nargs > i + 2 && arg[i + 1] == 5) 4093 if (nargs > i + 2 && arg[i + 1] == 5)
3982 { 4094 {
3983 scr_color ((unsigned int) (minCOLOR + arg[i + 2]), Color_bg); 4095 scr_color ((unsigned int) (minCOLOR + arg[i + 2]), Color_bg);
3984 i += 2; 4096 i += 2;
4097 }
4098 else if (nargs > i + 4 && arg[i + 1] == 2)
4099 {
4100 unsigned int r = arg[i + 2];
4101 unsigned int g = arg[i + 3];
4102 unsigned int b = arg[i + 4];
4103 unsigned int idx = map_rgb24_color (r, g, b);
4104 scr_color (idx, Color_bg);
4105 i += 4;
3985 } 4106 }
3986 break; 4107 break;
3987 case 49: /* default bg */ 4108 case 49: /* default bg */
3988 scr_color (Color_bg, Color_bg); 4109 scr_color (Color_bg, Color_bg);
3989 break; 4110 break;
4017} 4138}
4018 4139
4019void 4140void
4020rxvt_term::set_cursor_style (int style) 4141rxvt_term::set_cursor_style (int style)
4021{ 4142{
4022 if (!IN_RANGE_INC (style, 0, 4)) 4143 if (!IN_RANGE_INC (style, 0, 6))
4023 return; 4144 return;
4024 4145
4146 if (style == 0)
4147 style = 1;
4148
4149 cursor_type = (style - 1) / 2;
4025 set_option (Opt_cursorUnderline, style >= 3); 4150 set_option (Opt_cursorUnderline, cursor_type == 1);
4026 4151
4027#ifdef CURSOR_BLINK 4152#ifdef CURSOR_BLINK
4028 set_option (Opt_cursorBlink, !style || (style & 1)); 4153 set_option (Opt_cursorBlink, style & 1);
4029 cursor_blink_reset (); 4154 cursor_blink_reset ();
4030#endif 4155#endif
4031 4156
4032 want_refresh = 1; 4157 want_refresh = 1;
4033} 4158}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines