history: Skip lines with tabs when importing from bash

Fixes #6923.
This commit is contained in:
Fabian Homborg 2020-10-09 18:54:47 +02:00
parent 5f3070220a
commit cc0e366037

View File

@ -1116,6 +1116,9 @@ static bool should_import_bash_history_line(const wcstring &line) {
if (line.find(L"]]") != std::string::npos) return false;
if (line.find(L"((") != std::string::npos) return false;
if (line.find(L"))") != std::string::npos) return false;
// Skip lines with literal tabs since we don't handle them well and we don't know what they mean.
// It could just be whitespace or it's actually passed somewhere (like e.g. `sed`).
if (line.find(L"\t") != std::string::npos) return false;
// Skip lines that end with a backslash. We do not handle multiline commands from bash history.
if (line.back() == L'\\') return false;