--- rxvt-unicode/src/perl/tabbed 2006/02/11 02:28:19 1.19 +++ rxvt-unicode/src/perl/tabbed 2008/02/08 13:18:02 1.22 @@ -44,7 +44,7 @@ } sub new_tab { - my ($self) = @_; + my ($self, @argv) = @_; my $offset = $self->fheight; @@ -65,6 +65,7 @@ my $term = new urxvt::term $self->env, $urxvt::RXVTNAME, -embed => $self->parent, + @argv, ; } @@ -140,7 +141,10 @@ $self->configure; $self->copy_properties; - $tab->focus_in; + + $tab->focus_out; # just in case, should be a nop + $tab->focus_in if $self->focus; + $tab->XMapWindow ($tab->parent); delete $tab->{activity}; $self->refresh; @@ -241,7 +245,13 @@ $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); () } @@ -314,6 +324,19 @@ return 1; } + } + elsif ($event->{state} & urxvt::ControlMask) { + if ($keysym == 0xff51 || $keysym == 0xff53) { + my ($idx1) = grep $self->{tabs}[$_] == $tab, 0 .. $#{ $self->{tabs} }; + my $idx2 = ($idx1 + ($keysym == 0xff51 ? -1 : +1)) % @{ $self->{tabs} }; + + ($self->{tabs}[$idx1], $self->{tabs}[$idx2]) = + ($self->{tabs}[$idx2], $self->{tabs}[$idx1]); + + $self->make_current ($self->{tabs}[$idx2]); + + return 1; + } } ()