diff options
author | Bulat Gayazov <brgayazov@yandex-team.ru> | 2023-09-01 11:44:46 +0300 |
---|---|---|
committer | brgayazov <bulat@ydb.tech> | 2023-09-01 12:04:36 +0300 |
commit | f8032fae5138b5eeb2ee0bffd4719b1ee173c9c5 (patch) | |
tree | 8ed9aa704c60d796bb9a477f228330ee0d30455c | |
parent | ce4f14f3b059b1b44b3c87a82abe5144c29ce650 (diff) | |
download | ydb-f8032fae5138b5eeb2ee0bffd4719b1ee173c9c5.tar.gz |
Fixed interactive cli windows build
Fixed interactive cli windows build
Pull Request resolved: #347
8 files changed, 18 insertions, 31 deletions
diff --git a/contrib/restricted/patched/replxx/CMakeLists.darwin-x86_64.txt b/contrib/restricted/patched/replxx/CMakeLists.darwin-x86_64.txt index a39729e6df2..27787413ab5 100644 --- a/contrib/restricted/patched/replxx/CMakeLists.darwin-x86_64.txt +++ b/contrib/restricted/patched/replxx/CMakeLists.darwin-x86_64.txt @@ -8,8 +8,10 @@ add_library(restricted-patched-replxx) +target_compile_options(restricted-patched-replxx PUBLIC + -DREPLXX_STATIC +) target_compile_options(restricted-patched-replxx PRIVATE - -DREPLXX_BUILDING_DLL $<IF:$<CXX_COMPILER_ID:MSVC>,,-Wno-everything> ) target_include_directories(restricted-patched-replxx PUBLIC diff --git a/contrib/restricted/patched/replxx/CMakeLists.linux-aarch64.txt b/contrib/restricted/patched/replxx/CMakeLists.linux-aarch64.txt index bbd8abd9d4a..0a9bf0ce294 100644 --- a/contrib/restricted/patched/replxx/CMakeLists.linux-aarch64.txt +++ b/contrib/restricted/patched/replxx/CMakeLists.linux-aarch64.txt @@ -8,8 +8,10 @@ add_library(restricted-patched-replxx) +target_compile_options(restricted-patched-replxx PUBLIC + -DREPLXX_STATIC +) target_compile_options(restricted-patched-replxx PRIVATE - -DREPLXX_BUILDING_DLL $<IF:$<CXX_COMPILER_ID:MSVC>,,-Wno-everything> ) target_include_directories(restricted-patched-replxx PUBLIC diff --git a/contrib/restricted/patched/replxx/CMakeLists.linux-x86_64.txt b/contrib/restricted/patched/replxx/CMakeLists.linux-x86_64.txt index bbd8abd9d4a..0a9bf0ce294 100644 --- a/contrib/restricted/patched/replxx/CMakeLists.linux-x86_64.txt +++ b/contrib/restricted/patched/replxx/CMakeLists.linux-x86_64.txt @@ -8,8 +8,10 @@ add_library(restricted-patched-replxx) +target_compile_options(restricted-patched-replxx PUBLIC + -DREPLXX_STATIC +) target_compile_options(restricted-patched-replxx PRIVATE - -DREPLXX_BUILDING_DLL $<IF:$<CXX_COMPILER_ID:MSVC>,,-Wno-everything> ) target_include_directories(restricted-patched-replxx PUBLIC diff --git a/contrib/restricted/patched/replxx/CMakeLists.windows-x86_64.txt b/contrib/restricted/patched/replxx/CMakeLists.windows-x86_64.txt index a39729e6df2..27787413ab5 100644 --- a/contrib/restricted/patched/replxx/CMakeLists.windows-x86_64.txt +++ b/contrib/restricted/patched/replxx/CMakeLists.windows-x86_64.txt @@ -8,8 +8,10 @@ add_library(restricted-patched-replxx) +target_compile_options(restricted-patched-replxx PUBLIC + -DREPLXX_STATIC +) target_compile_options(restricted-patched-replxx PRIVATE - -DREPLXX_BUILDING_DLL $<IF:$<CXX_COMPILER_ID:MSVC>,,-Wno-everything> ) target_include_directories(restricted-patched-replxx PUBLIC diff --git a/contrib/restricted/patched/replxx/src/replxx_impl.cxx b/contrib/restricted/patched/replxx/src/replxx_impl.cxx index 7379c99670a..26ea3f2557b 100644 --- a/contrib/restricted/patched/replxx/src/replxx_impl.cxx +++ b/contrib/restricted/patched/replxx/src/replxx_impl.cxx @@ -2407,10 +2407,11 @@ Replxx::ACTION_RESULT Replxx::ReplxxImpl::clear_screen( char32_t c ) { } Replxx::ACTION_RESULT Replxx::ReplxxImpl::bracketed_paste( char32_t ) { - static const UnicodeString BRACK_PASTE_SUFF( "\033[201~" ); - static const int BRACK_PASTE_SLEN( BRACK_PASTE_SUFF.length() ); UnicodeString buf; - while ( char32_t c = read_unicode_character() ) { + while ( char32_t c = _terminal.read_char() ) { + if ( c == KEY::PASTE_FINISH ) { + break; + } if ( ( c == '\r' ) || ( c == KEY::control( 'M' ) ) ) { c = '\n'; } @@ -2418,10 +2419,6 @@ Replxx::ACTION_RESULT Replxx::ReplxxImpl::bracketed_paste( char32_t ) { c = '\t'; } buf.push_back( c ); - if ( ( c == '~' ) && buf.ends_with( BRACK_PASTE_SUFF.begin(), BRACK_PASTE_SUFF.end() ) ) { - buf.erase( buf.length() - BRACK_PASTE_SLEN, BRACK_PASTE_SLEN ); - break; - } } _data.insert( _pos, buf, 0, buf.length() ); _pos += buf.length(); diff --git a/contrib/restricted/patched/replxx/ya.make b/contrib/restricted/patched/replxx/ya.make index 8969a14927e..55197083fd6 100644 --- a/contrib/restricted/patched/replxx/ya.make +++ b/contrib/restricted/patched/replxx/ya.make @@ -24,7 +24,7 @@ NO_COMPILER_WARNINGS() NO_UTIL() CFLAGS( - -DREPLXX_BUILDING_DLL + GLOBAL -DREPLXX_STATIC ) SRCS( diff --git a/ydb/public/lib/ydb_cli/commands/interactive/interactive_cli.cpp b/ydb/public/lib/ydb_cli/commands/interactive/interactive_cli.cpp index bdce610c400..c6c61661dc8 100644 --- a/ydb/public/lib/ydb_cli/commands/interactive/interactive_cli.cpp +++ b/ydb/public/lib/ydb_cli/commands/interactive/interactive_cli.cpp @@ -90,7 +90,7 @@ void TInteractiveCLI::Run() { Words.push_back(word); } - TFsPath homeDirPath(GetHomeDir()); + TFsPath homeDirPath(HomeDir); TString historyFilePath(homeDirPath / ".ydb_history"); std::unique_ptr<ILineReader> lineReader = CreateLineReader(Prompt, historyFilePath, Suggest{std::move(Words)}); diff --git a/ydb/public/lib/ydb_cli/commands/interactive/line_reader.cpp b/ydb/public/lib/ydb_cli/commands/interactive/line_reader.cpp index e3bfb35b744..1a6e2c1e801 100644 --- a/ydb/public/lib/ydb_cli/commands/interactive/line_reader.cpp +++ b/ydb/public/lib/ydb_cli/commands/interactive/line_reader.cpp @@ -1,21 +1,5 @@ #include "line_reader.h" -#if defined(_WIN64) || defined(_WIN32) || defined(__WIN32__) - -#include <util/generic/yexception.h> - -namespace NYdb { -namespace NConsoleClient { - -std::unique_ptr<ILineReader> CreateLineReader(std::string, std::string, Suggest) { - throw yexception() << "Interactive CLI not supported on Windows"; -} - -} -} - -#else - #include <util/generic/string.h> #include <util/system/file.h> @@ -174,5 +158,3 @@ std::unique_ptr<ILineReader> CreateLineReader(std::string prompt, std::string hi } } - -#endif
\ No newline at end of file |