1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- #include "libbb.h"
- #define ESC "\033"
- #if ENABLE_STTY
- int stty_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
- #endif
- int reset_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
- int reset_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
- {
- static const char *const args[] = {
- "stty", "sane", NULL
- };
-
- if ( isatty(STDOUT_FILENO)) {
-
- printf(ESC"c" ESC"(B" ESC"[m" ESC"[J" ESC"[?25h");
-
- #if ENABLE_STTY
- return stty_main(2, (char**)args);
- #else
-
- fflush_all();
- execvp("stty", (char**)args);
- #endif
- }
- return EXIT_SUCCESS;
- }
|