[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Strange new behavior of expect



I have an Expect script which exhibits strange behavior.  The script
logs me on to a remote host, then runs some commands, then invokes
"interact".

On my old laptop, running unstable, it worked well.  (Last updated
sometime last week.)

On my new laptop, also running unstable (last updated yesterday or
so), it is NOT working so well :-(  Below you can find a short expect
script exhibiting the problem:

#!/usr/bin/expect -f
spawn rlogin -x -F $argv
interact
# end of script

In the shell I get after this, all commands are echoed, and all ctrl
characters are also echoed: hitting Ctrl-B prints ^B on the screen,
and so on.

If I just type "rlogin -x -F my.host.name.here", then Ctrl-B moves
left one character, instead of printing ^B on the screen.

The "stty -a" output might be illustrative.  For the broken case, I
get:

    kgrossjo@dsrv0-1$ stty -a
    stty -a
    speed 9600 baud; 
    eucw 1:0:0:0, scrw 1:0:0:0
    intr = ^c; quit = ^\; erase = ^?; kill = ^u;
    eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>;
    start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
    rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
    -parenb -parodd cs8 -cstopb -hupcl cread -clocal -loblk -crtscts -crtsxoff -parext 
    -ignbrk brkint -ignpar -parmrk -inpck -istrip inlcr -igncr icrnl -iuclc 
    ixon ixany -ixoff imaxbel 
    isig icanon -xcase echo echoe echok -echonl -noflsh 
    -tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten 
    opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3 
    kgrossjo@dsrv0-2$ a^B

Note the echo of the command.  Also see the result of typing "a
Ctrl-B" at the second shell prompt.  For the working case, I get:

    kgrossjo@dsrv0-1$ stty -a
    speed 9600 baud; 
    rows = 24; columns = 80; ypixels = 316; xpixels = 484;
    eucw 1:0:0:0, scrw 1:0:0:0
    intr = ^c; quit = ^\; erase = ^?; kill = ^u;
    eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>;
    start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
    rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
    -parenb -parodd cs8 -cstopb -hupcl cread -clocal -loblk -crtscts -crtsxoff -parext 
    -ignbrk brkint -ignpar -parmrk -inpck -istrip inlcr -igncr icrnl -iuclc 
    ixon ixany -ixoff imaxbel 
    isig icanon -xcase echo echoe echok -echonl -noflsh 
    -tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten 
    opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3 
    kgrossjo@dsrv0-2$ 

Note the rows and columns arguments.

Is there something I can do to make the expect script produce a
better terminal where I can move the cursor around in the command
line, and invoke vi and less, and so on?

Kai



Reply to: