Autocomplete in the middle of a path expression introduces spurious repeated slash characters

Open
#2,138 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
bash, rust
Domain
cli

Research direction

Reproduce the issue in Warp using the nested path example and the cursor movement and autocomplete steps described above. Trace the path completion handling for an interior directory and verify the result no longer inserts a second slash before the remaining path; confirm the original completion behavior still works.

Written by the indexing model from the issue text.

Description

area:completions bug needs-info ready-to-implement triaged
Discord username (optional)

No response

Describe the bug

When I have a path expression on my current line, and I back the cursor into it, I am able to use tab completion to identify subdirectories (good!). But when I accept the completion, Warp introduces a trailing slash character, even when my input already contains a slash.

Any reasonable file system call will of course ignore a repeated "//" in a path expression, but it is messy, confusing, and displays a lack of care.

To Reproduce
  1. Enter a command expression containing a path with nested directories, e.g. ls /path/to/my/file
  2. Back the cursor up to an interior directory, e.g. by using cmd-left-arrow
  3. Select the directory and delete its name, e.g. by using shift-cmd-left-arrow, DEL, e.g. ls /path/<insert>/my/file
  4. Start typing a new name and notice autocomplete
  5. Select a directory from autocomplete and notice that the output now contains a repeated slash after the new directory's name, e.g. ls /path/foo//my/file
Expected behaviour

If the shell is smart enough to follow my path expressions, it's smart enough to figure out that I am naming an internal directory and that there's already a path separator there. It shouldn't put it in a second slash that is syntactically meaningless.

Screenshots

No response

Operating System

MacOS

OS Version

12.5.1

Shell Version

GNU bash, version 3.2.57(1)-release (arm64-apple-darwin21)

Warp Version

v0.2022.11.14.14.55.stable_01

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.