From 4e552a70ec00e4eb9bb0bcde95688ddb3c4fcefe Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 25 Jul 2011 15:18:20 +0200 Subject: 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 --- libbb/read_key.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libbb') 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' -- cgit v1.2.3