diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-10 16:32:14 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-10 16:32:14 +0000 |
commit | 4eb8b936cb0aeb27c3e12f9a93fc43aa1e9668f5 (patch) | |
tree | 8cb052205ab9f9e97233afe39ddb2c6253ab8d1a /console-tools | |
parent | 2b52b2797bae774656b3f79ed1939a08fbed7b0e (diff) | |
download | busybox-w32-4eb8b936cb0aeb27c3e12f9a93fc43aa1e9668f5.tar.gz busybox-w32-4eb8b936cb0aeb27c3e12f9a93fc43aa1e9668f5.tar.bz2 busybox-w32-4eb8b936cb0aeb27c3e12f9a93fc43aa1e9668f5.zip |
more: do not mess with "/dev/console" (!);
fill whole 1st screen (was "screen sans one line");
fall back to cat if redirected or no ctty
less: fall back to cat if no ctty (was exiting)
resize: cosmetics
Diffstat (limited to 'console-tools')
-rw-r--r-- | console-tools/resize.c | 8 |
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 | |||
12 | int resize_main(int argc, char **argv); | 14 | int resize_main(int argc, char **argv); |
13 | int resize_main(int argc, char **argv) | 15 | int 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", |