*** empty log message ***
authorroot <root>
Sun, 22 Jan 2006 20:39:47 +0000 (20:39 +0000)
committerroot <root>
Sun, 22 Jan 2006 20:39:47 +0000 (20:39 +0000)
14 files changed:
Changes
configure
configure.ac
doc/rxvtperl.3.html
doc/rxvtperl.3.man.in
doc/rxvtperl.3.txt
src/Makefile.in
src/main.C
src/perl/readline
src/rxvt.h
src/rxvtperl.xs
src/screen.C
src/urxvt.pm
src/version.h

diff --git a/Changes b/Changes
index 5481bbf..86b9853 100644 (file)
--- a/Changes
+++ b/Changes
@@ -17,14 +17,15 @@ WISH: OnTheSpot editing, or maybe switch to miiiiiiif. or maybe use perl and an
 WISH: just for fun, do shade and tint with XRender.
 DUMB: support tex fonts
 
-7.2
-TODO: alsamixer/wild resize => secondary leaks into primary scrollback?
+7.2  Sun Jan 22 21:39:33 CET 2006
         - bugfix: urxvt (not urxvtd) did not correctly handle multiple
           environments necessary, which resulted in segfaults within
           getenv (reproducable: urxvt -fn 9x15, open a menu once,
           ctrl-shift-672c).
         - bugfix: the selection speedup in in 7.1 unfortunately caused
           non-ascii characters to enlarge/move the selection.
+        - bugfix: resizing sometimes leaked lines from the secondary to
+          the primary screen.
         - added "tabbed" extension that provides a crude tabbed terminal.
         - added "readline" extension that allows cursor positioning
           via mouse clicks.
index 294292e..e6f8997 100755 (executable)
--- a/configure
+++ b/configure
@@ -3303,7 +3303,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 if test -z "$orig_CXXFLAGS"; then
   if test x$GCC = xyes && test "x$GXX" = xyes; then
-    CXXFLAGS="-g -O3 -fno-threadsafe-statics -fno-enforce-eh-specs"
+     CXXFLAGS="-g -O3 -fno-threadsafe-statics -fno-enforce-eh-specs"
     cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
index bfce445..32995fd 100644 (file)
@@ -65,7 +65,7 @@ dnl# Supply default CXXFLAGS, if not specified by `CXXFLAGS=flags ./configure'
 dnl#
 if test -z "$orig_CXXFLAGS"; then
   if test x$GCC = xyes && test "x$GXX" = xyes; then
-    CXXFLAGS="-g -O3 -fno-threadsafe-statics -fno-enforce-eh-specs"
+     CXXFLAGS="-g -O3 -fno-threadsafe-statics -fno-enforce-eh-specs"
     AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [], [CXXFLAGS="-g -O3"])
   else
     CXXFLAGS="-O"
index 250b8c6..28e77b4 100644 (file)
@@ -210,11 +210,13 @@ for programs that correctly support wide characters).
 <p>To avoid too many false positives, this is only done when:</p>
 </dd>
 <dl>
-<dt><strong><a name="item_same">- the mouse is on the same (multi-row-) line as the text cursor.</a></strong><br />
+<dt><strong><a name="item__2d_the_tty_is_in_icanon_state_2e">- the tty is in ICANON state.</a></strong><br />
+</dt>
+<dt><strong><a name="item__2d_the_text_cursor_is_visible_2e">- the text cursor is visible.</a></strong><br />
 </dt>
 <dt><strong><a name="item__2d_the_primary_screen_is_currently_being_displaye">- the primary screen is currently being displayed.</a></strong><br />
 </dt>
-<dt><strong><a name="item__2d_the_text_cursor_is_visible_2e">- the text cursor is visible.</a></strong><br />
+<dt><strong><a name="item_same">- the mouse is on the same (multi-row-) line as the text cursor.</a></strong><br />
 </dt>
 </dl>
 <p>The normal selection mechanism isn't disabled, so quick successive clicks
@@ -1199,6 +1201,13 @@ description of <a href="#item_events"><code>urxvt::timer-&gt;events</code></a>.
 the previous value.
 </dd>
 <p></p>
+<dt><strong><a name="item_pty_fd">$fd = $term-&gt;pty_fd</a></strong><br />
+</dt>
+<dd>
+Returns the master file descriptor for the pty in use, or <code>-1</code> if no pty
+is used.
+</dd>
+<p></p>
 <dt><strong><a name="item_parent">$windowid = $term-&gt;parent</a></strong><br />
 </dt>
 <dd>
@@ -1327,8 +1336,8 @@ to replace only parts of a line. The font index in the rendition will
 automatically be updated.</p>
 </dd>
 <dd>
-<p><a href="#item__24text"><code>$text</code></a> is in a special encoding: tabs and wide characters that use
-more than one cell when displayed are padded with <code>$urxvt::NOCHAR</code>
+<p><a href="#item__24text"><code>$text</code></a> is in a special encoding: tabs and wide characters that use more
+than one cell when displayed are padded with <code>$urxvt::NOCHAR</code> (chr 65535)
 characters. Characters with combining characters and other characters that
 do not fit into the normal tetx encoding will be replaced with characters
 in the private use area.</p>
index 8c7777c..dfbff3f 100644 (file)
 .\" ========================================================================
 .\"
 .IX Title "rxvt 3"
-.TH rxvt 3 "2006-01-21" "7.2" "RXVT-UNICODE"
+.TH rxvt 3 "2006-01-22" "7.2" "RXVT-UNICODE"
 .SH "NAME"
 @@RXVT_NAME@@perl \- rxvt\-unicode's embedded perl interpreter
 .SH "SYNOPSIS"
@@ -277,13 +277,15 @@ for programs that correctly support wide characters).
 .Sp
 To avoid too many false positives, this is only done when:
 .RS 4
-.IP "\- the mouse is on the same (multi\-row\-) line as the text cursor." 4
-.IX Item "- the mouse is on the same (multi-row-) line as the text cursor."
+.IP "\- the tty is in \s-1ICANON\s0 state." 4
+.IX Item "- the tty is in ICANON state."
 .PD 0
-.IP "\- the primary screen is currently being displayed." 4
-.IX Item "- the primary screen is currently being displayed."
 .IP "\- the text cursor is visible." 4
 .IX Item "- the text cursor is visible."
+.IP "\- the primary screen is currently being displayed." 4
+.IX Item "- the primary screen is currently being displayed."
+.IP "\- the mouse is on the same (multi\-row\-) line as the text cursor." 4
+.IX Item "- the mouse is on the same (multi-row-) line as the text cursor."
 .RE
 .RS 4
 .PD
@@ -1047,6 +1049,11 @@ Replaces the event mask of the pty watcher by the given event mask. Can
 be used to suppress input and output handling to the pty/tty. See the
 description of \f(CW\*(C`urxvt::timer\->events\*(C'\fR. Make sure to always restore
 the previous value.
+.ie n .IP "$fd = $term\->pty_fd" 4
+.el .IP "$fd = \f(CW$term\fR\->pty_fd" 4
+.IX Item "$fd = $term->pty_fd"
+Returns the master file descriptor for the pty in use, or \f(CW\*(C`\-1\*(C'\fR if no pty
+is used.
 .ie n .IP "$windowid = $term\->parent" 4
 .el .IP "$windowid = \f(CW$term\fR\->parent" 4
 .IX Item "$windowid = $term->parent"
@@ -1163,8 +1170,8 @@ line, starting at column \f(CW$start_col\fR (default \f(CW0\fR), which is useful
 to replace only parts of a line. The font index in the rendition will
 automatically be updated.
 .Sp
-\&\f(CW$text\fR is in a special encoding: tabs and wide characters that use
-more than one cell when displayed are padded with \f(CW$urxvt::NOCHAR\fR
+\&\f(CW$text\fR is in a special encoding: tabs and wide characters that use more
+than one cell when displayed are padded with \f(CW$urxvt::NOCHAR\fR (chr 65535)
 characters. Characters with combining characters and other characters that
 do not fit into the normal tetx encoding will be replaced with characters
 in the private use area.
index 240dc29..6cb0a57 100644 (file)
@@ -124,9 +124,10 @@ PREPACKAGED EXTENSIONS
 
         To avoid too many false positives, this is only done when:
 
-        - the mouse is on the same (multi-row-) line as the text cursor.
-        - the primary screen is currently being displayed.
+        - the tty is in ICANON state.
         - the text cursor is visible.
+        - the primary screen is currently being displayed.
+        - the mouse is on the same (multi-row-) line as the text cursor.
 
         The normal selection mechanism isn't disabled, so quick successive
         clicks might interfere with selection creation in harmless ways.
@@ -799,6 +800,10 @@ API DOCUMENTATION
         See the description of "urxvt::timer->events". Make sure to always
         restore the previous value.
 
+    $fd = $term->pty_fd
+        Returns the master file descriptor for the pty in use, or -1 if no
+        pty is used.
+
     $windowid = $term->parent
         Return the window id of the toplevel window.
 
@@ -874,9 +879,9 @@ API DOCUMENTATION
 
         $text is in a special encoding: tabs and wide characters that use
         more than one cell when displayed are padded with $urxvt::NOCHAR
-        characters. Characters with combining characters and other
-        characters that do not fit into the normal tetx encoding will be
-        replaced with characters in the private use area.
+        (chr 65535) characters. Characters with combining characters and
+        other characters that do not fit into the normal tetx encoding will
+        be replaced with characters in the private use area.
 
         You have to obey this encoding when changing text. The advantage is
         that "substr" and similar functions work on screen cells and not on
index 5a621e4..cff88d2 100644 (file)
@@ -182,8 +182,9 @@ keyboard.o: ../config.h rxvt.h rxvtlib.h optinc.h feature.h encoding.h
 keyboard.o: rxvtfont.h rxvtutil.h rxvttoolkit.h iom.h iom_conf.h callback.h
 keyboard.o: salloc.h libptytty.h rxvtperl.h hookinc.h rsinc.h keyboard.h
 keyboard.o: command.h
-logging.o: ../config.h ptytty.h libptytty.h ptytty_conf.h rxvtutil.h
-logging.o: feature.h
+logging.o: ../config.h ptytty.h libptytty.h ptytty_conf.h rxvt.h rxvtlib.h
+logging.o: optinc.h feature.h encoding.h rxvtfont.h rxvtutil.h rxvttoolkit.h
+logging.o: iom.h iom_conf.h callback.h salloc.h rxvtperl.h hookinc.h rsinc.h
 main.o: ../config.h rxvt.h rxvtlib.h optinc.h feature.h encoding.h rxvtfont.h
 main.o: rxvtutil.h rxvttoolkit.h iom.h iom_conf.h callback.h salloc.h
 main.o: libptytty.h rxvtperl.h hookinc.h rsinc.h keyboard.h
@@ -193,13 +194,15 @@ misc.o: libptytty.h rxvtperl.h hookinc.h rsinc.h
 netdisp.o: ../config.h rxvt.h rxvtlib.h optinc.h feature.h encoding.h
 netdisp.o: rxvtfont.h rxvtutil.h rxvttoolkit.h iom.h iom_conf.h callback.h
 netdisp.o: salloc.h libptytty.h rxvtperl.h hookinc.h rsinc.h
-ptytty.o: ../config.h ptytty.h libptytty.h ptytty_conf.h rxvtutil.h feature.h
+ptytty.o: ../config.h ptytty.h libptytty.h ptytty_conf.h rxvt.h rxvtlib.h
+ptytty.o: optinc.h feature.h encoding.h rxvtfont.h rxvtutil.h rxvttoolkit.h
+ptytty.o: iom.h iom_conf.h callback.h salloc.h rxvtperl.h hookinc.h rsinc.h
 rxvt.o: ../config.h rxvt.h rxvtlib.h optinc.h feature.h encoding.h rxvtfont.h
 rxvt.o: rxvtutil.h rxvttoolkit.h iom.h iom_conf.h callback.h salloc.h
 rxvt.o: libptytty.h rxvtperl.h hookinc.h rsinc.h
-rxvtc.o: ../config.h rxvtdaemon.h rxvtutil.h rxvt.h rxvtlib.h optinc.h
-rxvtc.o: feature.h encoding.h rxvtfont.h rxvttoolkit.h iom.h iom_conf.h
-rxvtc.o: callback.h salloc.h libptytty.h rxvtperl.h hookinc.h rsinc.h
+rxvtc.o: ../config.h rxvtdaemon.h rxvtutil.h libptytty.h rxvt.h rxvtlib.h
+rxvtc.o: optinc.h feature.h encoding.h rxvtfont.h rxvttoolkit.h iom.h
+rxvtc.o: iom_conf.h callback.h salloc.h rxvtperl.h hookinc.h rsinc.h
 rxvtd.o: ../config.h rxvt.h rxvtlib.h optinc.h feature.h encoding.h
 rxvtd.o: rxvtfont.h rxvtutil.h rxvttoolkit.h iom.h iom_conf.h callback.h
 rxvtd.o: salloc.h libptytty.h rxvtperl.h hookinc.h rsinc.h rxvtdaemon.h
@@ -275,8 +278,9 @@ keyboard.lo: ../config.h rxvt.h rxvtlib.h optinc.h feature.h encoding.h
 keyboard.lo: rxvtfont.h rxvtutil.h rxvttoolkit.h iom.h iom_conf.h callback.h
 keyboard.lo: salloc.h libptytty.h rxvtperl.h hookinc.h rsinc.h keyboard.h
 keyboard.lo: command.h
-logging.lo: ../config.h ptytty.h libptytty.h ptytty_conf.h rxvtutil.h
-logging.lo: feature.h
+logging.lo: ../config.h ptytty.h libptytty.h ptytty_conf.h rxvt.h rxvtlib.h
+logging.lo: optinc.h feature.h encoding.h rxvtfont.h rxvtutil.h rxvttoolkit.h
+logging.lo: iom.h iom_conf.h callback.h salloc.h rxvtperl.h hookinc.h rsinc.h
 main.lo: ../config.h rxvt.h rxvtlib.h optinc.h feature.h encoding.h
 main.lo: rxvtfont.h rxvtutil.h rxvttoolkit.h iom.h iom_conf.h callback.h
 main.lo: salloc.h libptytty.h rxvtperl.h hookinc.h rsinc.h keyboard.h
@@ -286,14 +290,15 @@ misc.lo: salloc.h libptytty.h rxvtperl.h hookinc.h rsinc.h
 netdisp.lo: ../config.h rxvt.h rxvtlib.h optinc.h feature.h encoding.h
 netdisp.lo: rxvtfont.h rxvtutil.h rxvttoolkit.h iom.h iom_conf.h callback.h
 netdisp.lo: salloc.h libptytty.h rxvtperl.h hookinc.h rsinc.h
-ptytty.lo: ../config.h ptytty.h libptytty.h ptytty_conf.h rxvtutil.h
-ptytty.lo: feature.h
+ptytty.lo: ../config.h ptytty.h libptytty.h ptytty_conf.h rxvt.h rxvtlib.h
+ptytty.lo: optinc.h feature.h encoding.h rxvtfont.h rxvtutil.h rxvttoolkit.h
+ptytty.lo: iom.h iom_conf.h callback.h salloc.h rxvtperl.h hookinc.h rsinc.h
 rxvt.lo: ../config.h rxvt.h rxvtlib.h optinc.h feature.h encoding.h
 rxvt.lo: rxvtfont.h rxvtutil.h rxvttoolkit.h iom.h iom_conf.h callback.h
 rxvt.lo: salloc.h libptytty.h rxvtperl.h hookinc.h rsinc.h
-rxvtc.lo: ../config.h rxvtdaemon.h rxvtutil.h rxvt.h rxvtlib.h optinc.h
-rxvtc.lo: feature.h encoding.h rxvtfont.h rxvttoolkit.h iom.h iom_conf.h
-rxvtc.lo: callback.h salloc.h libptytty.h rxvtperl.h hookinc.h rsinc.h
+rxvtc.lo: ../config.h rxvtdaemon.h rxvtutil.h libptytty.h rxvt.h rxvtlib.h
+rxvtc.lo: optinc.h feature.h encoding.h rxvtfont.h rxvttoolkit.h iom.h
+rxvtc.lo: iom_conf.h callback.h salloc.h rxvtperl.h hookinc.h rsinc.h
 rxvtd.lo: ../config.h rxvt.h rxvtlib.h optinc.h feature.h encoding.h
 rxvtd.lo: rxvtfont.h rxvtutil.h rxvttoolkit.h iom.h iom_conf.h callback.h
 rxvtd.lo: salloc.h libptytty.h rxvtperl.h hookinc.h rsinc.h rxvtdaemon.h
index c5f2583..ae90f84 100644 (file)
@@ -1033,7 +1033,8 @@ void
 rxvt_term::resize_all_windows (unsigned int newwidth, unsigned int newheight, int ignoreparent)
 {
   int fix_screen;
-  int old_width = szHint.width, old_height = szHint.height;
+  int old_width  = szHint.width;
+  int old_height = szHint.height;
   dDisp;
 
   window_calc (newwidth, newheight);
@@ -1065,9 +1066,9 @@ rxvt_term::resize_all_windows (unsigned int newwidth, unsigned int newheight, in
           y -= y1;
         }
 
-      x1 = (DisplayWidth (disp, display->screen) - old_width) / 2;
+      x1 = (DisplayWidth  (disp, display->screen) - old_width ) / 2;
       y1 = (DisplayHeight (disp, display->screen) - old_height) / 2;
-      dx = old_width - szHint.width;
+      dx = old_width  - szHint.width;
       dy = old_height - szHint.height;
 
       /* Check position of the center of the window */
@@ -1110,30 +1111,7 @@ rxvt_term::resize_all_windows (unsigned int newwidth, unsigned int newheight, in
     }
 
   if (fix_screen || old_height == 0)
-    {
-      int curr_screen = -1;
-      int old_ncol = prev_ncol;
-
-      /* scr_reset only works on the primary screen */
-      if (old_height)      /* this is not the first time through */
-        {
-          unsigned int ocol = ncol;
-          ncol = prev_ncol; // save b/c scr_blank_screen_mem uses this
-          curr_screen = scr_change_screen (PRIMARY);
-          ncol = ocol;
-        }
-
-      scr_reset ();
-
-      if (curr_screen >= 0) /* this is not the first time through */
-        {
-          scr_change_screen (curr_screen);
-          selection_check (old_ncol != ncol ? 4 : 0);
-        }
-    }
-
-  old_width = szHint.width;
-  old_height = szHint.height;
+    scr_reset ();
 
 #ifdef XPM_BACKGROUND
   if (pixmap)
index 1ff1b85..a8b9b25 100644 (file)
@@ -1,11 +1,21 @@
 #! perl
 
+use POSIX ();
+
+my $termios = new POSIX::Termios;
+
 sub on_button_press {
    my ($self, $event) = @_;
 
    return
       if $self->current_screen || $self->hidden_cursor;
 
+   $termios->getattr ($self->pty_fd)
+      or return;
+
+   return
+      if $termios->getlflag & &POSIX::ICANON;
+
    my ($row, $col) = $self->screen_cur;
    my $line = $self->line ($row);
    my $cur = $line->offset_of ($row, $col);
index 798ccaf..f90bb0e 100644 (file)
@@ -1330,7 +1330,7 @@ struct rxvt_term : zero_initialized, rxvt_vars {
 
   // screen.C
 
-  void lalloc (line_t &l) const NOTHROW
+  void lalloc (line_t &l) const
   {
     l.t = (text_t *)talloc->alloc ();
     l.r = (rend_t *)ralloc->alloc ();
@@ -1344,7 +1344,7 @@ struct rxvt_term : zero_initialized, rxvt_vars {
   }
 #endif
 
-  void lresize (line_t &l) const NOTHROW
+  void lresize (line_t &l) const
   {
     if (!l.t)
       return;
@@ -1422,10 +1422,11 @@ struct rxvt_term : zero_initialized, rxvt_vars {
 
   enum cursor_mode { SAVE, RESTORE };
 
-  void scr_poweron () NOTHROW;
+  void scr_poweron ();
   void scr_cursor (cursor_mode mode) NOTHROW;
   void scr_do_wrap () NOTHROW;
-  int scr_change_screen (int scrn) NOTHROW;
+  void scr_swap_screen () NOTHROW;
+  void scr_change_screen (int scrn);
   void scr_color (unsigned int color, int fgbg) NOTHROW;
   void scr_rendition (int set, int style) NOTHROW;
   void scr_add_lines (const wchar_t *str, int len, int minlines = 0) NOTHROW;
index fdb5e51..f7439ab 100644 (file)
@@ -1176,6 +1176,13 @@ rxvt_term::pty_ev_events (int events = EVENT_UNDEF)
        OUTPUT:
         RETVAL
 
+int
+rxvt_term::pty_fd ()
+       CODE:
+        RETVAL = THIS->pty->pty;
+       OUTPUT:
+        RETVAL
+
 Window
 rxvt_term::parent ()
        CODE:
index 5767a16..55eb9f7 100644 (file)
@@ -175,8 +175,11 @@ rxvt_term::scr_reset ()
   if (ncol == prev_ncol && nrow == prev_nrow)
     return;
 
+  if (current_screen != PRIMARY)
+    scr_swap_screen ();
+
   // we need at least two lines for wrapping to work correctly
-  if (nrow + saveLines < 2)
+  while (nrow + saveLines < 2)
     {
       //TODO//FIXME
       saveLines++;
@@ -197,7 +200,7 @@ rxvt_term::scr_reset ()
       /*
        * first time called so just malloc everything: don't rely on realloc
        */
-      top_row = 0;       /* no saved lines */
+      top_row    = 0;
       term_start = 0;
 
       talloc = new rxvt_salloc (ncol * sizeof (text_t));
@@ -282,7 +285,7 @@ rxvt_term::scr_reset ()
 
       if (top_row)
         {
-          // re-wrap lines, this is rather ugly, possibly because I am too dumb
+          // Re-wrap lines. This is rather ugly, possibly because I am too dumb
           // to come up with a lean and mean algorithm.
 
           row_col_t ocur = screen.cur;
@@ -349,11 +352,6 @@ rxvt_term::scr_reset ()
 
                       int len = min (min (prev_ncol - pcol, ncol - qcol), llen - lofs);
 
-#if DEBUG_STRICT
-                      assert (len);
-                      assert (pline.t);
-#endif
-
                       memcpy (qline->t + qcol, pline.t + pcol, len * sizeof (text_t));
                       memcpy (qline->r + qcol, pline.r + pcol, len * sizeof (rend_t));
 
@@ -403,8 +401,7 @@ rxvt_term::scr_reset ()
       clamp_it (screen.cur.row, 0, nrow - 1);
       clamp_it (screen.cur.col, 0, ncol - 1);
 
-      if (tabs)
-        free (tabs);
+      free (tabs);
     }
 
   CLEAR_ALL_SELECTION ();
@@ -417,6 +414,9 @@ rxvt_term::scr_reset ()
   for (int col = ncol; col--; )
     tabs [col] = col % TABSIZE == 0;
 
+  if (current_screen != PRIMARY)
+    scr_swap_screen ();
+
   tt_winch ();
 
   HOOK_INVOKE ((this, HOOK_RESET, DT_END));
@@ -429,15 +429,18 @@ rxvt_term::scr_reset ()
 void
 rxvt_term::scr_release () NOTHROW
 {
-  delete talloc; talloc = 0;
-  delete ralloc; ralloc = 0;
+  if (row_buf)
+    {
+      delete talloc; talloc = 0;
+      delete ralloc; ralloc = 0;
 
-  free (row_buf);
-  free (swap_buf);
-  free (drawn_buf);
-  free (tabs);
+      free (row_buf);
+      free (swap_buf);
+      free (drawn_buf);
+      free (tabs);
 
-  row_buf = 0; // signal that we freed all the arrays
+      row_buf = 0; // signal that we freed all the arrays
+    }
 }
 
 /* ------------------------------------------------------------------------- */
@@ -445,7 +448,7 @@ rxvt_term::scr_release () NOTHROW
  * Hard reset
  */
 void
-rxvt_term::scr_poweron () NOTHROW
+rxvt_term::scr_poweron ()
 {
   scr_release ();
   prev_nrow = prev_ncol = 0;
@@ -506,50 +509,56 @@ rxvt_term::scr_cursor (cursor_mode mode) NOTHROW
 #endif
 }
 
+void
+rxvt_term::scr_swap_screen ()
+{
+  if (!OPTION (Opt_secondaryScreen))
+    return;
+
+  for (int i = prev_nrow; i--; )
+    ::swap (ROW(i), swap_buf [i]);
+
+  ::swap (screen.cur, swap.cur);
+
+  screen.cur.row = clamp (screen.cur.row, 0, prev_nrow - 1);
+  screen.cur.col = clamp (screen.cur.col, 0, prev_ncol - 1);
+}
+
 /* ------------------------------------------------------------------------- */
 /*
  * Swap between primary and secondary screens
  * XTERM_SEQ: Primary screen  : ESC [ ? 4 7 h
  * XTERM_SEQ: Secondary screen: ESC [ ? 4 7 l
  */
-int
-rxvt_term::scr_change_screen (int scrn) NOTHROW
+void
+rxvt_term::scr_change_screen (int scrn)
 {
+  if (scrn == current_screen)
+    return;
+
   want_refresh = 1;
   view_start = 0;
 
-  if (current_screen == scrn)
-    return scrn;
-
   selection_check (2);        /* check for boundary cross */
 
   int i = current_screen; current_screen = scrn; scrn = i;
 
-  ::swap (screen.cur.row, swap.cur.row);
-  ::swap (screen.cur.col, swap.cur.col);
-
-  screen.cur.row = clamp (screen.cur.row, 0, prev_nrow - 1);
-  screen.cur.col = clamp (screen.cur.col, 0, prev_ncol - 1);
-
 #if NSCREENS
   if (OPTION (Opt_secondaryScreen))
     {
       num_scr = 0;
 
-      for (int i = prev_nrow; i--; )
-        ::swap (ROW(i), swap_buf [i]);
+      scr_swap_screen ();
 
       ::swap (screen.charset, swap.charset);
-      ::swap (screen.flags, swap.flags);
+      ::swap (screen.flags,   swap.flags);
       screen.flags |= Screen_VisibleCursor;
-      swap.flags |= Screen_VisibleCursor;
+      swap.flags   |= Screen_VisibleCursor;
     }
   else
 #endif
     if (OPTION (Opt_secondaryScroll))
       scr_scroll_text (0, prev_nrow - 1, prev_nrow);
-
-  return scrn;
 }
 
 // clear WrapNext indicator, solidifying position on next line
index b285638..eebfa5c 100644 (file)
@@ -141,11 +141,13 @@ To avoid too many false positives, this is only done when:
 
 =over 4
 
-=item - the mouse is on the same (multi-row-) line as the text cursor.
+=item - the tty is in ICANON state.
+
+=item - the text cursor is visible.
 
 =item - the primary screen is currently being displayed.
 
-=item - the text cursor is visible.
+=item - the mouse is on the same (multi-row-) line as the text cursor.
 
 =back
 
@@ -1312,6 +1314,11 @@ be used to suppress input and output handling to the pty/tty. See the
 description of C<< urxvt::timer->events >>. Make sure to always restore
 the previous value.
 
+=item $fd = $term->pty_fd
+
+Returns the master file descriptor for the pty in use, or C<-1> if no pty
+is used.
+
 =item $windowid = $term->parent
 
 Return the window id of the toplevel window.
index d8be22d..169b6f3 100644 (file)
@@ -1,3 +1,3 @@
 // VERSION _must_ be \d.\d+
 #define VERSION "7.2"
-#define DATE   "2006-01-19"
+#define DATE   "2006-01-22"