From: root Date: Thu, 12 Jan 2006 02:20:56 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=714004646eda152f4ec222a2f7a3d5793a277164;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/Changes b/Changes index d839c890..71e979ab 100644 --- a/Changes +++ b/Changes @@ -7,16 +7,15 @@ TODO: "slow" rendering mode for bidi and scripts TODO: read property sequence is broken with respect to utf-8 etc. TODO: http://www120.pair.com/mccarthy/nextstep/intro.htmld/Workspace.html is the correct nextstep look. TODO: clarify and get rid of SMOOTH_REFRESH etc. +TODO: scroll lines into scrollback when tscroll==0, regardless of bscrol WISH: OnTheSpot editing, or maybe switch to miiiiiiif. or maybe use perl and an overlay... WISH: just for fun, do shade and tint with XRender. WISH: support tex fonts 7.0 -TODO: run external commands more sytematically (using $self->env etc.) TODO: document searchable-scorllback hotkey TODO: double-click and right-extend TODO: change scrollback to use cursor movements -TODO: middle-click conflicts with menu use, !Ctrl - added sections for DISTRIBUTION MAINTAINERS and about SETUID/SETGID to the FAQ. - selection, searchable-scrollback, selection-popup and diff --git a/src/perl/mark-urls b/src/perl/mark-urls index 5fa83972..68fea189 100644 --- a/src/perl/mark-urls +++ b/src/perl/mark-urls @@ -11,6 +11,8 @@ sub on_start { my ($self) = @_; $self->{browser} = urxvt::untaint $self->x_resource ("urlLauncher") || "x-www-browser"; + + () } sub on_line_update { @@ -42,11 +44,14 @@ sub on_button_release { my $line = $self->line ($row); my $text = $line->t; + + my $mask = $self->ModLevel3Mask | $self->ModMetaMask + | urxvt::ShiftMask | urxvt::ControlMask; - if ($event->{button} == 2) { + if ($event->{button} == 2 && ($event->{state} & $mask) == 0) { while ($text =~ /$url/g) { - if ($-[0] <= $col && $+[0] >= $col) { - system "$self->{browser} \Q$1\E &"; + if ($-[1] <= $col && $+[1] >= $col) { + urxvt::exec_async $self->{browser}, $1; return 1; } } diff --git a/src/perl/selection-popup b/src/perl/selection-popup index 5bc679f5..11677b48 100644 --- a/src/perl/selection-popup +++ b/src/perl/selection-popup @@ -17,6 +17,8 @@ sub on_start { $self->{browser} = urxvt::untaint $self->x_resource ("urlLauncher") || "x-www-browser"; $self->grab_button (3, urxvt::ControlMask); + + () } sub on_button_press { @@ -69,7 +71,7 @@ sub on_button_press { and $add_button->("shell quote" => sub { $_ = "\Q$_" }); /^(http|ftp|telnet|irc|news):\// - and $add_button->("run $self->{browser}" => sub { system "$self->{browser} \Q$_\E &" }); + and $add_button->("run $self->{browser}" => sub { urxvt::exec_async $self->{browser}, $_ }); } $popup->show; diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs index 0e78f772..67594400 100644 --- a/src/rxvtperl.xs +++ b/src/rxvtperl.xs @@ -31,6 +31,8 @@ #include #include +#include "unistd.h" + #include "iom.h" #include "rxvt.h" #include "keyboard.h" @@ -712,6 +714,9 @@ untaint (SV *sv) OUTPUT: RETVAL +void +_exit (int status) + bool safe () CODE: diff --git a/src/urxvt.pm b/src/urxvt.pm index 9ba9369e..8b994530 100644 --- a/src/urxvt.pm +++ b/src/urxvt.pm @@ -617,6 +617,18 @@ sub invoke { $retval } +sub exec_async(@) { + my $pid = fork; + + return + if !defined $pid or $pid; + + %ENV = %{ $TERM->env }; + + exec @_; + _exit 255; +} + # urxvt::term::extension package urxvt::term::extension;