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:
parent
a208917e7a
commit
ef5c6a6eda
6 changed files with 129 additions and 61 deletions
|
|
@ -96,29 +96,6 @@ isecho(int fd)
|
|||
return 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;
|
||||
if(old != newe){
|
||||
ttmode.c_lflag &= ~ECHO;
|
||||
ttmode.c_lflag |= newe;
|
||||
/*
|
||||
* I tried using TCSADRAIN here, but that causes
|
||||
* hangs if there is any output waiting for us.
|
||||
* I guess TCSADRAIN is intended for use by our
|
||||
* clients, not by us.
|
||||
*/
|
||||
if(tcsetattr(fd, 0, &ttmode) < 0)
|
||||
fprint(2, "tcsetattr: %r\n");
|
||||
}
|
||||
return old;
|
||||
}
|
||||
|
||||
int
|
||||
getintr(int fd)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue