mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Improve usability of clickhouse-client
This commit is contained in:
parent
0eba575fcf
commit
7a54558a29
@ -527,7 +527,10 @@ private:
|
||||
std::cerr << std::fixed << std::setprecision(3);
|
||||
|
||||
if (is_interactive)
|
||||
{
|
||||
clearTerminal();
|
||||
showClientVersion();
|
||||
}
|
||||
|
||||
is_default_format = !config().has("vertical") && !config().has("format");
|
||||
if (config().has("vertical"))
|
||||
@ -2467,6 +2470,17 @@ private:
|
||||
std::cout << DBMS_NAME << " client version " << VERSION_STRING << VERSION_OFFICIAL << "." << std::endl;
|
||||
}
|
||||
|
||||
static void clearTerminal()
|
||||
{
|
||||
/// Clear from cursor until end of screen.
|
||||
/// It is needed if garbage is left in terminal.
|
||||
/// Show cursor. It can be left hidden by invocation of previous programs.
|
||||
/// A test for this feature: perl -e 'print "x"x100000'; echo -ne '\033[0;0H\033[?25l'; clickhouse-client
|
||||
std::cout <<
|
||||
"\033[0J"
|
||||
"\033[?25h";
|
||||
}
|
||||
|
||||
public:
|
||||
void init(int argc, char ** argv)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user