bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Readline : move to previous/next path component


From: Andre Majorel
Subject: Re: Readline : move to previous/next path component
Date: Wed, 15 Oct 2008 21:03:55 +0000 (UTC)
User-agent: slrn/pre0.9.9-97 (Debian)

On 2008-10-15, Chet Ramey <address@hidden> wrote:
>> On 2008-10-15, Chet Ramey <address@hidden> wrote:
>> > Andre Majorel wrote:
>> >> One frequently needed function that readline does not seem to
>> >> have is a way to move to the beginning of the next or previous
>> >> path component.
>> >
>> > Readline doesn't have any built-in knowledge of Unix pathnames.
>> 
>> For my edification, is the relative lack of Unix/shell support
>> due to
>> 1. "can of worms",
>> 2. "readline is supposed to be general",
>> 3. "there is no need for it" ?
>
> Mostly the second one, mixed with the fact that nobody's requested
> this particular feature before.  Readline is very extensible; bash
> adds quite a lot to the basic framework -- look at all the code in
> bashline.c.

OK. Unfortunately, the hackability appears to be at the source
level, not at the .inputrc level. For most Bash users,
maintaining your own binaries is inconvenient.

> If you'd like to take a crack at writing a bindable readline
> command to do what you want, I'd certainly look at it for a
> future version.  (You'll probably get to it before I would.)

I think the thing I've missed the most in readline, besides an
understanding of Unix pathnames, is an understanding of shell
quoting. Sometimes I'd like to be able to delete or move over
A\ Very\ Long\ Directory\ Name/A\ Very\ Long \ File\ Name or
'Another file name that'\''s got inverted commas in it' in one
operation.

character-search and character-search-backward sometimes help
but they're bound to ^] which cannot be entered at the Linux
console on an AZERTY keyboard.

Vi mode would help, but in Bash, there's no way to switch
between it and Emacs mode on the fly.

No time to look into it at the moment, but sooner or later,
frustration will win...

-- 
André Majorel <URL:http://www.teaser.fr/~amajorel/>
You measure democracy by the freedom it gives its dissidents, not
the freedom it gives its assimilated conformists -- Abbie Hoffman.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]