GNU Readline from a socket

GNU Readline from a socket

Post by ch.. » Sat, 03 Jun 2000 04:00:00



I'm trying to get command line editing on a program that reads directly
from sockets.  (Basically, you telnet to a port, and are given a
command prompt) I've used fdopen() on the socket fd, and handed
rl_instream and rl_outstream the resulting FILE *.

readline gets the data, but it seems terminal cooked.  None of the
history or editing commands work, and there are double-echos on the
socket.

So, how do I convince readline that the socket is indeed a terminal, and
that raw (vs cooked) io can occur?

Any help would be appreciated.

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

GNU Readline from a socket

Post by ch.. » Mon, 05 Jun 2000 04:00:00


When all else fails RTFM . . . The late Richard Stevens' book, Advanced
Programming in the Unix Environment, that was gathering dust on my
shelf, reminded me what a pseudo-terminal is, and how to use it. . .

Back to coding!



> I'm trying to get command line editing on a program that reads
directly
> from sockets.  (Basically, you telnet to a port, and are given a
> command prompt) I've used fdopen() on the socket fd, and handed
> rl_instream and rl_outstream the resulting FILE *.

> readline gets the data, but it seems terminal cooked.  None of the
> history or editing commands work, and there are double-echos on the
> socket.

> So, how do I convince readline that the socket is indeed a terminal,
and
> that raw (vs cooked) io can occur?

> Any help would be appreciated.

> Sent via Deja.com http://www.deja.com/
> Before you buy.

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. GNU readline: make show-all-if-ambiguous the default ???

Hello, I've got a shell-ish program that uses the GNU readline (2.0)
for history and filename completion.  The default behavior for the
completion is to complete a word if it is unique, or beep.  Pressing
the <TAB> key twice in succession will print a list of all
possible commands.

I want to make the double-tab behavior the default for a single tab.
The docs claim tha t if you include 'set show-all-if-ambiguous'
in the ~/.inputrc file, it will do what I want - but is there
a way to make that change part of the program, rather than a user
specific preference?

thanx


--
____________________________________________________________________
   F. Tarek Rogers                          NetEdge Systems
   Phone:     919-991-9202                  P.O. Box 14993

2. CUPS filtering

3. GNU readline problem

4. can't autoload modules

5. gnu readline on Solaris 2.2

6. WWW Grab

7. GNU readline

8. Tivoli System's TME 10 NetView

9. GNU Readline library linking problems

10. DBX error with GNU readline

11. readline-2.0 from GNU

12. Substitute for GNU readline, that can handle UTF-8?

13. GNU libc extensions (readline) - How to link?