From 962bfa96689715666d2453611ae54595e2afe8ff Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 24 Aug 2019 10:31:36 +0200 Subject: [PATCH] Escape literal dollar signs in quoted completions Closes #6060. --- src/parse_util.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/parse_util.cpp b/src/parse_util.cpp index 76ea30738..8b2df7565 100644 --- a/src/parse_util.cpp +++ b/src/parse_util.cpp @@ -548,6 +548,10 @@ wcstring parse_util_escape_string_with_quote(const wcstring &cmd, wchar_t quote, case L'\\': result.append({L'\\', L'\\'}); break; + case L'$': + if (quote == L'"') result.push_back(L'\\'); + result.push_back(L'$'); + break; default: if (c == quote) result.push_back(L'\\'); result.push_back(c);