diff --git a/src/cmd/9term/9term.c b/src/cmd/9term/9term.c index 7efce4ad..12d4be03 100644 --- a/src/cmd/9term/9term.c +++ b/src/cmd/9term/9term.c @@ -1021,7 +1021,8 @@ consread(void) s = setecho(sfd, 0); if(write(rcfd, buf, n) < 0) exits(0); - setecho(sfd, s); + if(s) + setecho(sfd, s); } }