codehenry / xmonad

Automatically exported from code.google.com/p/xmonad
0 stars 0 forks source link

XMonad.Prompt.Shell doesn't escape ampersands in tab completed file names. #300

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Open the XMonad.Prompt.Shell (using DefaultXPConfig but this may not be
necessary).
2. Use tab completion to enter a file name containing an ampersand.
3. Observe that the ampersand is not backslash escaped and thus the
filename is not processed correctly.

What is the expected output? What do you see instead?
The ampersand should be backslash escaped in the prompt but it is not.

What version of the product are you using? On what operating system?
xmonad 0.8 on 2.6.28-11-generic #42-Ubuntu (64bit) with xmonad-contrib-0.8

Are you using an xmonad.hs?  Please attach it and the output of "xmonad
--recompile".
Yes, see attached for xmonad.hs. xmonad --recompile produces no output so I
didn't attach it.

Please provide any additional information below.
I have also attached a patch that I think fixes this problem.

Original issue reported on code.google.com by harry%ha...@gtempaccount.com on 10 Jun 2009 at 11:11

Attachments:

GoogleCodeExporter commented 8 years ago
Just realised the patch file lacks context. This new one should work.

Original comment by harry%ha...@gtempaccount.com on 10 Jun 2009 at 11:27

Attachments:

GoogleCodeExporter commented 8 years ago
This is actually already fixed in darcs, I think.

Thu Mar 12 05:13:14 EDT 2009  Valery V. Vorotyntsev <valery.vv@gmail.com>
  * Prompt.Shell: escape ampersand

  Ampersand (&) is a special character and should be escaped.
    {
    hunk ./XMonad/Prompt/Shell.hs 121
    -escape (' ':xs) = "\\ " ++ escape xs
    hunk ./XMonad/Prompt/Shell.hs 126
    -isSpecialChar =  flip elem "\\@\"'#?$*()[]{};"
    +isSpecialChar =  flip elem " &\\@\"'#?$*()[]{};"
    }

Original comment by gwe...@gmail.com on 10 Jun 2009 at 12:21

GoogleCodeExporter commented 8 years ago

Original comment by SpencerJ...@gmail.com on 3 Nov 2009 at 10:39