Delete by word doesn't delete word boundary characters

Open
#4,141 0 comments 0 reactions 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
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp, powershell
Domain
cli

Research direction

Reproduce the issue in PSReadLine using the command and Ctrl-W or Ctrl-Backspace sequences shown, then compare the resulting cursor states with bash. Trace the word-deletion behavior and determine whether completion should remove the associated quotes, dashes, and other boundary characters; done means the three states match the requested bash-like results.

Written by the indexing model from the issue text.

Description

Issue-Enhancement Needs-Triage :mag:
Summary of the new feature / enhancement

Say I have the following command written out (where "|" represents the cursor position):

foo --bar "ack"|

If I hit "ctrl-w" or "ctrl-backspace" three times, I'm left with the following sequence of results:

foo --bar "|
foo --|
|

...which in all three cases is not really what I'm looking for, which is "delete the last token of the command line along with the associated quotes, dashes, slashes, etc" (I'm not sure how to properly say this).

I'm comparing this to something like (say) bash, which gets me the following three states:

foo --bar |
foo |
|

...which is what I'm hoping to see (basically, leaving the command line in a state to start typing forward again without having to clean up detritus like the quotes, dashes, etc).

Is this something that's in pwsh's realm of responsibility?

Proposed technical implementation details (optional)

No response

Dominant language
C#
Stars
4.4k
Forks
341
PR merge metrics
No merged PRs in 30d

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 PowerShell/PSReadLine

All issues in PowerShell/PSReadLine

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.