Merge pull request #67134 from azat/client/ignore_shell_suspend

Make C-z ignorance configurable (ignore_shell_suspend) in clickhouse-client
This commit is contained in:
Alexey Milovidov 2024-08-20 02:31:54 +00:00 committed by GitHub
commit af43ee8682
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 12 additions and 5 deletions

View File

@ -53,6 +53,9 @@
</proto_caps>
-->
<!-- Do not send clickhouse-client to background on C-z -->
<!-- <ignore_shell_suspend>true</ignore_shell_suspend> -->
<!--
Settings adjustable via command-line parameters
can take their defaults from that config file, see examples:

View File

@ -247,6 +247,7 @@ void DisksApp::runInteractiveReplxx()
suggest,
history_file,
/* multiline= */ false,
/* ignore_shell_suspend= */ false,
query_extenders,
query_delimiters,
word_break_characters.c_str(),

View File

@ -2,7 +2,7 @@
#include <unordered_map>
#include <vector>
#include <Client/ReplxxLineReader.h>
#include <Client/LineReader.h>
#include <Loggers/Loggers.h>
#include "DisksClient.h"
#include "ICommand_fwd.h"

View File

@ -1,6 +1,5 @@
#include "DisksClient.h"
#include <Client/ClientBase.h>
#include <Client/ReplxxLineReader.h>
#include <Disks/registerDisks.h>
#include <Common/Config/ConfigProcessor.h>

View File

@ -5,9 +5,8 @@
#include <string>
#include <unordered_map>
#include <vector>
#include <Client/ReplxxLineReader.h>
#include <Loggers/Loggers.h>
#include "Disks/IDisk.h"
#include <Disks/IDisk.h>
#include <Interpreters/Context.h>
#include <boost/program_options/options_description.hpp>

View File

@ -314,6 +314,7 @@ void KeeperClient::runInteractiveReplxx()
suggest,
history_file,
/* multiline= */ false,
/* ignore_shell_suspend= */ false,
query_extenders,
query_delimiters,
word_break_characters,

View File

@ -2526,6 +2526,7 @@ void ClientBase::runInteractive()
*suggest,
history_file,
getClientConfiguration().has("multiline"),
getClientConfiguration().getBool("ignore_shell_suspend", true),
query_extenders,
query_delimiters,
word_break_characters,

View File

@ -294,6 +294,7 @@ ReplxxLineReader::ReplxxLineReader(
Suggest & suggest,
const String & history_file_path_,
bool multiline_,
bool ignore_shell_suspend,
Patterns extenders_,
Patterns delimiters_,
const char word_break_characters_[],
@ -363,7 +364,8 @@ ReplxxLineReader::ReplxxLineReader(
rx.bind_key(Replxx::KEY::control('P'), [this](char32_t code) { return rx.invoke(Replxx::ACTION::HISTORY_PREVIOUS, code); });
/// We don't want the default, "suspend" behavior, it confuses people.
rx.bind_key_internal(replxx::Replxx::KEY::control('Z'), "insert_character");
if (ignore_shell_suspend)
rx.bind_key_internal(replxx::Replxx::KEY::control('Z'), "insert_character");
auto commit_action = [this](char32_t code)
{

View File

@ -15,6 +15,7 @@ public:
Suggest & suggest,
const String & history_file_path,
bool multiline,
bool ignore_shell_suspend,
Patterns extenders_,
Patterns delimiters_,
const char word_break_characters_[],