shellPrompt kills xmonad

Hi, I've got an issue with the shellPrompt extension here. Everytime I'm entering some keys in the shellPrompt xmonad crashes. Sometimes it crashes after the first pressed key (e.g. 'a') and sometimes after the second key (e.g. 'c' than arbritrary letter). However it does not crash, if I open the shellPrompt and exit it by hitting ESC. I only notice this behaviour on NixOS. The same config is working on debian etch without crashing.

On Fri, Oct 26, 2007 at 08:53:15PM +0200, Tobias Hammerschmidt wrote:
Hi,
I've got an issue with the shellPrompt extension here. Everytime I'm entering some keys in the shellPrompt xmonad crashes. Sometimes it crashes after the first pressed key (e.g. 'a') and sometimes after the second key (e.g. 'c' than arbritrary letter). However it does not crash, if I open the shellPrompt and exit it by hitting ESC. I only notice this behaviour on NixOS. The same config is working on debian etch without crashing.
this was due to the fact the ShellPrompt expected to find bash in /bin. I pushed a patch so that we will now just run "bash" hoping to find it in the PATH. I think that XMonandContrib.Run that should be exporting safe functions. Andrea

Andrea Rossato schrieb:
On Fri, Oct 26, 2007 at 08:53:15PM +0200, Tobias Hammerschmidt wrote:
Hi,
I've got an issue with the shellPrompt extension here. Everytime I'm entering some keys in the shellPrompt xmonad crashes. Sometimes it crashes after the first pressed key (e.g. 'a') and sometimes after the second key (e.g. 'c' than arbritrary letter). However it does not crash, if I open the shellPrompt and exit it by hitting ESC. I only notice this behaviour on NixOS. The same config is working on debian etch without crashing.
this was due to the fact the ShellPrompt expected to find bash in /bin.
I pushed a patch so that we will now just run "bash" hoping to find it in the PATH.
I think that XMonandContrib.Run that should be exporting safe functions.
Andrea
_______________________________________________ Xmonad mailing list Xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad
This patch works for me. Thank you!

On Fri, Oct 26, 2007 at 11:37:20PM +0200, Andrea Rossato wrote:
On Fri, Oct 26, 2007 at 08:53:15PM +0200, Tobias Hammerschmidt wrote:
Hi,
I've got an issue with the shellPrompt extension here. Everytime I'm entering some keys in the shellPrompt xmonad crashes. Sometimes it crashes after the first pressed key (e.g. 'a') and sometimes after the second key (e.g. 'c' than arbritrary letter). However it does not crash, if I open the shellPrompt and exit it by hitting ESC. I only notice this behaviour on NixOS. The same config is working on debian etch without crashing.
this was due to the fact the ShellPrompt expected to find bash in /bin.
I pushed a patch so that we will now just run "bash" hoping to find it in the PATH.
I think that XMonandContrib.Run that should be exporting safe functions.
Would it possibly be better to call /bin/sh instead, since that can fairly reliably be found on Unix systems, whereas bash is only common on GNU/Linux? Alternatively, look for a few (bash, zsh, ksh, sh, possibly others) and run one. Or use the user's $SHELL setting. -- Benjamin A'Lee :: bma@subvert.org.uk http://subvert.org.uk/~bma/ "All great truths begin as blasphemies." - George Bernard Shaw

On Fri, Oct 26, 2007 at 11:01:31PM +0100, Benjamin M. A'Lee wrote:
Would it possibly be better to call /bin/sh instead, since that can fairly reliably be found on Unix systems, whereas bash is only common on GNU/Linux? Alternatively, look for a few (bash, zsh, ksh, sh, possibly others) and run one. Or use the user's $SHELL setting.
Now we relay on bash's compgen to get completions. So we are not just looking for a shell. I think this is a less burdensome requirement than the readline library, after all. Andrea

On Sat, Oct 27, 2007 at 12:18:23AM +0200, Andrea Rossato wrote:
On Fri, Oct 26, 2007 at 11:01:31PM +0100, Benjamin M. A'Lee wrote:
Would it possibly be better to call /bin/sh instead, since that can fairly reliably be found on Unix systems, whereas bash is only common on GNU/Linux? Alternatively, look for a few (bash, zsh, ksh, sh, possibly others) and run one. Or use the user's $SHELL setting.
Now we relay on bash's compgen to get completions. So we are not just looking for a shell.
I think this is a less burdensome requirement than the readline library, after all.
Why would it be? Bash absolutely requires readline (and includes a copy, but that's not relevent since you still need a readline-capable system). Stefan

On Fri, Oct 26, 2007 at 03:56:13PM -0700, Stefan O'Rear wrote:
On Sat, Oct 27, 2007 at 12:18:23AM +0200, Andrea Rossato wrote:
I think this is a less burdensome requirement than the readline library, after all.
Why would it be? Bash absolutely requires readline (and includes a copy, but that's not relevent since you still need a readline-capable system).
What I meant is that using directly a readline function requires modifying the xmonad.cabal file (we used to do that). This is more burdensome for the user. Moreover, since a modification of the cabal file is required, the module cannot be inserted in MetaModule and thus automatically checked. Andrea

On Oct 26, 2007, at 19:12 , Andrea Rossato wrote:
On Fri, Oct 26, 2007 at 03:56:13PM -0700, Stefan O'Rear wrote:
On Sat, Oct 27, 2007 at 12:18:23AM +0200, Andrea Rossato wrote:
I think this is a less burdensome requirement than the readline library, after all.
Why would it be? Bash absolutely requires readline (and includes a copy, but that's not relevent since you still need a readline-capable system).
What I meant is that using directly a readline function requires modifying the xmonad.cabal file (we used to do that). This is more burdensome for the user.
But otherwise you have a dependency on bash which can't be checked by Cabal. Note that e.g. the BSDs don't install bash by default. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

allbery:
On Oct 26, 2007, at 19:12 , Andrea Rossato wrote:
On Fri, Oct 26, 2007 at 03:56:13PM -0700, Stefan O'Rear wrote:
On Sat, Oct 27, 2007 at 12:18:23AM +0200, Andrea Rossato wrote:
I think this is a less burdensome requirement than the readline library, after all.
Why would it be? Bash absolutely requires readline (and includes a copy, but that's not relevent since you still need a readline-capable system).
What I meant is that using directly a readline function requires modifying the xmonad.cabal file (we used to do that). This is more burdensome for the user.
But otherwise you have a dependency on bash which can't be checked by Cabal. Note that e.g. the BSDs don't install bash by default.
Yes, this is my concern too -- I don't have bash either. So perhaps it should be called BashPrompt.hs or some such -- at least the dependency has to be made very clear.

On Fri, Oct 26, 2007 at 09:10:48PM -0400, Brandon S. Allbery KF8NH wrote:
But otherwise you have a dependency on bash which can't be checked by Cabal. Note that e.g. the BSDs don't install bash by default.
Well, strictly speaking bash is not a requirement. Since I would expect Run.runProcessWithInput to return an empty string in case of failure (there was a discussion about that some time ago: someone wanted it to return a Maybe String), ShellPrompt uses bash to get directory completion, but if bash is not present ShellPrompt should just be working with command completions and without directory completions. That is to say, ShellPrompt was expected to work even without bash. Which means it does not depend on it. This is why I still think that ShellPrompt is an appropriate name, since the prompt is executing shell commands. If you want to have directory completion (a plus), well, get a bash shell in your path. Andrea
participants (7)
-
Andrea Rossato
-
Benjamin M. A'Lee
-
Brandon S. Allbery KF8NH
-
Devin Mullins
-
Don Stewart
-
Stefan O'Rear
-
Tobias Hammerschmidt