18#include <readline/readline.h>
19#include <readline/history.h>
32 if (
char * line_read = ::readline(
"zypper> " ) )
37 ::add_history( line_read );
50 if ( !::isatty(STDOUT_FILENO) )
55 const char *cols_env = getenv(
"COLUMNS");
57 width = ::atoi( cols_env );
62 ::rl_get_screen_size( NULL, &width );
77 std::ifstream stm(
"/dev/tty" );
79 while (stm.good() && stm.readsome(s, 8));
std::string readline_getline()
Use readline to get line of input.
unsigned get_screen_width()
Reads COLUMNS environment variable or gets the screen width from readline, in that order.
void clear_keyboard_buffer()
Clear the keyboard buffer.