Skip to content

Errors when trying to autocomplete (invalid) UTF-8 escapes #8195

Closed

Description

@septatrix

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 space
septatrix@thinkpad-e570 ~> \utest source: “/home/septatrix/.config/fish/functions/” is not a file
source: “/home/septatrix/.config/fish/completions/” is not a file

Activity

  1. added
    bug
    on Aug 1, 2021
  2. faho commented on Aug 1, 2021

    @faho
    Member

    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.

  3. added a commit that references this issue on Aug 1, 2021
    06acc20
  4. faho commented on Aug 1, 2021

    @faho
    Member

    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.

  5. added this to the fish 3.4.0 milestone on Aug 1, 2021
  6. septatrix commented on Aug 1, 2021

    @septatrix
    ContributorAuthor

    Maybe we should also warn about this as an invalid token similar to what echo \777 does?

  7. krobelus commented on Dec 12, 2021

    @krobelus
    Contributor

    Maybe we should also warn about this as an invalid token similar to what echo \777 does?

    yes, that would definitely be more friendly; I've opened #8545 to track that

  8. added a commit that references this issue on Dec 12, 2021
  9. locked as resolved and limited conversation to collaborators on Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions