aboutsummaryrefslogtreecommitdiff
path: root/console-tools/resize.c
diff options
context:
space:
mode:
Diffstat (limited to 'console-tools/resize.c')
-rw-r--r--console-tools/resize.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/console-tools/resize.c b/console-tools/resize.c
index 2fe5526fb..40a1b4ee0 100644
--- a/console-tools/resize.c
+++ b/console-tools/resize.c
@@ -9,6 +9,8 @@
9/* no options, no getopt */ 9/* no options, no getopt */
10#include "busybox.h" 10#include "busybox.h"
11 11
12#define ESC "\033"
13
12int resize_main(int argc, char **argv); 14int resize_main(int argc, char **argv);
13int resize_main(int argc, char **argv) 15int resize_main(int argc, char **argv)
14{ 16{
@@ -27,10 +29,10 @@ int resize_main(int argc, char **argv)
27 * get_cursor_pos [6n 29 * get_cursor_pos [6n
28 * restore_cursor_pos 8 30 * restore_cursor_pos 8
29 */ 31 */
30 printf("\0337\033[r\033[999;999H\033[6n"); 32 printf(ESC"7" ESC"[r" ESC"[999;999H" ESC"[6n");
31 scanf("\033[%hu;%huR", &w.ws_row, &w.ws_col); 33 scanf(ESC"[%hu;%huR", &w.ws_row, &w.ws_col);
32 ret = ioctl(STDOUT_FILENO, TIOCSWINSZ, &w); 34 ret = ioctl(STDOUT_FILENO, TIOCSWINSZ, &w);
33 printf("\0338"); 35 printf(ESC"8");
34 tcsetattr(STDOUT_FILENO, TCSANOW, &old); 36 tcsetattr(STDOUT_FILENO, TCSANOW, &old);
35 if (ENABLE_FEATURE_RESIZE_PRINT) 37 if (ENABLE_FEATURE_RESIZE_PRINT)
36 printf("COLUMNS=%d;LINES=%d;export COLUMNS LINES;\n", 38 printf("COLUMNS=%d;LINES=%d;export COLUMNS LINES;\n",