IRC like interface


#1

Hi,

I would like to try to write a text based Jabber client in Ruby, but
being that I am rather new to it, I am running into problems already:
I would like a text based user interface that looks somewhat like the
classic IRC clients: An input line at the bottom of the screen with the
rest of the screen being available for asyncronous output.
If at all possible, I would also like to support the readline library
for text input.
I figured I would use curses to keep input and output separated,
maintaining a separate cursor position for text that is typed in and for
text that comes in over a socket, for example. I have no idea, though,
how to get readline into the equation - and even without that, I am not
sure whether my approach would be really ideal.
Is there any easy to understand example code out there that would
illustrate how to program a simple chat client with a text based user
interface?

Any input would be much appreciated.
Thanks,
-juergen


#2

On Thu, Jan 05, 2006 at 01:44:24AM +0900, Juergen Fiedler wrote:

I figured I would use curses to keep input and output separated,
maintaining a separate cursor position for text that is typed in and for
text that comes in over a socket, for example. I have no idea, though,
how to get readline into the equation - and even without that, I am not
sure whether my approach would be really ideal.
Is there any easy to understand example code out there that would
illustrate how to program a simple chat client with a text based user
interface?

I don’t know of Ruby projects of that sort, off the top of my head, but
there’s an open source multiprotocol IM client called centericq that
might at least give you some vague ideas. Without double-checking, I
seem to recall that it was written in Perl, though for all I know right
now it could be C. I know it uses ncurses, at least.


Chad P. [ CCD CopyWrite | http://ccd.apotheon.org ]

“A script is what you give the actors. A program
is what you give the audience.” - Larry Wall


#3

Chad P. wrote:
[…]

I don’t know of Ruby projects of that sort, off the top of my head, but
there’s an open source multiprotocol IM client called centericq that
might at least give you some vague ideas. Without double-checking, I
seem to recall that it was written in Perl, though for all I know right
now it could be C. I know it uses ncurses, at least.

Centericq is what I use when I don’t play with new Jabber clients. It is
in fact C these days and an ‘ldd /usr/bin/centericq’ gives me a very
long list ending with

libkitchensink.so.11 => /usr/lib/libkitchensink.so.11 (0xb782a000)

yet it does not appear to use libreadline.

One program that uses both is freetalk, a pure Jabber client - but I
find the C source (which relies heavily on callbacks) rather hard to
follow.

Thanks for the input,
–j


#4

On Thu, Jan 05, 2006 at 06:39:26AM +0900, Juergen Fiedler wrote:

long list ending with
I get a list of 27 different dependencies, myself.

libkitchensink.so.11 => /usr/lib/libkitchensink.so.11 (0xb782a000)

I’d be highly amused if I saw something called “libkitchensink” in
there, though I’d be far less surprised to see it for a KDE application.

yet it does not appear to use libreadline.

Now that I’m actually looking at it, you’re right.

Sorry I wasn’t more helpful. That was the closest comparison that came
to mind.


Chad P. [ CCD CopyWrite | http://ccd.apotheon.org ]

“Real ugliness is not harsh-looking syntax, but having to
build programs out of the wrong concepts.” - Paul Graham