A terminal for Lilbug

Patrick Serru patrick at serru.net
Wed Sep 18 07:04:05 CEST 2013


Le mardi 17 septembre 2013, Andre Klärner a écrit :
> Hi Patrick,
>
> On Mon 16.09.2013 21:58:15, Patrick Serru wrote:
>> Le lundi 16 septembre 2013, vous avez écrit :
>>> On Mon, Sep 16, 2013 at 06:52:16AM -0500, Patrick Serru
>>> <patrick at serru.net> wrote:
>>>
>>> Have you looked at the -pty-fd option? That will both do away with the
>>> need to -e something, and it should work with urxvtc, too (but also
>>> urxvt of course).
>>
>> Thank you for your response. I searched and searched. I found only two
>> references in the two pages given by Google. All but one is the content
>> of …/share/man/man7/urxvt.7, and the single other one was "Run a program
>> under a pty session". What I understoud is that there are a lot of
>> missunderstanding possible.
>>
>> Let me rephrase the question: I would like to know how to write in C a
>> piece of code that: would open a graphical (separate) window running
>> urxvt and then
>> would open some bidirectional pipe to be able to
>>  - write to the standard input of that just opened urxvt running
>> graphical window and - read from the standard output of that urxvt
>> window.
>
> That is exactly what the -pty-fd option is supposed to do. The
> bidirectional pipe is in this case this file descriptor. The manpage has a
> nice example in perl that illustrates how to use urxvt for pushing and
> reading arbitrary stuff to a terminal window, it is only missing the part
> where it thats another binary and connects it to this terminal.
>
> As I needed a small challenge today I tried to grab some pieces of code and
> implement this in C. I really have to admit: despite I disliked perl for
> many years in cases like this one I really love it. 8 lines of perl versus
> 44 lines of C are pretty nice.
>
> I attached the small program, you need to compile it using "gcc -lutil
> urxvt-pty-test.c". Hopefully it won't burn your house, as this is my
> probably third program that actually compiles and runs. If anyone want's to
> critise it: please do.
>
> Regards, Andre
------
      Hi Andre, hi all,

      I already thank you a lot for that. It is so nice. I suggest you to put 
it somewhere in the package! I was just wondering about the partability to 
windows, I am si scared by this! But for the moment it is perfect.

      I will try tomarrow. And will tell you the result: I will probably be 
happy!

      Thanks again, and cheers.
Patrick






More information about the rxvt-unicode mailing list