Re: zsh can output non-printable characters to the terminal in some error messages
Bart Schaefer <[email protected]> Wed, 10 Jun 2026 10:37:15 -0700
| Newsgroups | gmane.comp.shells.zsh.devel |
|---|---|
| Message-ID | <CAH+w=7axP6eJf5ZV4aeT__x1utnu1BBTLw-xxu4uvphxCCs7kw@mail.gmail.com> |
On Wed, Jun 10, 2026 at 10:01 AM Mikael Magnusson <[email protected]> wrote: > > Hmm, did you make the same mistake I did there? Eg, we didn't include > the #!/bin/zsh shebang. My script was run with /bin/sh and I suspect > so was yours? You don't need zsh or sh to "expose" this ... % mkdir /tmp/emptydir % cd /tmp/emptydir % touch file$'\033'\[H$'\033'\[c$'\n'$'\b' % find . -print (screen clears) % cd .. % rm -ri emptydir examine files in directory emptydir? y remove emptydir/file(cursor jumps up several lines, some garbage displayed) (type "y" and enter) remove emptydir? y rm: emptydir: Directory not empty % With the notable exception of "ls", most tools do not sanitize filename output. However: % zmodload zsh/files % rm -ri emptydir rm: remove `emptydir/file^[[H^[[c\n^H'? y rm: remove `emptydir'? y %