shellPrompt exec with args

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

shellPrompt exec with args

Carsten Mattner-2
Do I have to configure anything special to use shellPrompt with extra args?
For example "xterm -e emacs -nw" won't start anything and I believe it's
because shellPrompt wants just a path or name of something in $PATH.


Reply | Threaded
Open this post in threaded view
|

shellPrompt exec with args

Brandon Allbery
On Fri, Feb 8, 2013 at 5:55 PM, Carsten Mattner <carstenmattner at gmail.com>wrote:

> Do I have to configure anything special to use shellPrompt with extra args?
> For example "xterm -e emacs -nw" won't start anything and I believe it's
> because shellPrompt wants just a path or name of something in $PATH.
>

I'm not exactly sure what you're asking, but shellPrompt uses "spawn" so
should not have issues with extra arguments.  I do see an issue where
completion would break if an executable has a space in its name, but that
shouldn't affect running it if you have your quoting correct.

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/xmonad/attachments/20130209/b0b6750f/attachment.htm>

Reply | Threaded
Open this post in threaded view
|

shellPrompt exec with args

Carsten Mattner-2
On Sat, Feb 9, 2013 at 3:10 PM, Brandon Allbery <allbery.b at gmail.com> wrote:

> On Fri, Feb 8, 2013 at 5:55 PM, Carsten Mattner <carstenmattner at gmail.com>
> wrote:
>>
>> Do I have to configure anything special to use shellPrompt with extra
>> args?
>> For example "xterm -e emacs -nw" won't start anything and I believe it's
>> because shellPrompt wants just a path or name of something in $PATH.
>
>
> I'm not exactly sure what you're asking, but shellPrompt uses "spawn" so
> should not have issues with extra arguments.  I do see an issue where
> completion would break if an executable has a space in its name, but that
> shouldn't affect running it if you have your quoting correct.

Unsuccessfully tried the following
"xterm -e mc"
"/usr/bin/xterm -e mc"
'xterm -e mc'
'/usr/bin/xterm -e mc'


Reply | Threaded
Open this post in threaded view
|

shellPrompt exec with args

Brandon Allbery
On Sat, Feb 9, 2013 at 11:27 AM, Carsten Mattner
<carstenmattner at gmail.com>wrote:

> > I'm not exactly sure what you're asking, but shellPrompt uses "spawn" so
> > should not have issues with extra arguments.  I do see an issue where
> > completion would break if an executable has a space in its name, but that
> > shouldn't affect running it if you have your quoting correct.
>
> Unsuccessfully tried the following
> "xterm -e mc"
> "/usr/bin/xterm -e mc"
> 'xterm -e mc'
> '/usr/bin/xterm -e mc'
>

That wasn't what I was talking about, and you should probably forget I
mentioned it since you're only likely to see the case I was talking about
on OS X.  All of the above *will* fail:  there is no executable called
"/usr/bin/xterm -e mc" with spaces in the actual filename, hopefully.

Could you show your actual code?

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/xmonad/attachments/20130209/cd6e1cbf/attachment.htm>

Reply | Threaded
Open this post in threaded view
|

shellPrompt exec with args

Carsten Mattner-2
On Sat, Feb 9, 2013 at 6:38 PM, Brandon Allbery <allbery.b at gmail.com> wrote:

> On Sat, Feb 9, 2013 at 11:27 AM, Carsten Mattner <carstenmattner at gmail.com>
> wrote:
>>
>> > I'm not exactly sure what you're asking, but shellPrompt uses "spawn" so
>> > should not have issues with extra arguments.  I do see an issue where
>> > completion would break if an executable has a space in its name, but
>> > that
>> > shouldn't affect running it if you have your quoting correct.
>>
>> Unsuccessfully tried the following
>> "xterm -e mc"
>> "/usr/bin/xterm -e mc"
>> 'xterm -e mc'
>> '/usr/bin/xterm -e mc'
>
>
> That wasn't what I was talking about, and you should probably forget I
> mentioned it since you're only likely to see the case I was talking about on
> OS X.  All of the above *will* fail:  there is no executable called
> "/usr/bin/xterm -e mc" with spaces in the actual filename, hopefully.
>
> Could you show your actual code?

-- shellPrompt is bound to Mod1-p
((defModMask, xK_p), shellPrompt myXPConfig)

-- and uses
myXPConfig = defaultXPConfig
    { position = Top
    , promptBorderWidth = 0
    , defaultText = ""
    , alwaysHighlight = True
    }


Reply | Threaded
Open this post in threaded view
|

shellPrompt exec with args

Carlos López Camey
2013/2/9 Carsten Mattner <carstenmattner at gmail.com>:

> On Sat, Feb 9, 2013 at 6:38 PM, Brandon Allbery <allbery.b at gmail.com> wrote:
>> On Sat, Feb 9, 2013 at 11:27 AM, Carsten Mattner <carstenmattner at gmail.com>
>> wrote:
>>>
>>> > I'm not exactly sure what you're asking, but shellPrompt uses "spawn" so
>>> > should not have issues with extra arguments.  I do see an issue where
>>> > completion would break if an executable has a space in its name, but
>>> > that
>>> > shouldn't affect running it if you have your quoting correct.
>>>
>>> Unsuccessfully tried the following
>>> "xterm -e mc"
>>> "/usr/bin/xterm -e mc"
>>> 'xterm -e mc'
>>> '/usr/bin/xterm -e mc'
>>
>>
>> That wasn't what I was talking about, and you should probably forget I
>> mentioned it since you're only likely to see the case I was talking about on
>> OS X.  All of the above *will* fail:  there is no executable called
>> "/usr/bin/xterm -e mc" with spaces in the actual filename, hopefully.
>>
>> Could you show your actual code?
>
> -- shellPrompt is bound to Mod1-p
> ((defModMask, xK_p), shellPrompt myXPConfig)
>
> -- and uses
> myXPConfig = defaultXPConfig
>     { position = Top
>     , promptBorderWidth = 0
>     , defaultText = ""
>     , alwaysHighlight = True
>     }
>
>

Hello Carsten,

I think the above doesn't work because the argument sent to spawn
comes from the list of completions when alwaysHighlight is True (lines
368-371 in Prompt.hs).

There is rationale behind this behaviour.  Suppose I'm looking for the
function filter on hoogle mode, then I don't need to type the whole
word "filter" to select an autocompletion in order to execute the
action on it.

This can be fixed by choosing what's on the command if there is no
available completions and I hope I can get a patch for you/that soon.

Best,

Carlos


Reply | Threaded
Open this post in threaded view
|

shellPrompt exec with args

Carsten Mattner-2
On Sat, Feb 9, 2013 at 7:00 PM, Carlos L?pez Camey <c.lopez at kmels.net> wrote:

> 2013/2/9 Carsten Mattner <carstenmattner at gmail.com>:
>> On Sat, Feb 9, 2013 at 6:38 PM, Brandon Allbery <allbery.b at gmail.com> wrote:
>>> On Sat, Feb 9, 2013 at 11:27 AM, Carsten Mattner <carstenmattner at gmail.com>
>>> wrote:
>>>>
>>>> > I'm not exactly sure what you're asking, but shellPrompt uses "spawn" so
>>>> > should not have issues with extra arguments.  I do see an issue where
>>>> > completion would break if an executable has a space in its name, but
>>>> > that
>>>> > shouldn't affect running it if you have your quoting correct.
>>>>
>>>> Unsuccessfully tried the following
>>>> "xterm -e mc"
>>>> "/usr/bin/xterm -e mc"
>>>> 'xterm -e mc'
>>>> '/usr/bin/xterm -e mc'
>>>
>>>
>>> That wasn't what I was talking about, and you should probably forget I
>>> mentioned it since you're only likely to see the case I was talking about on
>>> OS X.  All of the above *will* fail:  there is no executable called
>>> "/usr/bin/xterm -e mc" with spaces in the actual filename, hopefully.
>>>
>>> Could you show your actual code?
>>
>> -- shellPrompt is bound to Mod1-p
>> ((defModMask, xK_p), shellPrompt myXPConfig)
>>
>> -- and uses
>> myXPConfig = defaultXPConfig
>>     { position = Top
>>     , promptBorderWidth = 0
>>     , defaultText = ""
>>     , alwaysHighlight = True
>>     }
>>
>>
>
> Hello Carsten,
>
> I think the above doesn't work because the argument sent to spawn
> comes from the list of completions when alwaysHighlight is True (lines
> 368-371 in Prompt.hs).
>
> There is rationale behind this behaviour.  Suppose I'm looking for the
> function filter on hoogle mode, then I don't need to type the whole
> word "filter" to select an autocompletion in order to execute the
> action on it.
>
> This can be fixed by choosing what's on the command if there is no
> available completions and I hope I can get a patch for you/that soon.

Thanks.