From cc0e366037b9af90015b562e71b660329a9012d2 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Fri, 9 Oct 2020 18:54:47 +0200 Subject: [PATCH] history: Skip lines with tabs when importing from bash Fixes #6923. --- src/history.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/history.cpp b/src/history.cpp index 6abb756c3..e9d06cdc2 100644 --- a/src/history.cpp +++ b/src/history.cpp @@ -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;