aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2017-02-05 20:02:47 -0600
committerRob Landley <rob@landley.net>2017-02-05 20:02:47 -0600
commit544669ff968beee1f522d72b2d92d1570c59f3ef (patch)
tree83436459e04757926ef596a1e8e2565cc3e2f901
parentea2067aedd4509b664211dd9815563742a31921d (diff)
downloadtoybox-544669ff968beee1f522d72b2d92d1570c59f3ef.tar.gz
Don't set SIGWINCH when reading ANSI size probe data, it causes a loop.
-rw-r--r--lib/interestingtimes.c3
-rw-r--r--toys/posix/ps.c1
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/interestingtimes.c b/lib/interestingtimes.c
index 62670cbb..f028f5e9 100644
--- a/lib/interestingtimes.c
+++ b/lib/interestingtimes.c
@@ -71,7 +71,6 @@ int scan_key_getsize(char *scratch, int miliwait, unsigned *xx, unsigned *yy)
if (key>0) {
if (xx) *xx = (key>>10)&1023;
if (yy) *yy = (key>>20)&1023;
- toys.signal = SIGWINCH;
return -3;
}
@@ -141,7 +140,7 @@ struct scan_key_list {
// Scan stdin for a keypress, parsing known escape sequences
// Blocks for miliwait miliseconds, none 0, forever if -1
-// Returns: 0-255=literal, -1=EOF, -2=NONE, 256-...=index into scan_key_list
+// Returns: 0-255=literal, -1=EOF, -2=TIMEOUT, 256-...=index into scan_key_list
// >512 is x<<9+y<<21
// scratch space is necessary because last char of !seq could start new seq
// Zero out first byte of scratch before first call to scan_key
diff --git a/toys/posix/ps.c b/toys/posix/ps.c
index d72e3359..9c38430a 100644
--- a/toys/posix/ps.c
+++ b/toys/posix/ps.c
@@ -1546,6 +1546,7 @@ static void top_common(
break;
}
if (i==-2) break;
+ if (i==-3) continue;
// Flush unknown escape sequences.
if (i==27) while (0<scan_key_getsize(scratch, 0, &TT.width, &TT.height));