From: Austin S. <te...@of...> - 2003-05-02 20:05:12
|
On Fri, May 02, 2003 at 08:14:21PM +0200, Miguel wrote: > >> That looks great ... I'll give it a shot. > >> > >> A suggestion ... I think it may be helpful for others to put an > >> example like this in the Expect man page. > > > > > > OK, if you can provide a running example, I'll be glad to include it in > > the FAQs... :o) > > > Well, I have an example that runs, but it doesn't do the right thing :( > > The behavior is the same as before ... some evil spirit is still doing me > the favor of linewrapping. > > I am completely dumbfounded. Went back to a Linux box and confirmed that I > don't get the behavior there. > > For now I'm sticking with the 'stty columns 250 ; telnet foo' solution. > Setting environment variables doesn't change the behavior of your terminal window. As best I could tell, it is the local host which decides when output wraps - the remote host just sends it raw, and the local terminal decides when there's too much, so inserts a newline. Setting columns would be an option in the stty() routine, but 'columns' isn't part of the POSIX terminal spec, so isn't supported by stty(), which uses the POSIX library for terminal handling. Thus the ugly kludge. Net::Telnet may save you here because it doesn't filter through a terminal at all. Come to think of it, you could probably just use open2 to start telnet without a terminal, then use Expect on the filehandles open2 returns. Anyway, that's probably as much talk about globs and terminals that anyone can handle this week. :-) Austin |