History search sorts direct match after "starting letter" match

Open
#1,810 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
cli, search

Research direction

Start at the CTRL + R history-search entry point and reproduce the ranking with the two commands and search term "tcp" described here. Locate the history matching and sorting implementation; done means direct substring matches rank above matches based only on word initials, with tests covering the reported example.

Written by the indexing model from the issue text.

Description

area:search enhancement triaged
Discord username (optional)

No response

Describe the bug

History search sorts matches where the starting letter of each word in a historic command is the letter of the search term higher than direct matches.
For example searching for "tcp" sorts hits for "test-cli potato" before "adb tcpip 5000"

To Reproduce

Having these two commands in history:

  • txjs-cli push src/components
  • adb tcpip 5000

History search (CTRL + R) for "tcp". The first result is txjs-cli....

Expected behaviour

In this scenario I would expect adb tcpip 5000 to be the first result, as it has the letters "tcp" in it, while the other command does not.

Screenshots
image image
Operating System

MacOS

OS Version

X

Shell Version

X

Warp Version

v0.2022.08.31.18.11.stable_00

Additional context

No response

Does this block you from using Warp daily?

No

Warp Internal (ignore): linear-label:b8107fdf-ba31-488d-b103-d271c89cac3e

No response

Dominant language
Rust
Stars
65.1k
Forks
5.6k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from warpdotdev/warp

All issues in warpdotdev/warp

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.