PowerShell / PSReadLine

A bash inspired readline implementation for PowerShell
BSD 2-Clause "Simplified" License
3.77k stars 298 forks source link

Delete by word doesn't delete word boundary characters #4141

Open johnburnett opened 3 months ago

johnburnett commented 3 months ago

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