9.0
- use the scrollback buffer even when the scroll region doesn't
span the whole screen, as long as it starts at row 0.
+ - swap the environment in some more cases. This hopefully fixes
+ some segfaults that might be caused by xft asking for env variables
+ at the wrong time.
- selection popup now shows selection in dec/hex/oct.
- perl/selection: matching on unicode characters in the selection
code was O(n²), which equals infinity in some degenerate cases
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
-<title>urxvtperl - rxvt-unicode's embedded perl interpreter</title>
+<title>rxvtperl - rxvt-unicode's embedded perl interpreter</title>
<link rev="made" href="mailto:perl-binary@plan9.de" />
</head>
</p>
<hr />
<h1><a name="name">NAME</a></h1>
-<p>urxvtperl - rxvt-unicode's embedded perl interpreter</p>
+<p>rxvtperl - rxvt-unicode's embedded perl interpreter</p>
<p>
</p>
<hr />
()
}</pre>
<pre>
- # start a urxvt using it:</pre>
+ # start a rxvt using it:</pre>
<pre>
- urxvt --perl-lib $HOME -pe grab_test</pre>
+ rxvt --perl-lib $HOME -pe grab_test</pre>
<p>
</p>
<hr />
the <code>perl</code> resource are loaded and associated with it.</p>
<p>Scripts are compiled in a 'use strict' and 'use utf8' environment, and
thus must be encoded as UTF-8.</p>
-<p>Each script will only ever be loaded once, even in urxvtd, where
+<p>Each script will only ever be loaded once, even in rxvtd, where
scripts will be shared (but not enabled) for all terminals.</p>
<p>
</p>
<hr />
<h1><a name="prepackaged_extensions">PREPACKAGED EXTENSIONS</a></h1>
<p>This section describes the extensions delivered with this release. You can
-find them in <em>/usr/local/lib/urxvt/perl/</em>.</p>
+find them in <em>/opt/rxvt/lib/urxvt/perl/</em>.</p>
<p>You can activate them like this:</p>
<pre>
- urxvt -pe <extensionname></pre>
+ rxvt -pe <extensionname></pre>
<dl>
<dt><strong><a name="item_selection">selection (enabled by default)</a></strong><br />
</dt>
<dd>
Called whenever the user presses a key combination that has a
<code>perl:string</code> action bound to it (see description of the <strong>keysym</strong>
-resource in the <code>urxvt(1)</code> manpage).
+resource in the <code>rxvt(1)</code> manpage).
</dd>
<p></p>
<dt><strong><a name="item_on_x_event__24term_2c__24event">on_x_event $term, $event</a></strong><br />
</dt>
<dd>
Destroy the terminal object (close the window, free resources
-etc.). Please note that urxvt will not exit as long as any event
+etc.). Please note that rxvt will not exit as long as any event
watchers (timers, io watchers) are still active.
</dd>
<p></p>
</dt>
<dd>
Adds a keymap translation exactly as specified via a resource. See the
-<code>keysym</code> resource in the <code>urxvt(1)</code> manpage.
+<code>keysym</code> resource in the <code>rxvt(1)</code> manpage.
</dd>
<p></p>
<dt><strong><a name="item_rstyle">$rend = $term->rstyle ([$new_rstyle])</a></strong><br />
</dt>
<dt><strong><a name="item_total_rows">$nrow_plus_saveLines = $term->total_rows</a></strong><br />
</dt>
-<dt><strong><a name="item_nsaved">$lines_in_scrollback = $term->nsaved</a></strong><br />
+<dt><strong><a name="item_top_row">$topmost_scrollback_row = $term->top_row</a></strong><br />
</dt>
<dd>
Return various integers describing terminal characteristics.
<dt><strong><a name="item_view_start">$view_start = $term->view_start ([$newvalue])</a></strong><br />
</dt>
<dd>
-Returns the negative row number of the topmost line. Minimum value is
-<code>0</code>, which displays the normal terminal contents. Larger values scroll
+Returns the row number of the topmost displayed line. Maximum value is
+<code>0</code>, which displays the normal terminal contents. Lower values scroll
this many lines into the scrollback buffer.
</dd>
<p></p>
Returns the text of the entire row with number <code>$row_number</code>. Row <code>0</code>
is the topmost terminal line, row <code>$term->$ncol-1</code> is the bottommost
terminal line. The scrollback buffer starts at line <code>-1</code> and extends to
-line <a href="#item_nsaved"><code>-$term->nsaved</code></a>. Nothing will be returned if a nonexistent line
+line <code>-$term->nsaved</code>. Nothing will be returned if a nonexistent line
is requested.
</dd>
<dd>
.\" ========================================================================
.\"
.IX Title "rxvt 3"
-.TH rxvt 3 "2006-01-13" "7.0" "RXVT-UNICODE"
+.TH rxvt 3 "2006-01-15" "7.0" "RXVT-UNICODE"
.SH "NAME"
@@RXVT_NAME@@perl \- rxvt\-unicode's embedded perl interpreter
.SH "SYNOPSIS"
.ie n .IP "$nrow_plus_saveLines = $term\->total_rows" 4
.el .IP "$nrow_plus_saveLines = \f(CW$term\fR\->total_rows" 4
.IX Item "$nrow_plus_saveLines = $term->total_rows"
-.ie n .IP "$lines_in_scrollback = $term\->nsaved" 4
-.el .IP "$lines_in_scrollback = \f(CW$term\fR\->nsaved" 4
-.IX Item "$lines_in_scrollback = $term->nsaved"
+.ie n .IP "$topmost_scrollback_row = $term\->top_row" 4
+.el .IP "$topmost_scrollback_row = \f(CW$term\fR\->top_row" 4
+.IX Item "$topmost_scrollback_row = $term->top_row"
.PD
Return various integers describing terminal characteristics.
.ie n .IP "$x_display = $term\->display_id" 4
.ie n .IP "$view_start = $term\->view_start ([$newvalue])" 4
.el .IP "$view_start = \f(CW$term\fR\->view_start ([$newvalue])" 4
.IX Item "$view_start = $term->view_start ([$newvalue])"
-Returns the negative row number of the topmost line. Minimum value is
-\&\f(CW0\fR, which displays the normal terminal contents. Larger values scroll
+Returns the row number of the topmost displayed line. Maximum value is
+\&\f(CW0\fR, which displays the normal terminal contents. Lower values scroll
this many lines into the scrollback buffer.
.IP "$term\->want_refresh" 4
.IX Item "$term->want_refresh"
NAME
- urxvtperl - rxvt-unicode's embedded perl interpreter
+ rxvtperl - rxvt-unicode's embedded perl interpreter
SYNOPSIS
# create a file grab_test in $HOME:
()
}
- # start a urxvt using it:
+ # start a rxvt using it:
- urxvt --perl-lib $HOME -pe grab_test
+ rxvt --perl-lib $HOME -pe grab_test
DESCRIPTION
Everytime a terminal object gets created, extension scripts specified
Scripts are compiled in a 'use strict' and 'use utf8' environment, and
thus must be encoded as UTF-8.
- Each script will only ever be loaded once, even in urxvtd, where scripts
+ Each script will only ever be loaded once, even in rxvtd, where scripts
will be shared (but not enabled) for all terminals.
PREPACKAGED EXTENSIONS
This section describes the extensions delivered with this release. You
- can find them in /usr/local/lib/urxvt/perl/.
+ can find them in /opt/rxvt/lib/urxvt/perl/.
You can activate them like this:
- urxvt -pe <extensionname>
+ rxvt -pe <extensionname>
selection (enabled by default)
(More) intelligent selection. This extension tries to be more
on_keyboard_command $term, $string
Called whenever the user presses a key combination that has a
"perl:string" action bound to it (see description of the keysym
- resource in the urxvt(1) manpage).
+ resource in the rxvt(1) manpage).
on_x_event $term, $event
Called on every X event received on the vt window (and possibly
$term->destroy
Destroy the terminal object (close the window, free resources etc.).
- Please note that urxvt will not exit as long as any event watchers
+ Please note that rxvt will not exit as long as any event watchers
(timers, io watchers) are still active.
$isset = $term->option ($optval[, $set])
$success = $term->parse_keysym ($keysym_spec, $command_string)
Adds a keymap translation exactly as specified via a resource. See
- the "keysym" resource in the urxvt(1) manpage.
+ the "keysym" resource in the rxvt(1) manpage.
$rend = $term->rstyle ([$new_rstyle])
Return and optionally change the current rendition. Text that is
$is_mapped = $term->mapped
$max_scrollback = $term->saveLines
$nrow_plus_saveLines = $term->total_rows
- $lines_in_scrollback = $term->nsaved
+ $topmost_scrollback_row = $term->top_row
Return various integers describing terminal characteristics.
$x_display = $term->display_id
applicable.
$view_start = $term->view_start ([$newvalue])
- Returns the negative row number of the topmost line. Minimum value
- is 0, which displays the normal terminal contents. Larger values
+ Returns the row number of the topmost displayed line. Maximum value
+ is 0, which displays the normal terminal contents. Lower values
scroll this many lines into the scrollback buffer.
$term->want_refresh
void
rxvt_term::check_cb (check_watcher &w)
{
- SET_R (this);
- SET_LOCALE (locale);
+ make_current ();
display->flush ();
void
rxvt_term::flush_cb (time_watcher &w)
{
- SET_R (this);
- SET_LOCALE (locale);
+ make_current ();
refresh_limit = 1;
refresh_count = 0;
void
rxvt_term::pty_cb (io_watcher &w, short revents)
{
- SET_R (this);
- SET_LOCALE (locale);
+ make_current ();
if (revents & EVENT_READ)
// loop, but don't allow a single term to monopolize us
void
rxvt_term::pointer_cb (time_watcher &w)
{
- SET_R (this);
- SET_LOCALE (locale);
+ make_current ();
pointer_blank ();
}
void
rxvt_term::x_cb (XEvent &ev)
{
- dDisp;
+ make_current ();
- SET_R (this);
- SET_LOCALE (locale);
+ dDisp;
if (ev.xany.window == vt
&& HOOK_INVOKE ((this, HOOK_X_EVENT, DT_XEVENT, &ev, DT_END)))
void
rxvt_term::rootwin_cb (XEvent &ev)
{
- SET_R (this);
- SET_LOCALE (locale);
+ make_current ();
switch (ev.type)
{
rxvt_set_locale (savelocale);
}
+void
+rxvt_term::make_current () const
+{
+ SET_R (this);
+ rxvt_set_locale (locale);
+ set_environ (envv);
+}
+
#if ENABLE_COMBINING
class rxvt_composite_vec rxvt_composite;
void
rxvt_term::destroy_cb (time_watcher &w)
{
- SET_R (this);
+ make_current ();
delete this;
}
rxvt_term::init (int argc, const char *const *argv)
{
SET_R (this);
- set_environ (envv); // few things in X do not call setlocale :(
-
set_locale ("");
+ set_environ (envv); // few things in X do not call setlocale :(
if (!init_vars ())
return false;
char **s;
char buf[IMBUFSIZ];
- SET_R (this);
+ make_current ();
im_destroy ();
long vt_emask, vt_emask_perl;
- void vt_select_input ()
+ void vt_select_input () const
{
XSelectInput (display->display, vt, vt_emask | vt_emask_perl);
}
bool pty_fill ();
+ void make_current () const; // make this the "currently active" urxvt instance
+
void init_secondary ();
const char **init_resources (int argc, const char *const *argv);
const char *x_resource (const char *name);
// screen.C
- void lalloc (line_t &l)
+ void lalloc (line_t &l) const
{
l.t = (text_t *)talloc->alloc ();
l.r = (rend_t *)ralloc->alloc ();
}
#endif
- void lresize (line_t &l)
+ void lresize (line_t &l) const
{
if (!l.t)
return;
scr_blank_line (l, prev_ncol, ncol - prev_ncol, DEFAULT_RSTYLE);
}
- int fgcolor_of (rend_t r)
+ int fgcolor_of (rend_t r) const
{
int base = GET_BASEFG (r);
#ifndef NO_BRIGHTCOLOR
return base;
}
- int bgcolor_of (rend_t r)
+ int bgcolor_of (rend_t r) const
{
int base = GET_BASEBG (r);
#ifndef NO_BRIGHTCOLOR
return base;
}
- bool option (uint32_t opt)
+ bool option (uint32_t opt) const
{
return OPTION (opt);
}
options &= ~opt;
}
- void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs);
- void scr_blank_screen_mem (line_t &l, rend_t efs);
+ void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const;
+ void scr_blank_screen_mem (line_t &l, rend_t efs) const;
int scr_scroll_text (int row1, int row2, int count);
void scr_reset ();
void scr_release ();
extern rxvt_t rxvt_current_term;
-#define SET_R(r) rxvt_current_term = (r)
+#define SET_R(r) rxvt_current_term = const_cast<rxvt_term *>(r)
#define GET_R rxvt_current_term
#define scrollbar_visible() scrollBar.state
/* Fill part/all of a line with blanks. */
void
-rxvt_term::scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs)
+rxvt_term::scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const
{
if (!l.t)
{
/* ------------------------------------------------------------------------- */
/* Fill a full line with blanks - make sure it is allocated first */
void
-rxvt_term::scr_blank_screen_mem (line_t &l, rend_t efs)
+rxvt_term::scr_blank_screen_mem (line_t &l, rend_t efs) const
{
scr_blank_line (l, 0, ncol, efs);