1303 files changed, 32187 insertions, 57138 deletions
diff --git a/console-tools/resize.c b/console-tools/resize.c index 4b0d63a..567086f 100644 --- a/console-tools/resize.c +++ b/console-tools/resize.c @@ -6,7 +6,26 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ -/* no options, no getopt */ +//config:config RESIZE +//config: bool "resize" +//config: default y +//config: help +//config: This program is used to (re)set the width and height of your current +//config: terminal. +//config: +//config:config FEATURE_RESIZE_PRINT +//config: bool "Print environment variables" +//config: default y +//config: depends on RESIZE +//config: help +//config: Prints the newly set size (number of columns and rows) of +//config: the terminal. +//config: E.g.: +//config: COLUMNS=80;LINES=44;export COLUMNS LINES; + +//applet:IF_RESIZE(APPLET(resize, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_RESIZE) += resize.o //usage:#define resize_trivial_usage //usage: "" @@ -14,10 +33,12 @@ //usage: "Resize the screen" #include "libbb.h" +#include "common_bufsiz.h" #define ESC "\033" -#define old_termios_p ((struct termios*)&bb_common_bufsiz1) +#define old_termios_p ((struct termios*)bb_common_bufsiz1) +#define INIT_G() do { setup_common_bufsiz(); } while (0) static void onintr(int sig UNUSED_PARAM) @@ -33,6 +54,8 @@ int resize_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) struct winsize w = { 0, 0, 0, 0 }; int ret; + INIT_G(); + /* We use _stderr_ in order to make resize usable * in shell backticks (those redirect stdout away from tty). * NB: other versions of resize open "/dev/tty" |