From 8bc8ce4500413c45ee0aa41bcbc891826bf2590c Mon Sep 17 00:00:00 2001 From: root Date: Mon, 21 Feb 2005 19:26:06 +0000 Subject: [PATCH] *** empty log message *** --- Changes | 2 ++ README.configure | 2 +- doc/rxvt.7.html | 20 ++++++------ doc/rxvt.7.man.in | 22 +++++++------ doc/rxvt.7.pod | 20 ++++++------ doc/rxvt.7.txt | 20 ++++++------ src/command.C | 82 +++++++++++++++++++++-------------------------- src/rxvt.h | 20 ++++++++---- src/screen.C | 54 ++++++++++++++++++++----------- 9 files changed, 132 insertions(+), 110 deletions(-) diff --git a/Changes b/Changes index 7d950557..34a64f9a 100644 --- a/Changes +++ b/Changes @@ -15,6 +15,8 @@ WISH: just for fun, do shade and tint with XRender. - use XmbSetWMProperties instead of XSetWMProperties. - properly update WM_LOCALE. - implement _NET_WM_PING protocol. + - implemented escape sequences to move the scrollback buffer view + and clear the scrollback buffer. 5.2 Sun Feb 20 01:48:59 CET 2005 - new option -pty-fd that makes the terminal a slave diff --git a/README.configure b/README.configure index 1de9eb76..37829013 100644 --- a/README.configure +++ b/README.configure @@ -185,7 +185,7 @@ CONFIGURE OPTIONS settable extra linespacing iso-14755-2 and -3, and visual feedback backindex and forwardindex escape sequence - window op and locale change escape sequences + window op and some xterm/OSC escape sequences tripleclickwords settable insecure mode keysym remapping support diff --git a/doc/rxvt.7.html b/doc/rxvt.7.html index fd1d75ac..b21deb9b 100644 --- a/doc/rxvt.7.html +++ b/doc/rxvt.7.html @@ -1712,19 +1712,21 @@ Set XTerm Parameters. 8-bit ST: 0x9c, 7-bit ST sequence: ESC \ (0x1b, Ps = 18Change colour of bold characters to Pt Ps = 19Change colour of underlined characters to Pt Ps = 20Change default background to Pt -Ps = 39Change default foreground colour to Pt rxvt compile-time option +Ps = 39Change default foreground colour to Pt. Ps = 46Change Log File to Pt unimplemented -Ps = 49Change default background colour to Pt rxvt compile-time option +Ps = 49Change default background colour to Pt. Ps = 50Set fontset to Pt, with the following special values of Pt (rxvt) #+n change up n #-n change down n if n is missing of 0, a value of 1 is used empty change to font0 n change to font n Ps = 55Log all scrollback buffer and all of screen to Pt -Ps = 701Change current locale to Pt, or, if Pt is ?, return the current locale (rxvt extension) -Ps = 703Menubar command Pt rxvt compile-time option (rxvt-unicode extension) +Ps = 701Change current locale to Pt, or, if Pt is ?, return the current locale (Compile frills). +Ps = 703Menubar command Pt (Compile menubar). Ps = 704Change colour of italic characters to Pt -Ps = 705Change background pixmap tint colour to Pt +Ps = 705Change background pixmap tint colour to Pt (Compile transparency). Ps = 710Set normal fontset to Pt. Same as Ps = 50. -Ps = 711Set bold fontset to Pt. Similar to Ps = 50. -Ps = 712Set italic fontset to Pt. Similar to Ps = 50. -Ps = 713Set bold-italic fontset to Pt. Similar to Ps = 50. +Ps = 711Set bold fontset to Pt. Similar to Ps = 50 (Compile styles). +Ps = 712Set italic fontset to Pt. Similar to Ps = 50 (Compile styles). +Ps = 713Set bold-italic fontset to Pt. Similar to Ps = 50 (Compile styles). +Ps = 720Move viewing window up by Pt lines, or clear scrollback buffer if Pt = 0 (Compile frills). +Ps = 721Move viewing window down by Pt lines, or clear scrollback buffer if Pt = 0 (Compile frills).

@@ -2779,7 +2781,7 @@ in combination with other switches) is:

settable extra linespacing iso-14755-2 and -3, and visual feedback backindex and forwardindex escape sequence - window op and locale change escape sequences + window op and some xterm/OSC escape sequences tripleclickwords settable insecure mode keysym remapping support diff --git a/doc/rxvt.7.man.in b/doc/rxvt.7.man.in index bd72ccdb..56ec0f62 100644 --- a/doc/rxvt.7.man.in +++ b/doc/rxvt.7.man.in @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "rxvt 7" -.TH rxvt 7 "2005-02-20" "5.2" "RXVT-UNICODE" +.TH rxvt 7 "2005-02-21" "5.2" "RXVT-UNICODE" .SH "NAME" RXVT REFERENCE \- FAQ, command sequences and other background information .SH "SYNOPSIS" @@ -1615,19 +1615,21 @@ Ps = 17 Change colour of highlight characters to Pt Ps = 18 Change colour of bold characters to Pt Ps = 19 Change colour of underlined characters to Pt Ps = 20 Change default background to Pt -Ps = 39 Change default foreground colour to Pt rxvt compile-time option +Ps = 39 Change default foreground colour to Pt. Ps = 46 Change Log File to Pt unimplemented -Ps = 49 Change default background colour to Pt rxvt compile-time option +Ps = 49 Change default background colour to Pt. Ps = 50 Set fontset to Pt, with the following special values of Pt (rxvt) #+n change up n #-n change down n if n is missing of 0, a value of 1 is used empty change to font0 n change to font n Ps = 55 Log all scrollback buffer and all of screen to Pt -Ps = 701 Change current locale to Pt, or, if Pt is ?, return the current locale (@@RXVT_NAME@@ extension) -Ps = 703 Menubar command Pt rxvt compile-time option (rxvt-unicode extension) +Ps = 701 Change current locale to Pt, or, if Pt is ?, return the current locale (Compile frills). +Ps = 703 Menubar command Pt (Compile menubar). Ps = 704 Change colour of italic characters to Pt -Ps = 705 Change background pixmap tint colour to Pt +Ps = 705 Change background pixmap tint colour to Pt (Compile transparency). Ps = 710 Set normal fontset to Pt. Same as Ps = 50. -Ps = 711 Set bold fontset to Pt. Similar to Ps = 50. -Ps = 712 Set italic fontset to Pt. Similar to Ps = 50. -Ps = 713 Set bold-italic fontset to Pt. Similar to Ps = 50. +Ps = 711 Set bold fontset to Pt. Similar to Ps = 50 (Compile styles). +Ps = 712 Set italic fontset to Pt. Similar to Ps = 50 (Compile styles). +Ps = 713 Set bold-italic fontset to Pt. Similar to Ps = 50 (Compile styles). +Ps = 720 Move viewing window up by Pt lines, or clear scrollback buffer if Pt = 0 (Compile frills). +Ps = 721 Move viewing window down by Pt lines, or clear scrollback buffer if Pt = 0 (Compile frills). .TE .PP @@ -2352,7 +2354,7 @@ in combination with other switches) is: \& settable extra linespacing \& iso-14755-2 and -3, and visual feedback \& backindex and forwardindex escape sequence -\& window op and locale change escape sequences +\& window op and some xterm/OSC escape sequences \& tripleclickwords \& settable insecure mode \& keysym remapping support diff --git a/doc/rxvt.7.pod b/doc/rxvt.7.pod index c02aff7c..055c797b 100644 --- a/doc/rxvt.7.pod +++ b/doc/rxvt.7.pod @@ -1477,19 +1477,21 @@ B can be escaped by prefixing it with SYN (0x16, ^V). B<< C >> Change colour of bold characters to B<< C >> B<< C >> Change colour of underlined characters to B<< C >> B<< C >> Change default background to B<< C >> - B<< C >> Change default foreground colour to B<< C >> I + B<< C >> Change default foreground colour to B<< C >>. B<< C >> Change Log File to B<< C >> I - B<< C >> Change default background colour to B<< C >> I + B<< C >> Change default background colour to B<< C >>. B<< C >> Set fontset to B<< C >>, with the following special values of B<< C >> (B) B<< C<#+n> >> change up B<< C >> B<< C<#-n> >> change down B<< C >> if B<< C >> is missing of 0, a value of 1 is used I change to font0 B<< C >> change to font B<< C >> B<< C >> Log all scrollback buffer and all of screen to B<< C >> - B<< C >> Change current locale to B<< C >>, or, if B<< C >> is B<< C >>, return the current locale (@@RXVT_NAME@@ extension) - B<< C >> Menubar command B<< C >> I (rxvt-unicode extension) + B<< C >> Change current locale to B<< C >>, or, if B<< C >> is B<< C >>, return the current locale (Compile frills). + B<< C >> Menubar command B<< C >> (Compile menubar). B<< C >> Change colour of italic characters to B<< C >> - B<< C >> Change background pixmap tint colour to B<< C >> + B<< C >> Change background pixmap tint colour to B<< C >> (Compile transparency). B<< C >> Set normal fontset to B<< C >>. Same as C. - B<< C >> Set bold fontset to B<< C >>. Similar to C. - B<< C >> Set italic fontset to B<< C >>. Similar to C. - B<< C >> Set bold-italic fontset to B<< C >>. Similar to C. + B<< C >> Set bold fontset to B<< C >>. Similar to C (Compile styles). + B<< C >> Set italic fontset to B<< C >>. Similar to C (Compile styles). + B<< C >> Set bold-italic fontset to B<< C >>. Similar to C (Compile styles). + B<< C >> Move viewing window up by B<< C >> lines, or clear scrollback buffer if C (Compile frills). + B<< C >> Move viewing window down by B<< C >> lines, or clear scrollback buffer if C (Compile frills). =end table @@ -2376,7 +2378,7 @@ in combination with other switches) is: settable extra linespacing iso-14755-2 and -3, and visual feedback backindex and forwardindex escape sequence - window op and locale change escape sequences + window op and some xterm/OSC escape sequences tripleclickwords settable insecure mode keysym remapping support diff --git a/doc/rxvt.7.txt b/doc/rxvt.7.txt index dc4c4d0d..0e7c5106 100644 --- a/doc/rxvt.7.txt +++ b/doc/rxvt.7.txt @@ -1158,19 +1158,21 @@ XTerm Operating System Commands Ps = 18 Change colour of bold characters to Pt Ps = 19 Change colour of underlined characters to Pt Ps = 20 Change default background to Pt - Ps = 39 Change default foreground colour to Pt rxvt compile-time option + Ps = 39 Change default foreground colour to Pt. Ps = 46 Change Log File to Pt unimplemented - Ps = 49 Change default background colour to Pt rxvt compile-time option + Ps = 49 Change default background colour to Pt. Ps = 50 Set fontset to Pt, with the following special values of Pt (rxvt) #+n change up n #-n change down n if n is missing of 0, a value of 1 is used empty change to font0 n change to font n Ps = 55 Log all scrollback buffer and all of screen to Pt - Ps = 701 Change current locale to Pt, or, if Pt is ?, return the current locale (rxvt extension) - Ps = 703 Menubar command Pt rxvt compile-time option (rxvt-unicode extension) + Ps = 701 Change current locale to Pt, or, if Pt is ?, return the current locale (Compile frills). + Ps = 703 Menubar command Pt (Compile menubar). Ps = 704 Change colour of italic characters to Pt - Ps = 705 Change background pixmap tint colour to Pt + Ps = 705 Change background pixmap tint colour to Pt (Compile transparency). Ps = 710 Set normal fontset to Pt. Same as Ps = 50. - Ps = 711 Set bold fontset to Pt. Similar to Ps = 50. - Ps = 712 Set italic fontset to Pt. Similar to Ps = 50. - Ps = 713 Set bold-italic fontset to Pt. Similar to Ps = 50. + Ps = 711 Set bold fontset to Pt. Similar to Ps = 50 (Compile styles). + Ps = 712 Set italic fontset to Pt. Similar to Ps = 50 (Compile styles). + Ps = 713 Set bold-italic fontset to Pt. Similar to Ps = 50 (Compile styles). + Ps = 720 Move viewing window up by Pt lines, or clear scrollback buffer if Pt = 0 (Compile frills). + Ps = 721 Move viewing window down by Pt lines, or clear scrollback buffer if Pt = 0 (Compile frills). @@ -1830,7 +1832,7 @@ CONFIGURE OPTIONS settable extra linespacing iso-14755-2 and -3, and visual feedback backindex and forwardindex escape sequence - window op and locale change escape sequences + window op and some xterm/OSC escape sequences tripleclickwords settable insecure mode keysym remapping support diff --git a/src/command.C b/src/command.C index f9249cb5..00a2be9e 100644 --- a/src/command.C +++ b/src/command.C @@ -3668,28 +3668,6 @@ rxvt_term::process_color_seq (int report, int color, const char *str, unsigned c /* * XTerm escape sequences: ESC ] Ps;Pt (ST|BEL) - * 0 = change iconName/title - * 1 = change iconName - * 2 = change title - * 4 = change color - * 10 = change fg color - * 11 = change bg color - * 12 = change text color - * 13 = change mouse foreground color - * 17 = change highlight character colour - * 18 = change bold character color - * 19 = change underlined character color - * 46 = change logfile (not implemented) - * 50 = change font - * - * rxvt extensions: - * 20 = bg pixmap - * 39 = change default fg color - * 49 = change default bg color - * 55 = dump scrollback buffer and all of screen - * 701 = change locale - * 702 = find font - * 703 = menu */ void rxvt_term::process_xterm_seq (int op, const char *str, unsigned char resp) @@ -3798,19 +3776,19 @@ rxvt_term::process_xterm_seq (int op, const char *str, unsigned char resp) case XTerm_Color_BD: process_color_seq (XTerm_Color_BD, Color_BD, str, resp); break; - case XTerm_Color_IT: - process_color_seq (XTerm_Color_IT, Color_IT, str, resp); - break; case XTerm_Color_UL: process_color_seq (XTerm_Color_UL, Color_UL, str, resp); break; case XTerm_Color_RV: process_color_seq (XTerm_Color_RV, Color_RV, str, resp); break; + case URxvt_Color_IT: + process_color_seq (URxvt_Color_IT, Color_IT, str, resp); + break; #endif #if TRANSPARENT && TINTING - case XTerm_Color_tint: - process_color_seq (XTerm_Color_tint, Color_tint, str, resp); + case URxvt_Color_tint: + process_color_seq (URxvt_Color_tint, Color_tint, str, resp); check_our_parents (); if (am_transparent) want_full_refresh = want_refresh = 1; @@ -3854,6 +3832,24 @@ rxvt_term::process_xterm_seq (int op, const char *str, unsigned char resp) // TODO, when secure mode? break; +#ifdef MENUBAR + case URxvt_Menu: + if (options & Opt_insecure) + menubar_dispatch (const_cast(str)); // casting away constness is checked + break; +#endif +#if 0 + case XTerm_dumpscreen: /* no error notices */ + { + int fd; + if ((fd = open (str, O_RDWR | O_CREAT | O_EXCL, 0600)) >= 0) + { + scr_dump (fd); + close (fd); + } + } + break; +#endif case XTerm_font: op = URxvt_font; case URxvt_font: @@ -3878,9 +3874,9 @@ rxvt_term::process_xterm_seq (int op, const char *str, unsigned char resp) break; #if ENABLE_FRILLS - case XTerm_locale: + case URxvt_locale: if (query) - tt_printf ("\33]%d;%-.250s%c", XTerm_locale, (options & Opt_insecure) ? locale : "", resp); + tt_printf ("\33]%d;%-.250s%c", URxvt_locale, (options & Opt_insecure) ? locale : "", resp); else { set_locale (str); @@ -3888,24 +3884,18 @@ rxvt_term::process_xterm_seq (int op, const char *str, unsigned char resp) init_xlocale (); } break; -#endif -#ifdef MENUBAR - case XTerm_Menu: - if (options & Opt_insecure) - menubar_dispatch (const_cast(str)); // casting away constness is checked - break; -#endif -#if 0 - case XTerm_dumpscreen: /* no error notices */ - { - int fd; - if ((fd = open (str, O_RDWR | O_CREAT | O_EXCL, 0600)) >= 0) - { - scr_dump (fd); - close (fd); - } - } + case URxvt_view_up: + case URxvt_view_down: + int lines = atoi (str); + + if (lines) + scr_page (op == URxvt_view_up ? UP : DN, lines); + else + { + scr_erase_savelines (); + } + break; #endif } diff --git a/src/rxvt.h b/src/rxvt.h index e9e3e2d0..b8037df7 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -26,7 +26,6 @@ # define ENABLE_EWMH 1 #endif - /* ***************************************************************************** * SYSTEM HACKS @@ -475,15 +474,19 @@ enum { XTerm_restoreFG = 39, // change default fg color XTerm_restoreBG = 49, // change default bg color XTerm_dumpscreen = 55, // dump scrollback and all of screen - XTerm_locale = 701, // change locale - XTerm_Menu = 703, // set menu item - XTerm_Color_IT = 704, // change actual 'Italic' colour - XTerm_Color_tint = 705, // change actual tint colour + + URxvt_locale = 701, // change locale + URxvt_Menu = 703, // set menu item + URxvt_Color_IT = 704, // change actual 'Italic' colour + URxvt_Color_tint = 705, // change actual tint colour URxvt_font = 710, URxvt_boldFont = 711, URxvt_italicFont = 712, URxvt_boldItalicFont = 713, + + URxvt_view_up = 720, + URxvt_view_down = 721, }; /* Words starting with `Color_' are colours. Others are counts */ @@ -1473,6 +1476,11 @@ struct rxvt_term : zero_initialized, rxvt_vars { void scr_refresh (unsigned char refresh_type); bool scr_refresh_rend (rend_t mask, rend_t value); void scr_erase_screen (int mode); +#if ENABLE_FRILLS + void scr_erase_savelines (); + void scr_backindex (); + void scr_forwardindex (); +#endif void scr_touch (bool refresh); void scr_expose (int x, int y, int width, int height, bool refresh); rxvt_fontset *scr_find_fontset (rend_t r = DEFAULT_RSTYLE); @@ -1489,8 +1497,6 @@ struct rxvt_term : zero_initialized, rxvt_vars { void scr_add_lines (const unicode_t *str, int nlines, int len); void scr_backspace (); void scr_tab (int count, bool ht = false); - void scr_backindex (); - void scr_forwardindex (); void scr_gotorc (int row, int col, int relative); void scr_index (enum page_dirn direction); void scr_erase_line (int mode); diff --git a/src/screen.C b/src/screen.C index 2027e5f9..dc80a24a 100644 --- a/src/screen.C +++ b/src/screen.C @@ -204,17 +204,17 @@ rxvt_term::scr_reset () * Note: this is still needed so that all the scrollback lines are NULL */ screen.text = (text_t **)rxvt_calloc (total_rows, sizeof (text_t *)); - buf_text = (text_t **)rxvt_calloc (total_rows, sizeof (text_t *)); - drawn_text = (text_t **)rxvt_calloc (nrow, sizeof (text_t *)); - swap.text = (text_t **)rxvt_calloc (nrow, sizeof (text_t *)); + buf_text = (text_t **)rxvt_calloc (total_rows, sizeof (text_t *)); + drawn_text = (text_t **)rxvt_calloc (nrow, sizeof (text_t *)); + swap.text = (text_t **)rxvt_calloc (nrow, sizeof (text_t *)); screen.tlen = (int16_t *)rxvt_calloc (total_rows, sizeof (int16_t)); - swap.tlen = (int16_t *)rxvt_calloc (nrow, sizeof (int16_t)); + swap.tlen = (int16_t *)rxvt_calloc (nrow, sizeof (int16_t)); screen.rend = (rend_t **)rxvt_calloc (total_rows, sizeof (rend_t *)); - buf_rend = (rend_t **)rxvt_calloc (total_rows, sizeof (rend_t *)); - drawn_rend = (rend_t **)rxvt_calloc (nrow, sizeof (rend_t *)); - swap.rend = (rend_t **)rxvt_calloc (nrow, sizeof (rend_t *)); + buf_rend = (rend_t **)rxvt_calloc (total_rows, sizeof (rend_t *)); + drawn_rend = (rend_t **)rxvt_calloc (nrow, sizeof (rend_t *)); + swap.rend = (rend_t **)rxvt_calloc (nrow, sizeof (rend_t *)); for (p = 0; p < nrow; p++) { @@ -701,8 +701,8 @@ rxvt_term::scr_scroll_text (int row1, int row2, int count, int spec) else if (j >= row1 && j <= row2) { /* move selected region too */ - selection.beg.row -= count; - selection.end.row -= count; + selection.beg.row -= count; + selection.end.row -= count; selection.mark.row -= count; } } @@ -720,13 +720,13 @@ rxvt_term::scr_scroll_text (int row1, int row2, int count, int spec) if (j > 0) { - /* A: scroll up */ + /* scroll up */ - /* A1: Copy lines that will get clobbered by the rotation */ + /* Copy lines that will get clobbered by the rotation */ memcpy (buf_text, screen.text + row1, count * sizeof (text_t *)); memcpy (buf_rend, screen.rend + row1, count * sizeof (rend_t *)); - /* A2: Rotate lines */ + /* Rotate lines */ i = row2 - row1 - count + 1; memmove (screen.tlen + row1, screen.tlen + row1 + count, i * sizeof (int16_t)); memmove (screen.text + row1, screen.text + row1 + count, i * sizeof (text_t *)); @@ -736,16 +736,16 @@ rxvt_term::scr_scroll_text (int row1, int row2, int count, int spec) } else /* if (j < 0) */ { - /* B: scroll down */ + /* scroll down */ - /* B1: Copy lines that will get clobbered by the rotation */ + /* Copy lines that will get clobbered by the rotation */ for (i = 0, j = row2; i < count; i++, j--) { buf_text[i] = screen.text[j]; buf_rend[i] = screen.rend[j]; } - /* B2: Rotate lines */ + /* Rotate lines */ for (j = row2, i = j - count; i >= row1; i--, j--) { screen.tlen[j] = screen.tlen[i]; @@ -757,7 +757,7 @@ rxvt_term::scr_scroll_text (int row1, int row2, int count, int spec) count = -count; } - /* C: Resurrect lines */ + /* Resurrect lines */ memset (screen.tlen + j, 0, i * sizeof (int16_t)); memcpy (screen.text + j, buf_text, i * sizeof (text_t *)); memcpy (screen.rend + j, buf_rend, i * sizeof (text_t *)); @@ -1163,7 +1163,7 @@ rxvt_term::scr_backindex () void rxvt_term::scr_forwardindex () { - int row; + int row; if (screen.cur.col < TermWin.ncol - 1) scr_gotorc (0, 1, R_RELATIVE | C_RELATIVE); @@ -1392,6 +1392,22 @@ rxvt_term::scr_erase_screen (int mode) } } +#if ENABLE_FRILLS +void +rxvt_term::scr_erase_savelines () +{ + want_refresh = 1; + ZERO_SCROLLBACK (); + + for (int i = 0; i < TermWin.saveLines; ++i) + if (screen.text [i]) + { + screen.tlen[i] = 0; + scr_blank_line (screen.text [i], screen.rend [i], (unsigned int)TermWin.ncol, DEFAULT_RSTYLE); + } +} +#endif + /* ------------------------------------------------------------------------- */ /* * Fill the screen with `E's @@ -1400,8 +1416,8 @@ rxvt_term::scr_erase_screen (int mode) void rxvt_term::scr_E () { - int i, j, k; - rend_t *r1, fs; + int i, j, k; + rend_t *r1, fs; want_refresh = 1; ZERO_SCROLLBACK (); -- 2.34.1