[TriLUG] Weird Characters In My Log (rlwrap -l)

Josh Johnson josh_johnson at unc.edu
Fri May 1 10:44:29 EDT 2009


So I use a command like:

$ rlwrap -l ./session.log ssh me at host
or
$ rlwrap -l ./python.log python

and type away.

And it works... really well. But I have trouble when I hit the backspace 
key. Here's what I get (pulled up in vim):

[rlwrap] Fri May  1 09:09:24 2009

Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) ^M
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2^M
Type "help", "copyright", "credits" or "license" for more information.^M
 >>> b^H^[[K^M

This was a python test I did a little while ago, where I opened the 
interpreter, typed a 'b', backspaced, then hit ^D to quit.

I know the ^M is a carriage return (I'm logging in remotely from a Mac) 
^H is the actual backspace. ^[ is the escape character. I have no idea 
what ^[[K is, and neither does `col -b`:

[rlwrap] Fri May  1 09:09:24 2009

Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> K

Note the remnant 'K'.

I've been pulling my hair out trying to figure out what's wrong. Is 
there some sort of setting I need to add to my terminal or .profile to 
make this work the way I expect? Is there any explanation for what the 
^[[K is?

Any insight would be greatly appreciated.

Thanks!!
JJ

p.s.
Here is the output of stty -a when I'm logged into the remote server:
speed 38400 baud; rows 33; columns 122; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 
= M-^?; swtch = <undef>; start = ^Q; stop = ^S;
susp = ^Z; rprnt = ^R; werase = ^W; lnext = M-^?; flush = M-^?; min = 1; 
time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon 
-ixoff -iuclc ixany imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 
vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop 
-echoprt echoctl echoke

Also, I'm using iTerm, in OSX 10.5, if that's of any help. I'm loggin 
into an Ubuntu server (8.04 I believe)

slowly, I grow balder...



More information about the TriLUG mailing list