WISH: support tex fonts
9.0
-TODO: scroll lines into scrollback when tscroll==0, regardless of bscrol
+ - use the scrollback buffer even when the scroll region doesn't
+ span the whole screen, as long as it starts at row 0.
+ - 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
+ :-> Matching is now done on UTF-8, which makes it almost instant.
+ - perl/selection, perl/selection-autotransform: regexes are now
+ being interpreted in the locale urxvt was started.
+ - applied many patches by Emanuele Giaquinta that clean the code up
+ and fix more bugs in the utmp logging code.
- add tsl/fsl and related capabilities to the terminfo description,
to set the window title.
- - selection popup now shows selection in dec/hex/oct.
- - fix some bugs in the utmp logging code.
7.0 Fri Jan 13 14:02:18 CET 2006
- added sections for DISTRIBUTION MAINTAINERS and about
#ifdef UTMP_SUPPORT
#if HAVE_STRUCT_UTMP
-int rxvt_write_bsd_utmp (int utmp_pos, struct utmp *wu);
-void rxvt_update_wtmp (const char *fname, const struct utmp *putmp);
+static int rxvt_write_bsd_utmp (int utmp_pos, struct utmp *wu);
+static void rxvt_update_wtmp (const char *fname, const struct utmp *putmp);
#endif
-void rxvt_update_lastlog (const char *fname, const char *pty, const char *host);
+static void rxvt_update_lastlog (const char *fname, const char *pty, const char *host);
/*
* BSD style utmp entry
#ifdef HAVE_STRUCT_UTMPX
struct utmpx *utx = &this->utx;
#endif
-#ifdef HAVE_UTMP_PID
int i;
-#endif
struct passwd *pwent = getpwuid (getuid ());
if (!strncmp (pty, "/dev/", 5))
pty += 5; /* skip /dev/ prefix */
-#ifdef HAVE_UTMP_PID
+#if defined(HAVE_UTMP_PID) || defined(HAVE_STRUCT_UTMPX)
if (!strncmp (pty, "pty", 3) || !strncmp (pty, "tty", 3))
strncpy (ut_id, pty + 3, sizeof (ut_id));
else if (sscanf (pty, "pts/%d", &i) == 1)
#if defined(HAVE_STRUCT_UTMP) && !defined(HAVE_UTMP_PID)
{
- int i;
# ifdef HAVE_TTYSLOT
i = ttyslot ();
if (rxvt_write_bsd_utmp (i, ut))
/*
* Write a BSD style utmp entry
*/
-#ifdef HAVE_UTMP_H
-int
+#if defined(HAVE_STRUCT_UTMP) && !defined(HAVE_UTMP_PID)
+static int
rxvt_write_bsd_utmp (int utmp_pos, struct utmp *wu)
{
int fd;
* Update a BSD style wtmp entry
*/
#if defined(WTMP_SUPPORT) && !defined(HAVE_UPDWTMP) && defined(HAVE_STRUCT_UTMP)
-void
+static void
rxvt_update_wtmp (const char *fname, const struct utmp *putmp)
{
int fd, gotlock, retry;
/* ------------------------------------------------------------------------- */
#ifdef LASTLOG_SUPPORT
-void
+static void
rxvt_update_lastlog (const char *fname, const char *pty, const char *host)
{
# ifdef HAVE_STRUCT_LASTLOGX
for (my $idx = 0; defined (my $res = $self->x_resource ("selection.pattern-$idx")); $idx++) {
no re 'eval'; # just to be sure
+ $res = utf8::encode $self->locale_decode ($res);
push @{ $self->{patterns} }, qr/$res/;
}
my @matches;
+ # not doing matches in unicode mode helps speed
+ # enourmously here. working in utf-8 should be
+ # equivalent due to the magic of utf-8 encoding.
+ utf8::encode $text;
+ study $text; # _really_ helps, too :)
+
for my $regex (@mark_patterns, @{ $self->{patterns} }) {
while ($text =~ /$regex/g) {
if ($-[1] <= $markofs and $markofs <= $+[1]) {
}
for (my $idx = 0; defined (my $res = urxvt::untaint $self->x_resource ("selection-autotransform.$idx")); $idx++) {
+ $res = $self->locale_decode ($res);
my $transform = eval "sub { $res }";
if ($transform) {
if (count > 0
&& row1 == 0
- && row2 == nrow - 1
&& (current_screen == PRIMARY || OPTION (Opt_secondaryScroll)))
{
nsaved = min (nsaved + count, saveLines);
HOOK_INVOKE ((this, HOOK_SCROLL_BACK, DT_INT, count, DT_INT, nsaved, DT_END));
+ // scroll everything up 'count' lines
term_start = (term_start + count) % total_rows;
+ {
+ // severe bottommost scrolled line
+ line_t &l = ROW(row2 - count);
+ l.touch ();
+ l.is_longer (0);
+ }
+
+ // erase newly scorlled-in lines
+ for (int i = count; i; --i )
+ {
+ // basically this is a slightly optimized scr_blank_screen_mem
+ // it is worth the effort on slower machines
+ line_t &l = ROW(nrow - i);
+
+ scr_blank_line (l, 0, l.l, rstyle);
+
+ l.l = 0;
+ l.f = 0;
+ }
+
+ // now copy lines below the scroll region bottom to the
+ // bottom of the screen again, so they look as if they
+ // hadn't moved.
+ for (int i = nrow; --i > row2; )
+ {
+ line_t &l1 = ROW(i - count);
+ line_t &l2 = ROW(i);
+
+ ::swap (l1, l2);
+ l2.touch ();
+ }
+
+ // move and/or clear selection, if any
if (selection.op && current_screen == selection.screen)
{
selection.beg.row -= count;
}
}
- for (int i = count; i--; )
- {
- // basically thi is a slightly optimized scr_blank_screen_mem
- // it is worth the effort on slower machines
- line_t &l = ROW(row2 - i);
-
- scr_blank_line (l, 0, l.l, rstyle);
-
- l.l = 0;
- l.f = 0;
- }
-
+ // finally move the view window, if desired
if (OPTION (Opt_scrollWithBuffer)
&& view_start != 0
&& view_start != saveLines)