--- rxvt-unicode/src/command.C 2012/12/31 12:05:34 1.532 +++ rxvt-unicode/src/command.C 2013/04/11 08:13:43 1.538 @@ -512,12 +512,12 @@ if (keysym == XK_Prior) { - scr_page (UP, lnsppg); + scr_page (lnsppg); return; } else if (keysym == XK_Next) { - scr_page (DN, lnsppg); + scr_page (-lnsppg); return; } } @@ -526,12 +526,12 @@ { if (keysym == XK_Up) { - scr_page (UP, 1); + scr_page (1); return; } else if (keysym == XK_Down) { - scr_page (DN, 1); + scr_page (-1); return; } } @@ -541,12 +541,12 @@ { if (keysym == XK_Home) { - scr_move_to (0, 1); + scr_changeview (top_row); return; } else if (keysym == XK_End) { - scr_move_to (1, 1); + scr_changeview (0); return; } } @@ -1862,9 +1862,7 @@ update_background (); } #endif -#if ENABLE_PERL HOOK_INVOKE ((this, HOOK_ROOTPMAP_CHANGE, DT_END)); -#endif } break; @@ -2199,22 +2197,22 @@ case Button4: case Button5: { - int i; - page_dirn v; + int lines; + page_dirn dirn; - v = ev.button == Button4 ? UP : DN; + dirn = ev.button == Button4 ? UP : DN; if (ev.state & ShiftMask) - i = 1; + lines = 1; else if (option (Opt_mouseWheelScrollPage)) - i = nrow - 1; + lines = nrow - 1; else - i = 5; + lines = 5; # ifdef MOUSE_SLIP_WHEELING if (ev.state & ControlMask) { - mouse_slip_wheel_speed += v ? -1 : 1; + mouse_slip_wheel_speed += dirn; if (mouse_slip_wheel_speed < -nrow) mouse_slip_wheel_speed = -nrow; if (mouse_slip_wheel_speed > +nrow) mouse_slip_wheel_speed = +nrow; @@ -2224,7 +2222,7 @@ else # endif { - scr_page (v, i); + scr_page (dirn, lines); scrollBar.show (1); } } @@ -2803,7 +2801,7 @@ void ecb_hot rxvt_term::process_csi_seq () { - unicode_t ch, priv, i; + unicode_t ch, priv, prev_ch, i; unsigned int nargs, p; int n, ndef; int arg[ESC_ARGS] = { }; @@ -2819,6 +2817,7 @@ ch = cmd_getc (); } + prev_ch = 0; /* read any numerical arguments */ for (n = -1; ch < CSI_ICH; ) { @@ -2838,6 +2837,7 @@ else if (IS_CONTROL (ch)) process_nonprinting (ch); + prev_ch = ch; ch = cmd_getc (); } @@ -3081,6 +3081,11 @@ priv_modes |= PrivMode_LFNL; break; + case CSI_71: // DESCUSR: set cursor style + if (prev_ch == ' ') + set_cursor_style (arg[0]); + break; + /* * PRIVATE USE beyond this point. All CSI_7? sequences here */ @@ -3995,6 +4000,22 @@ } } } + +void +rxvt_term::set_cursor_style (int style) +{ + if (!IN_RANGE_INC (style, 0, 4)) + return; + + set_option (Opt_cursorUnderline, style >= 3); + +#ifdef CURSOR_BLINK + set_option (Opt_cursorBlink, !style || (style & 1)); + cursor_blink_reset (); +#endif + + want_refresh = 1; +} /*}}} */ /* ------------------------------------------------------------------------- */