*** empty log message ***
authorroot <root>
Mon, 20 Feb 2006 20:44:22 +0000 (20:44 +0000)
committerroot <root>
Mon, 20 Feb 2006 20:44:22 +0000 (20:44 +0000)
Changes
src/init.C
src/perl/readline
src/perl/tabbed
src/rxvt.C
src/rxvtperl.xs
src/urxvt.pm

diff --git a/Changes b/Changes
index a382a6aa18cbc33ba1ccc1900c7c4f1d2d6bd53f..247b2c04ae2215fa68bd02caf05520d4d679880f 100644 (file)
--- 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.
index 45693336fd6af55fa762e852835a9c8c0b27c424..f945094fd7203f46adaa648ee9e60de295bd8879 100644 (file)
@@ -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));
index c6bb4dd155be20fe362fa8db85c18250f3c6a238..b896c00bc3728ab895ea779212d64b3e22384546 100644 (file)
@@ -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
 }
index ec673c15f0c47ca811ba9138ea3a4ef862296a77..8a479e82d4148c86a42c181e74acc357442fd716 100644 (file)
@@ -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);
 
    ()
 }
index 4eddc573f394c53f8d0f386c3bfd6878e834212f..c02fedca3fa2c2dd0fbd079dede6fdef11ab9cd7 100644 (file)
@@ -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 ();
index aa481a7b0c170b2c573d92b9660cdc5330b6d9c7..145399974d83427fa7252ee46ba0a66679a3d3ab 100644 (file)
@@ -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)
index f81a7e2b9f73c27577ea2f89c7bccaa98f4f4f39..65d95cc4483e835fbdb1cac89003d7ba6f5f0bbb 100644 (file)
@@ -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<VAR=VALUE>.
+
+=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