[Xmonad] i18n for XPrompt
droundy at darcs.net
Fri Sep 14 09:57:25 EDT 2007
On Fri, Sep 14, 2007 at 02:23:52PM +0200, Andrea Rossato wrote:
> On Fri, Sep 14, 2007 at 12:15:03AM -0400, Xiao-Yong Jin wrote:
> > Finally, one not related to the new patch is that some
> > special characters, like spaces or quotes, in the path name
> > are not properly escaped, which in turn makes the path name
> > completion useless, when such characters are in the path.
> > It completes, but apparently the completion doesn't work
> > properly.
> I'm a bit puzzled about escaping spaces, actually. Now the string in
> the prompt is broken down to words in order to use the last one for
> finding new completions: this is what makes it possible to complete a
> command and then complete a file path. How can I tell which space must
> be escaped and which is not to be escaped?
> I think we should just replicate the behavior of a command line: you
> must manually escape characters, and I must take that into account when
> splitting the string.
> Am I right? What do you think?
Agreed (about replicating behavior of command line), but this means you
*don't* need to manually escape spaces. Try:
date > hello\ world
cat hel[HIT TAB THEN ENTER HERE]
As you'll see, bash expands the 'hel as 'hello\ world', and you correctly
cat the file.
Note: I haven't looked carefully at the ShellPrompt module, but I wonder
if it could call bash to do the completions, like DirectoryPrompt does
(which does properly handle directories with spaces in them).
Unfortunately, it seems to be hard to get the full power of the bash
programmable completions framework out of bash, which seems a poor design
to me. :(
Department of Physics
Oregon State University
More information about the Xmonad