From: root Date: Mon, 20 Feb 2006 20:44:22 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=11a4682b77f74acfdbc947e71fb805b5d98cced5;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/Changes b/Changes index a382a6aa..247b2c04 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,5 @@ rxvt-unicode changelog <= google-friendly title -TODO: -pe tabbed users want -e and probably lots of other things. TODO: xcopyarea pass broken, fix and improve TODO: event mechanism that replaces on_keyboard_command with something more scalable. TODO: overlays collide with the way the out-of-focus cursor is being drawn @@ -20,6 +19,7 @@ DUMB: support tex fonts of more network bandwidth and slight nausea on the side of the author. - readline perl extension now requires shift-click instead of a normal click. + - tabbed perl extension now supports -e. - disabled graphics-exposures on the main drawing GC, report any refresh bugs please. - improve property handling for -pe tabbed: avoid unnecessary property @@ -42,6 +42,7 @@ DUMB: support tex fonts (reported by Paco-Paco). - fix a bug in xcopyarea pass and _disable_ it, as it seems not to be working in either rxvt-unicode nor in the original rxvt. + - removed undocumented -exec alias for the -e option. 7.6 Fri Feb 10 08:52:36 CET 2006 - changed interpretation of [alpha] colour prefix. diff --git a/src/init.C b/src/init.C index 45693336..f945094f 100644 --- a/src/init.C +++ b/src/init.C @@ -260,10 +260,10 @@ rxvt_term::init_resources (int argc, const char *const *argv) const char **cmd_argv, **r_argv; /* - * Look for -exec option. Find => split and make cmd_argv[] of command args + * Look for -e option. Find => split and make cmd_argv[] of command args */ for (r_argc = 0; r_argc < argc; r_argc++) - if (!strcmp (argv[r_argc], "-e") || !strcmp (argv[r_argc], "-exec")) + if (!strcmp (argv[r_argc], "-e")) break; r_argv = (const char **)rxvt_malloc (sizeof (char *) * (r_argc + 1)); diff --git a/src/perl/readline b/src/perl/readline index c6bb4dd1..b896c00b 100644 --- a/src/perl/readline +++ b/src/perl/readline @@ -39,22 +39,23 @@ sub on_button_press { my $cur = $line->offset_of ($row, $col); my $ofs = $line->offset_of ($event->{row}, $event->{col}); - if ($ofs >= 0 && $ofs < $line->l) { - my $diff = $ofs - $cur; - my $move; - - if ($diff < 0) { - ($ofs, $cur) = ($cur, $ofs); - $move = "\x1b[D"; - } else { - $move = "\x1b[C"; - } + $ofs >= 0 && $ofs < $line->l + or return; - my $skipped = substr $line->t, $cur, $ofs - $cur; - $skipped =~ s/\x{ffff}//g; + my $diff = $ofs - $cur; + my $move; - $self->tt_write ($move x length $skipped); + if ($diff < 0) { + ($ofs, $cur) = ($cur, $ofs); + $move = "\x1b[D"; + } else { + $move = "\x1b[C"; } - () + my $skipped = substr $line->t, $cur, $ofs - $cur; + $skipped =~ s/\x{ffff}//g; + + $self->tt_write ($move x length $skipped); + + 1 } diff --git a/src/perl/tabbed b/src/perl/tabbed index ec673c15..8a479e82 100644 --- a/src/perl/tabbed +++ b/src/perl/tabbed @@ -44,7 +44,7 @@ sub refresh { } sub new_tab { - my ($self) = @_; + my ($self, @argv) = @_; my $offset = $self->fheight; @@ -65,6 +65,7 @@ sub new_tab { my $term = new urxvt::term $self->env, $urxvt::RXVTNAME, -embed => $self->parent, + @argv, ; } @@ -244,7 +245,13 @@ sub on_start { $self->cmd_parse ("\033[?25l"); - $self->new_tab; + my @argv = $self->argv; + + do { + shift @argv; + } while @argv && $argv[0] ne "-e"; + + $self->new_tab (@argv); () } diff --git a/src/rxvt.C b/src/rxvt.C index 4eddc573..c02fedca 100644 --- a/src/rxvt.C +++ b/src/rxvt.C @@ -32,20 +32,24 @@ try { rxvt_init (); + rxvt_term *t = new rxvt_term; + #if ENABLE_PERL + stringvec *args = new stringvec; stringvec *envv = new stringvec; + for (int i = 0; i < argc; i++) + args->push_back (strdup (argv [i])); + for (char **var = environ; *var; var++) envv->push_back (strdup (*var)); envv->push_back (0); + + if (!t->init (args, envv)) #else - stringvec *envv = 0; + if (!t->init (argc, argv, 0)) #endif - - rxvt_term *t = new rxvt_term; - - if (!t->init (argc, argv, envv)) return EXIT_FAILURE; io_manager::loop (); diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs index aa481a7b..14539997 100644 --- a/src/rxvtperl.xs +++ b/src/rxvtperl.xs @@ -1211,24 +1211,19 @@ rxvt_term::display_id () RETVAL SV * -rxvt_term::_env () - CODE: +rxvt_term::envv () + ALIAS: + argv = 1 + PPCODE: { - if (THIS->envv) - { - AV *av = newAV (); + stringvec *vec = ix ? THIS->argv : THIS->envv; - for (char **i = THIS->envv->begin (); i != THIS->envv->end (); ++i) - if (*i) - av_push (av, newSVpv (*i, 0)); + EXTEND (SP, vec->size ()); - RETVAL = newRV_noinc ((SV *)av); - } - else - RETVAL = &PL_sv_undef; + for (char **i = vec->begin (); i != vec->end (); ++i) + if (*i) + PUSHs (sv_2mortal (newSVpv (*i, 0))); } - OUTPUT: - RETVAL int rxvt_term::pty_ev_events (int events = EVENT_UNDEF) diff --git a/src/urxvt.pm b/src/urxvt.pm index f81a7e2b..65d95cc4 100644 --- a/src/urxvt.pm +++ b/src/urxvt.pm @@ -1476,14 +1476,19 @@ Returns the LC_CTYPE category string used by this rxvt-unicode. Returns a copy of the environment in effect for the terminal as a hashref similar to C<\%ENV>. +=item @envv = $term->envv + +Returns the environment as array of strings of the form C. + +=item @argv = $term->argv + +Return the argument vector as this terminal, similar to @ARGV, but +includes the program name as first element. + =cut sub env { - if (my $env = $_[0]->_env) { - +{ map /^([^=]+)(?:=(.*))?$/s && ($1 => $2), @$env } - } else { - +{ %ENV } - } + +{ map /^([^=]+)(?:=(.*))?$/s && ($1 => $2), $_[0]->envv } } =item $modifiermask = $term->ModLevel3Mask