Skip to content

Commit

Permalink
terminal: always reset terminal when reading without echo
Browse files Browse the repository at this point in the history
Break out of the loop to ensure restore_term() is called before
returning.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
phillipwood authored and gitster committed Feb 23, 2022
1 parent b801210 commit 24d7ce3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compat/terminal.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ int read_key_without_echo(struct strbuf *buf)

ch = getchar();
if (ch == EOF)
return 0;
break;
strbuf_addch(buf, ch);
}
}
Expand Down

0 comments on commit 24d7ce3

Please sign in to comment.