Hi --

This is a free email account, so I don't have control over what's
posted in the footer. You can safely ignore what's there.
As far as my questions go:

> I don't see any reference for "term class", unless you mean "urxvt::term
> class" which is clearly described in the urxvtperl manpage.

Yes, this set of questions relates to urxvt::term class. I don't
know that was a joke... so, ha. Good one...?

> [...] in X11, applications do not open windows themselves, they
> merely ask the wm to open one for them, which then choses desktop etc.

I just realized that I'm already using wmctrl to do this, so that's fine.
In case anyone else wants to do something similar, here's the syntax:

# switch to Desktop 2
wmctrl -s 1

Note that wmctrl starts the desktop increment from zero
(i.e. Desktop 1 = "wmctrl -s 0", Desktop 2 = "wmctrl -s 1", etc.).

> Urxvt only knows the single command it starts within the terminal window,
> it cannot start additional commands (it would be technically possible,
> but almost cetrainly very undesirable).

How would you open a new window and, for example, send the 'ls' command
to that window, then leaving the command line open to await further input?

This is desirable functionality in terms of automating the setup
of up your working environment. Another example would be something simple
like sending a message to the terminal when it opens,
like "echo 'Hello My Dear User!'" (or something else).

>> ...and the following creates a reference to the 'envv' hash:
>> my @envv = $self->envv;
> 
> No, that simply returns all environment variables by value.

That was a mistake. I meant to write: my $env = $self->env;

If that's incorrect, what is the correct way to set
the $envhashref and $rxvtname variables? The documentation
gives no further ideas (and if it does, repeating here would
be like asking me to read it for the millionth time -- not useful).

$term = new urxvt::term $envhashref, $rxvtname, [arg...]

An example of how to start a new terminal window and send a command
to that window is what would be most useful here, so that I can
go ahead and start using urxvt if at all possible. Has anyone
done this? It seems like something a powerful application like
urxvt would be able to do easily once you know how to do it.

Thanks for your help.

P.S. I'm also curious about how to resize fonts dynamically,
i.e. 'ctrl +' to enlarge the font and 'ctrl -' to decrease the size.
There is an extension (called 'font-size') that does this, but it doesn't
render the text correctly until you resize the window. Font resizing
seems like a feature that an advanced terminal like urxvt would have built-in,
so if I missed that in the documentation (or there are other extensions
that work like font resizing does in a web browser, for example),
please advise...


> -----Original Message-----
> From: [email protected]
> Sent: Sun, 21 Dec 2014 14:24:33 +0100
> To: [email protected]
> Subject: Re: Using the The "urxvt::term" Class
> 
> On Sat, Dec 20, 2014 at 09:14:13AM -0800, kario tay <[email protected]>
> wrote:
>> I wanted to know if there are any resources
>> available for understanding and using
>> the 'term' class.
> 
> I don't see any reference for "term class", unless you mean "urxvt::term
> class" which is clearly described in the urxvtperl manpage.
> 
> I am afraid you need to ask a much more specific question.
> 
>> 1. How exactly is $term defined?
> 
> rxvt-unicode is free software, you cna look at the exact deifnition by
> downloading the source code. wherever you got the binary is also the
> place to get the corresponding source code.
> 
>>   $term = new urxvt::term $envhashref, $rxvtname, [arg...]
>> 
>> I've used "my $env = $self->env;" to define the
>> $envhashref. So I suppose that the existing terminal's
>> environment variables are used for the new terminal.
>> 
>> I suppose this corresponds directly to the environment
>> variables themselves, since the following reproduces
>> those variables...
> 
> The env hash ref is indeed a hashref that contains the environment for
> the
> terminal (env is short for environment), and using $self->env is a common
> idiom in existing extensions to inherit the environment from the current
> terminal.
> 
>> ...and the following creates a reference to the 'envv' hash:
>> my @envv = $self->envv;
> 
> No, that simply returns all environment variables by value.
> 
>> Is this correct? It seems odd to have to explicitly declare
>> the environment if that setting will remain unchanged in the
>> vast majority of cases.
> 
> What would be the alternative?
> 
>> 2. How should $rxvtname be set? Setting it to a name of my
>> choice results in two windows opening rather than one.
>> That behavior is odd... what is the correct way to define
>> the $rxvtname variable?
> 
> Really, same thing as in system(perl) or execve(2), the program
> name. Without looking at your code, I can't say why you get two windows,
> but urxvt will not open two terminals just because you use a different
> name.
> 
>> What exactly does ", [arg...]" refer to?
> 
> [] signifies optional arguments, and ... indicates one or more.
> 
>> 3. How is $term itself used? It apparently isn't
>> a reference to the new terminal window. What is its
>> purpose and how do you use it? An example would
>> probably be extremely useful here.
> 
> It certainly should be a reference to the new terminal object, what made
> you
> think it isn't?
> 
>> 4. How can $term->exec_async ($cmd) send a command
>> to the new terminal window?
> 
> Not at all.
> 
>> Is there a better way to send commands to a new window? Examples?
> 
> Urxvt only knows the single command it starts within the terminal window,
> it cannot start additional commands (it would be technically possible,
> but
> almost cetrainly very undesirable).
> 
>> 5. Is there a way to specify which desktop a terminal
>> window should appear in?
> 
> Very likely, but since desktops are a window manager construct, you need
> to consult the documentation of your window manager to find out how to
> make it do it - in X11, applications do not open windows themselves, they
> merely ask the wm to open one for them, which then choses desktop etc.
> 
>> FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!
>> Check it out at http://www.inbox.com/earth
> 
> Please don't advertise proprietary windows software on this list.
> 
> --
>                 The choice of a       Deliantra, the free code+content
> MORPG
>       -----==-     _GNU_              http://www.deliantra.net
>       ----==-- _       generation
>       ---==---(_)__  __ ____  __      Marc Lehmann
>       --==---/ / _ \/ // /\ \/ /      [email protected]
>       -=====/_/_//_/\_,_/ /_/\_\

____________________________________________________________
Can't remember your password? Do you need a strong and secure password?
Use Password manager! It stores your passwords & protects your account.
Check it out at http://mysecurelogon.com/manager



_______________________________________________
rxvt-unicode mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/rxvt-unicode

Reply via email to