atuinsh / atuin

✨ Magical shell history
https://atuin.sh
MIT License
18.54k stars 520 forks source link

[Bug]: suffix-exact-match doesn't trim command first #2198

Open kidonng opened 3 days ago

kidonng commented 3 days ago

What did you expect to happen?

Searching command with suffix-exact-match ($) doesn't trim commands first, making some commands with trailing spaces unsearchable.

What happened?

Here's a little command in atuin:

Screenshot 2024-06-26 at 1 08 17 AM

You expect file$ to match it right? Wrong!

Screenshot 2024-06-26 at 1 08 23 AM

Let's Tab to see what it really is:

Screenshot 2024-06-26 at 1 08 35 AM

Turns out there's a space after the command (why the space is there is beyond me, atuin probably should have trimmed it when it saves the command). Comparing to another "normal" command makes the difference more clear:

Screenshot 2024-06-26 at 1 08 42 AM

Atuin doctor output

Atuin Doctor
Checking for diagnostics

Please include the output below with any bug reports or issues

{
  "atuin": {
    "version": "18.3.0",
    "sync": null,
    "sqlite_version": "3.44.0"
  },
  "shell": {
    "name": "fish",
    "default": "fish",
    "plugins": [
      "atuin"
    ],
    "preexec": "built-in"
  },
  "system": {
    "os": "Darwin",
    "arch": "arm64",
    "version": "14.5",
    "disks": [
      {
        "name": "Macintosh HD",
        "filesystem": "apfs"
      },
      {
        "name": "Macintosh HD",
        "filesystem": "apfs"
      }
    ]
  }
}

Code of Conduct