
Hi, does anybody else experienced the strange shellPrompt lockup after two consecutive dashes are entered ? 1) invoke XMonad.Prompt.Shell.shellPrompt with defaultXPConfig 2) type anywhere two dashes ("--") in Run: prompt 3) prompt stalls and stops responding Just asking if somebody can confirm so I may fill a bug report. xmonad-contrib ver. 0.9.2 David

On 16 August 2011 08:01, Dunric
Hi,
does anybody else experienced the strange shellPrompt lockup after two consecutive dashes are entered ?
1) invoke XMonad.Prompt.Shell.shellPrompt with defaultXPConfig 2) type anywhere two dashes ("--") in Run: prompt 3) prompt stalls and stops responding
Just asking if somebody can confirm so I may fill a bug report.
Yeah, I think I've had this for a while (this box doesn't have xmonad so I can't double-check). I believe it came about when some encoding bug was fixed or something... -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com

I'm running the darcs version and can't reproduce this. Entering any number of dashes doesn't seem to do anything on my machine. From that I would suspect that some post-0.9.2 patch must have fixed the issue. So in my opinion the right course of action would be to upgrade to a later xmonad version, not to file a bug report. Cheers, Norbert Ivan Lazar Miljenovic [2011.08.16 0838 +1000]:
On 16 August 2011 08:01, Dunric
wrote: Hi,
does anybody else experienced the strange shellPrompt lockup after two consecutive dashes are entered ?
1) invoke XMonad.Prompt.Shell.shellPrompt with defaultXPConfig 2) type anywhere two dashes ("--") in Run: prompt 3) prompt stalls and stops responding
Just asking if somebody can confirm so I may fill a bug report.
Yeah, I think I've had this for a while (this box doesn't have xmonad so I can't double-check). I believe it came about when some encoding bug was fixed or something...
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad

I can reproduce this issue even in darcs versions of xmonad & xmonad-contrib. I also can confirm it does depend on current locales. If UTF-8 locales are set, shellPrompt hangs 100% of times after two dashes are typed in. If running under a non-UTF-8 locales like LANG="en_US", LC_ALL="en_US", shellPrompt doesn't stop working. Bug could be fixed as a side-effect of Encoding task force (see http://code.google.com/p/xmonad/issues/detail?id=348 for details) David
I'm running the darcs version and can't reproduce this. Entering any number of dashes doesn't seem to do anything on my machine. From that I would suspect that some post-0.9.2 patch must have fixed the issue. So in my opinion the right course of action would be to upgrade to a later xmonad version, not to file a bug report.
Cheers, Norbert
Ivan Lazar Miljenovic [2011.08.16 0838 +1000]:
On 16 August 2011 08:01, Dunric
wrote: Hi,
does anybody else experienced the strange shellPrompt lockup after two consecutive dashes are entered ?
1) invoke XMonad.Prompt.Shell.shellPrompt with defaultXPConfig 2) type anywhere two dashes ("--") in Run: prompt 3) prompt stalls and stops responding
Just asking if somebody can confirm so I may fill a bug report. Yeah, I think I've had this for a while (this box doesn't have xmonad so I can't double-check). I believe it came about when some encoding bug was fixed or something...
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad
xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad

Hi, just took a peek into XMonad.Prompt.Shell source and found the cause of dysfunction. To get a list of possible command completions, shellPrompt makes use of bash internal function "compgen" but end of options mark (yes, it is the double-dash) is omitted. So if completion function is supplied with "--", bash call cannot finish because compgen expects another argument which never receives so it hangs. Patch for darcs version of xmonad-contrib (0.10): --- XMonad/Prompt/Shell.hs.orig 2011-08-18 10:26:24.816992530 +0200 +++ XMonad/Prompt/Shell.hs 2011-08-18 10:28:32.301992723 +0200 @@ -88,7 +88,7 @@ getShellCompl :: [String] -> String -> IO [String] getShellCompl cmds s | s == "" || last s == ' ' = return [] | otherwise = do - f <- fmap lines $ runProcessWithInput "bash" [] ("compgen -A file " ++ encodeString s ++ "\n") + f <- fmap lines $ runProcessWithInput "bash" [] ("compgen -A file --" ++ encodeString s ++ "\n") files <- case f of [x] -> do fs <- getFileStatus x if isDirectory fs then return [x ++ "/"] Take care David
I'm running the darcs version and can't reproduce this. Entering any number of dashes doesn't seem to do anything on my machine. From that I would suspect that some post-0.9.2 patch must have fixed the issue. So in my opinion the right course of action would be to upgrade to a later xmonad version, not to file a bug report.
Cheers, Norbert
Ivan Lazar Miljenovic [2011.08.16 0838 +1000]:
On 16 August 2011 08:01, Dunric
wrote: Hi,
does anybody else experienced the strange shellPrompt lockup after two consecutive dashes are entered ?
1) invoke XMonad.Prompt.Shell.shellPrompt with defaultXPConfig 2) type anywhere two dashes ("--") in Run: prompt 3) prompt stalls and stops responding
Just asking if somebody can confirm so I may fill a bug report. Yeah, I think I've had this for a while (this box doesn't have xmonad so I can't double-check). I believe it came about when some encoding bug was fixed or something...
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad
xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad

On Thu, Aug 18, 2011 at 11:02:51AM +0200, Dunric wrote:
Hi,
just took a peek into XMonad.Prompt.Shell source and found the cause of dysfunction. To get a list of possible command completions, shellPrompt makes use of bash internal function "compgen" but end of options mark (yes, it is the double-dash) is omitted. So if completion function is supplied with "--", bash call cannot finish because compgen expects another argument which never receives so it hangs.
+ f <- fmap lines $ runProcessWithInput "bash" [] ("compgen -A file --" ++ encodeString s ++ "\n")
Does there not need to be a space between the -- and the rest of the arguments? -Brent

On Thu, Aug 18, 2011 at 11:02:51AM +0200, Dunric wrote:
Hi,
just took a peek into XMonad.Prompt.Shell source and found the cause of dysfunction. To get a list of possible command completions, shellPrompt makes use of bash internal function "compgen" but end of options mark (yes, it is the double-dash) is omitted. So if completion function is supplied with "--", bash call cannot finish because compgen expects another argument which never receives so it hangs.
+ f<- fmap lines $ runProcessWithInput "bash" [] ("compgen -A file --" ++ encodeString s ++ "\n") Does there not need to be a space between the -- and the rest of the arguments?
-Brent
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad
Sure, there should be a space after a double-dash. For a completeness sake corrected diff follows: --- XMonad/Prompt/Shell.hs.orig 2011-08-18 10:26:24.816992530 +0200 +++ XMonad/Prompt/Shell.hs 2011-08-18 10:28:32.301992723 +0200 @@ -88,7 +88,7 @@ getShellCompl :: [String] -> String -> IO [String] getShellCompl cmds s | s == "" || last s == ' ' = return [] | otherwise = do - f <- fmap lines $ runProcessWithInput "bash" [] ("compgen -A file " ++ encodeString s ++ "\n") + f <- fmap lines $ runProcessWithInput "bash" [] ("compgen -A file -- " ++ encodeString s ++ "\n") files <- case f of [x] -> do fs <- getFileStatus x if isDirectory fs then return [x ++ "/"] Take care. David

Dunric [2011.08.18 1102 +0200]:
Hi,
just took a peek into XMonad.Prompt.Shell source and found the cause of dysfunction. To get a list of possible command completions, shellPrompt makes use of bash internal function "compgen" but end of options mark (yes, it is the double-dash) is omitted. So if completion function is supplied with "--", bash call cannot finish because compgen expects another argument which never receives so it hangs.
Nice you figured this out. What's odd to me is that this as the source of the issue should be completely independent of the locale, yet it seems that the problem arises only in utf8 locales. Any ideas why that might be? N.
participants (4)
-
Brent Yorgey
-
Dunric
-
Ivan Lazar Miljenovic
-
Norbert Zeh