9term, win: better echo cancellation

Also just drop \r from output.
It's a losing battle to keep turning it off.

R=rsc
http://codereview.appspot.com/2128042
This commit is contained in:
Russ Cox 2010-09-03 10:21:16 -04:00
parent a208917e7a
commit ef5c6a6eda
6 changed files with 129 additions and 61 deletions

View file

@ -77,25 +77,6 @@ isecho(int fd)
return (ttmode.c_lflag&ICANON && ttmode.c_lflag&ECHO);
}
int
setecho(int fd, int newe)
{
int old;
if(tcgetattr(fd, &ttmode) < 0)
fprint(2, "tcgetattr: %r\n");
old = (ttmode.c_lflag&ECHO)==ECHO;
if(old != newe){
if(newe)
ttmode.c_lflag |= ECHO;
else
ttmode.c_lflag &= ~ECHO;
if(tcsetattr(fd, TCSANOW, &ttmode) < 0)
fprint(2, "tcsetattr: %r\n");
}
return old;
}
int
getintr(int fd)
{