diff --git a/src/common.cpp b/src/common.cpp index 95caaf62a..6694a308c 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -953,6 +953,14 @@ static void escape_string_script(const wchar_t *orig_in, size_t in_len, wcstring need_escape = need_complex_escape = true; break; } + case L'\x7F': { + out += L'\\'; + out += L'x'; + out += L'7'; + out += L'f'; + need_escape = need_complex_escape = true; + break; + } case L'\\': case L'\'': { need_escape = need_complex_escape = true; diff --git a/tests/checks/string.fish b/tests/checks/string.fish index cd2d03626..c0cec01a5 100644 --- a/tests/checks/string.fish +++ b/tests/checks/string.fish @@ -710,3 +710,6 @@ end # CHECKERR: checks/string.fish (line {{\d+}}): function: The name 'string' is reserved, and cannot be used as a function name # CHECKERR: function string # CHECKERR: ^ + +string escape \x7F +# CHECK: \x7f