thefuck icon indicating copy to clipboard operation
thefuck copied to clipboard

Doesn't handle quotes and arguments with spaces well

Open admirabilis opened this issue 6 years ago • 3 comments

v3.24 using Python 3.5.3, on Ubuntu 17.04, GNU bash 4.4.7(1)-release.

Using an alias, but with no alias is indifferent:

$ theheck "catt 'My File'"
cat My File [enter/↑/↓/ctrl+c]

$ theheck "catt My\ File"
cat My File [enter/↑/↓/ctrl+c]

$ theheck "ehco -e '\n'"
echo -e \n [enter/↑/↓/ctrl+c]

$ theheck "ehco -n $'\n'"
echo -n $\n [enter/↑/↓/ctrl+c]

The debug output is here: https://pastebin.com/GjXPpQbs

admirabilis avatar Oct 27 '17 19:10 admirabilis

For what it's worth, we had previously tried using a more robust bash parser, but we stopped after discovering potential licensing issues. See here for details: https://github.com/nvbn/thefuck/issues/589

josephfrazier avatar Nov 06 '17 18:11 josephfrazier

Ugh, that's really sad, but thanks for pointing that out. BTW, by looking at #589, I noticed my examples were unquoted, so I fixed them.

admirabilis avatar Nov 07 '17 03:11 admirabilis

This is also impactful when the change results in different output from the command, so it doesn't trigger a rule that it should trigger. I have a rule that looks for a particular error message, and command "/some path with spaces/" produces the error message and triggers the rule but command /some path with spaces/ does not.

sparr avatar Sep 29 '21 19:09 sparr