summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bin/te5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/te b/bin/te
index aca502d..0e3afcd 100644
--- a/bin/te
+++ b/bin/te
@@ -22,7 +22,10 @@ sub command_as_string {
my $command = '';
COMMAND: while (1) {
print '*';
- KEY: while (my $c = ReadKey 0) {
+ KEY: while (1) {
+ my $c = ReadKey 0;
+ last KEY unless defined $c;
+
my $pc = substr($command, -1);
if ($c eq "\e") {
print '$';