diff --git a/src/fish_tests.cpp b/src/fish_tests.cpp index 8db4808b3..978e7f1c3 100644 --- a/src/fish_tests.cpp +++ b/src/fish_tests.cpp @@ -3984,6 +3984,7 @@ void history_tests_t::test_history_formats() { // The results are in the reverse order that they appear in the bash history file. // We don't expect whitespace to be elided (#4908: except for leading/trailing whitespace) const wchar_t *expected[] = {L"sleep 123", + L"a && echo valid construct", L"final line", L"echo supsup", L"export XVAR='exported'", diff --git a/src/history.cpp b/src/history.cpp index 52af3401a..7b400fc68 100644 --- a/src/history.cpp +++ b/src/history.cpp @@ -1127,10 +1127,6 @@ 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; - // Temporarily skip lines with && and || - if (line.find(L"&&") != std::string::npos) return false; - if (line.find(L"||") != 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; diff --git a/tests/history_sample_bash b/tests/history_sample_bash index d800f0397..45609fae3 100644 --- a/tests/history_sample_bash +++ b/tests/history_sample_bash @@ -12,7 +12,7 @@ echo hello \ another `command and arg` to skip backticks `are not allowed` -a && echo invalid construct +a && echo valid construct [[ x = y ]] && echo double brackets not allowed (( 1 = 2 )) && echo double parens not allowed posix_cmd_sub $(is not supported)