Both refresh the display in the traditional implementation.
---
 toys/posix/ps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toys/posix/ps.c b/toys/posix/ps.c
index 926132c4..faddf685 100644
--- a/toys/posix/ps.c
+++ b/toys/posix/ps.c
@@ -1679,7 +1679,7 @@ static void top_common(

       // Flush unknown escape sequences.
       if (i==27) while (0<scan_key_getsize(scratch, 0, &TT.width, &TT.height));
-      else if (i==' ') {
+      else if (i=='\r' || i==' ') {
         timeout = 0;
         break;
       } else if (toupper(i)=='R')
-- 
2.20.1.791.gb4d0f1c61a-goog
From 73c5b92a6760a5aa220f8b9f979b66910be40b1c Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Wed, 13 Feb 2019 15:29:52 -0800
Subject: [PATCH] top: support Enter as a synonym for Space.

Both refresh the display in the traditional implementation.
---
 toys/posix/ps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toys/posix/ps.c b/toys/posix/ps.c
index 926132c4..faddf685 100644
--- a/toys/posix/ps.c
+++ b/toys/posix/ps.c
@@ -1679,7 +1679,7 @@ static void top_common(
 
       // Flush unknown escape sequences.
       if (i==27) while (0<scan_key_getsize(scratch, 0, &TT.width, &TT.height));
-      else if (i==' ') {
+      else if (i=='\r' || i==' ') {
         timeout = 0;
         break;
       } else if (toupper(i)=='R')
-- 
2.20.1.791.gb4d0f1c61a-goog

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to