marlonrichert / zsh-hist

📝 Edit your Zsh history from the command line.
MIT License
148 stars 13 forks source link

Regex `\b` replaced with `^H` in multi-line command #20

Closed owst closed 1 year ago

owst commented 1 year ago

Describe the bug

When I type out a multi-line command involving a regex \b character, the expansion replaces \b with ^H.

Steps To Reproduce

N.b. paste the first line first, then the remaining lines (to simulate typing out the command interactively).

for f in $(grep -l '\bfoo\b' *); do
  echo "foo found in $f"
done

after pressing enter after done the prompt displays

for f in $(grep -l '^Hfoo^H' *)
do
        echo "foo found in $f"
done

Expected behavior

\b to be unchanged

Observed behavior

\b was replaced with ^H (which breaks the grep pattern)

Environment:

owst commented 1 year ago

Thanks @marlonrichert 👍

marlonrichert commented 1 year ago

No problem! 🙂

PS: If you enjoy using my software, please consider sponsoring me. 💝