You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Errors when trying to autocomplete (invalid) UTF-8 escapes #8195
Version: fish, version 3.3.1
OS: Linux thinkpad-e570 5.12.14-300.fc34.x86_64 #1 SMP Wed Jun 30 18:30:21 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux (Fedora 34 Workstation)
Terminal: xterm-256color (Gnome Terminal)
Today I discovered that fish supports escape sequences like \u2215 and \145.
This can be used inside commands like \145cho Hello World \U0001f41f.
However this leads to weird errors when the input starts with an escape (maybe only invalid ones from what I observe) and fish tries to autocomplete it...
septatrix@thinkpad-e570 ~> \utest # now press spaceseptatrix@thinkpad-e570 ~> \utest source: “/home/septatrix/.config/fish/functions/” is not a filesource: “/home/septatrix/.config/fish/completions/” is not a file
Ah. What's happening here is that it's trying to load the completion script for \utest, which would have to be called ~/.config/fish/completions/\utest.fish. But somewhere in there it's dropping the \utest and trying to read ~/.config/fish/completions/ itself as a completion script, which fails because, well, it's not a file to read.
Okay, it now spews errors when you try to execute it (because it's not something to execute, because there is no bit sequence to express \utest, so it can't be a filename) instead of into the commandline while typing.
Activity
faho commentedon Aug 1, 2021
Ah. What's happening here is that it's trying to load the completion script for
\utest, which would have to be called~/.config/fish/completions/\utest.fish. But somewhere in there it's dropping the\utestand trying to read~/.config/fish/completions/itself as a completion script, which fails because, well, it's not a file to read.Disallow NULLs in function names and paths
faho commentedon Aug 1, 2021
Okay, it now spews errors when you try to execute it (because it's not something to execute, because there is no bit sequence to express
\utest, so it can't be a filename) instead of into the commandline while typing.septatrix commentedon Aug 1, 2021
Maybe we should also warn about this as an invalid token similar to what
echo \777does?krobelus commentedon Dec 12, 2021
yes, that would definitely be more friendly; I've opened #8545 to track that
CHANGELOG updates for 3.4.0