IRC like interface

  • Thread starter Juergen Fiedler
  • Start date
J

Juergen Fiedler

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
 
C

Chad Perrin

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.
 
J

Juergen Fiedler

Chad Perrin 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
 
C

Chad Perrin

Chad Perrin 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

I get a list of 27 different dependencies, myself.


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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,181
Messages
2,570,970
Members
47,536
Latest member
VeldaYoung

Latest Threads

Top