Mail Archives: cygwin/2009/10/16/22:06:19
Andy Koppe <andy.koppe <at> gmail.com> writes:
> 2009/10/16 Eric Backus:
> > Unfortunately, cygwin's terminfo/termcap entries for XTERM say that the
> > backspace key returns ^H. Â This can be seen by looking in /etc/termcap for
> > xterm, and finding the 'kb' property for that entry, or by running 'infocmp
> > xterm' and looking for the 'kbs' property.
> >
> > So, by default, mintty now does not match the terminfo/termcap entries. Â Is
> > there any way to fix this? Â I hesitate to suggest changing the
> > terminfo/termcap entries, since they should match the real xterm. Â But
> > actually I don't run X11, so I don't know if the current terminfo/termcap
> > really match xterm - the date on /etc/termcap at least is fairly old.
>
> xterm does still send ^H, but I agree both xterm and its termcap entry
> ought to be changed to match the new Cygwin 1.7 default and the Linux
> world. I should have a look at how to do that.
I suppose that is probably the best solution, but it does require changes in
three different packages: termcap, terminfo and xterm. In passing, I'll note
that xterm on my very old and out-of-date SuSE linux installation uses DEL, so
matches your new version of mintty.
> Have you come across an application that stumbles over this? All the
> one's I've tried seemed to go by the stty setting rather than the
> termcap entry anyway.
Off the top of my head, I don't know of any application that has a problem.
As you say, I think most use stty rather than terminfo. My problem, and the
reason I stumbled on this, is historical and of my own making.
Over the years, I've used many different terminal emulators on HP-UX, Linux,
and Windows, and they haven't always started with the correct stty setting for
the backspace key. Several programs rely on the stty setting,
including 'less' and 'emacs', so I wanted to correct the stty setting. To do
that, I have code like this in my .profile:
x=`tput kbs | od -to1 -An`
x=`echo $x`
if [ -n "$x" ]; then stty erase 0$x; fi
unset x
Basicly, this sets the stty erase character to match what the terminfo
database says is correct. This code has worked reasonably well for quite some
years now, and should be a no-op if everything is working correctly.
But this is what is causing my problem with mintty, since now I'm overwriting
the stty setting (which was correct) with the incorrect value from terminfo.
Since this problem is unlikely to affect people who simply ignore terminfo, I
suppose it should not be high priority.
> The workaround is to stick the following somewhere in your startup files:
>
> echo $'\e[?67h'
> stty erase '^H'
Sure, if I know that the terminal that I'm using is mintty, that is a good
workaround. But I try to use the same .profile on both my linux and cygwin
environments, and I'd prefer it to work with other terminals than just
mintty. If there was a portable way to determine whether I'm running within
mintty, I could use the above escape sequence, but I don't know of a good way
to determine if I'm in mintty. The obvious method would be to check $TERM,
but of course that doesn't work...
> ps: Oh gawd, how I hate this issue.
Oh, believe me, I feel your pain. Like DOS 8.3 filenames, everyone hates it,
but it never really goes away.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -