-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
bugSomething that's not working as intendedSomething that's not working as intended
Milestone
Description
fish, version 2.7.0-513-g81dd4a45
Linux, Fedora 27, gnome-terminal (TERM=xterm-256cotor).
Confirmed without customization (sh -c 'env HOME=$(mktemp -d) fish').
Actual behavior: string escape doesn't handle NUL:
/h/b/fish-shell> printf 'foo\0bar' | cat -A
foo^@bar⏎
/h/b/fish-shell> printf 'foo\0bar' | string escape
foo
and string unescape has similar problem:
/h/b/fish-shell> printf 'escaped\\0text' | string unescape
escaped
Expected behavior:
/h/b/fish-shell> printf 'foo\0bar' | string escape
foo\0bar
/h/b/fish-shell> printf 'escaped\\0text' | string unescape | cat -A
escaped^@text⏎
Generally, it should be possible to round-trip any binary data through | string escape | string unescape |.
Metadata
Metadata
Assignees
Labels
bugSomething that's not working as intendedSomething that's not working as intended