This is a well known problem. A quick glance at the newsgroup
finds some things:
- Use the tshell
- Set up correct terminfo (and hope that the program you use looks at it).
- Have a look at the eterm package in your distribution (I'm not sure if this is XEmacs only). This package contains the tshell and the doc says it's a realy ANSI terminal: * Uses standard ANSI (vt102) escape sequences.
- Here is a
discussion of the topic.
you begin bashing the string with a +42 regexp of confusion