aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-07-25 15:18:20 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2011-07-25 15:18:20 +0200
commit4e552a70ec00e4eb9bb0bcde95688ddb3c4fcefe (patch)
treef39123cd092c53644788dea0636cfe155d4e8cb3 /libbb
parentbe391e759675b23ccf6e19cb6ea5b819840f3026 (diff)
downloadbusybox-4e552a70ec00e4eb9bb0bcde95688ddb3c4fcefe.tar.gz
less: optionally query terminal size via "ESC [ 6 n". Closes bug 2659.
+7 bytes is not selected, +100 if selected. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/read_key.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libbb/read_key.c b/libbb/read_key.c
index 840325c99..5dcd19c3f 100644
--- a/libbb/read_key.c
+++ b/libbb/read_key.c
@@ -214,7 +214,10 @@ int64_t FAST_FUNC read_key(int fd, char *buffer, int timeout)
}
n++;
/* Try to decipher "ESC [ NNN ; NNN R" sequence */
- if ((ENABLE_FEATURE_EDITING_ASK_TERMINAL || ENABLE_FEATURE_VI_ASK_TERMINAL)
+ if ((ENABLE_FEATURE_EDITING_ASK_TERMINAL
+ || ENABLE_FEATURE_VI_ASK_TERMINAL
+ || ENABLE_FEATURE_LESS_ASK_TERMINAL
+ )
&& n >= 5
&& buffer[0] == '['
&& buffer[n-1] == 'R'