Gentoo Archives: gentoo-user-hu

From: Bukuli Norbert <bukuli.norbert@×××××.com>
To: gentoo-user-hu@l.g.o
Subject: [gentoo-user-hu] urxvt perl segitseg
Date: Mon, 07 Nov 2011 22:00:45
Message-Id: CA+Rr8u4PcgfO4oipR+imzWYVtnWzqSg0NrDHUWT+UYZW6iOXQQ@mail.gmail.com
Szervusztok!

Szeretnek egy kis segitseget kerni az urxvt perl moduljaival kapcsolatban.
Talalatam egy elegge hasznosat, a neve "tabbed". Ez pontosan az, amire
a neve utal, azonban van vele egy kis problemam. Uj tab nyitasakor az
uj nem orokli a regi pwd-jet.
Az az otletem tamadt, hogy jol atirom a megfelelo perl modult, azonban
ezzel a nyelvvel nincsenek tapasztalataim.

Az uj terminal letrehozasaert felelos resze ez az emlitet modulnak:


sub new_tab {   my ($self, @argv) = @_;
   my $offset = $self->fheight;
   # save a backlink to us, make sure tabbed is inactive   push
@urxvt::TERM_INIT, sub {      my ($term) = @_;      $term->{parent} =
$self;
      for (0 .. urxvt::NUM_RESOURCES - 1) {         my $value =
$self->{resource}[$_];
         $term->resource ("+$_" => $value)            if defined $value;      }
      $term->resource (perl_ext_2 => $term->resource ("perl_ext_2") .
",-tabbed");   };
   push @urxvt::TERM_EXT, urxvt::ext::tabbed::tab::;
   my $term = new urxvt::term      $self->env, $urxvt::RXVTNAME,
-embed => $self->parent,      @argv,   ;}

A vegen az argumentumvekrotba a valami ilyesmit kellene meg beleirni "-cd $PWD".
Szerintetek az hogyan lehetseges?

http://linux.die.net/man/3/urxvtperl
Itt van a megfelelo man page.
Ez a reszlet lehet erdekes a refi terminap pdw-je szempontjabol


$urxvt::TERM
The current terminal. This variable stores the current "urxvt::term"
object, whenever a callback/hook is executing.
@urxvt::TERM_INIT
All code references in this array will be called as methods of the
next newly created "urxvt::term" object (during the "on_init" phase).
The array gets cleared before the code references that were in it are
being executed, so references can push themselves onto it again if
they so desire.
This complements to the perl-eval command line option, but gets executed first.

@urxvt::TERM_EXT
Works similar to @TERM_INIT, but contains perl package/class names,
which get registered as normal extensions after calling the hooks in
@TERM_INIT but before other extensions. Gets cleared just like
@TERM_INIT.

A segitsegeteket elore is koszonom.--
Üdvözlettel:
Bukuli Norbert