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.
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
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"
<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
the previous value.
</dd>
<p></p>
+<dt><strong><a name="item_pty_fd">$fd = $term->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->parent</a></strong><br />
</dt>
<dd>
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>
.\" ========================================================================
.\"
.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"
.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
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"
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.
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.
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.
$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
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
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
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
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
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);
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 */
}
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)
#! 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);
// 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 ();
}
#endif
- void lresize (line_t &l) const NOTHROW
+ void lresize (line_t &l) const
{
if (!l.t)
return;
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;
OUTPUT:
RETVAL
+int
+rxvt_term::pty_fd ()
+ CODE:
+ RETVAL = THIS->pty->pty;
+ OUTPUT:
+ RETVAL
+
Window
rxvt_term::parent ()
CODE:
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++;
/*
* 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));
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;
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));
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 ();
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));
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
+ }
}
/* ------------------------------------------------------------------------- */
* Hard reset
*/
void
-rxvt_term::scr_poweron () NOTHROW
+rxvt_term::scr_poweron ()
{
scr_release ();
prev_nrow = prev_ncol = 0;
#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
=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
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.
// VERSION _must_ be \d.\d+
#define VERSION "7.2"
-#define DATE "2006-01-19"
+#define DATE "2006-01-22"