diff --git a/fish-rust/src/builtins/printf.rs b/fish-rust/src/builtins/printf.rs index 9de048a4e..167dd4d06 100644 --- a/fish-rust/src/builtins/printf.rs +++ b/fish-rust/src/builtins/printf.rs @@ -698,7 +698,7 @@ fn print_esc_string(&mut self, mut str: &wstr) { while !str.is_empty() { let c = str.char_at(0); if c == '\\' { - let consumed_minus_1 = self.print_esc(str, false); + let consumed_minus_1 = self.print_esc(str, true); str = &str[consumed_minus_1..]; } else { self.append_output(c); diff --git a/tests/checks/printf.fish b/tests/checks/printf.fish index cbedab18d..f1cc238e1 100644 --- a/tests/checks/printf.fish +++ b/tests/checks/printf.fish @@ -147,3 +147,7 @@ echo printf --help echo # CHECK: --help + +# This is how mc likes to encode the directory we should cd to. +printf '%b\n' '\0057foo\0057bar\0057' +# CHECK: /foo/bar/