Page MenuHomePhabricator

Escape code sequences can't be stored in bash variables
Open, Incoming QueuePublic


This is because bash stores variables as C-style strings, and so the null byte used to terminate the Terminology escape sequence gets misinterpreted as being the end of the variable value.

This means that I can't put 1x1 inline images into my $PS1 bash prompt. :D

The only solution I can think of would be to allow the escape sequences to end with either null or some other byte, eg. \033 (or another non-printing, uncommon char). Unfortunately since filenames can generally contain any character other than null, this would limit the URIs that can be used in these escape sequences (albeit very unlikely to actually come up in practice).