[IPython-dev] cd a little hyper
Fri Jun 6 00:05:05 CDT 2008
On Thu, Jun 5, 2008 at 11:41 PM, Ville M. Vainio <email@example.com> wrote:
> On Fri, Jun 6, 2008 at 1:30 AM, John Hunter <firstname.lastname@example.org> wrote:
>> To due a readline bug on solaris, cd ~/somedTAB used to insert extra
>> white space after completing directories, which was a major headache
>> when navigating deeply nested directories since I had to backspace
>> after every directory completion. Using the latest ipython rom bzr,
>> this appears to be fixed. I don't know how it was fixed, but it is
>> great. (thanks).
> Yes, I fixed that by introducing the pseudo-annoying behaviour you
> mention (I noticed the same thing on linux + scratchbox). It's the
> single_dir_expand call in ipy_completers.py (cd completer)
> Perhaps we should "special case" the .svn / dot-something thing.
Oh, I see. I initially thought I wasn't seeing it on bic (fernando's
linux machine on which I have an acct) because I wasn't using a recent
bzr ipython there. After I did an update to::
> bzr branch lp:ipython
I see the same behavior as I described on my work machine.
I don't think this is the behavior you want. *Certainly* you do not
want to be completing on hidden dirs unless a user has explicitly
requested to do so in your rc file (regardless of whether it is a
".svn" hidden dir). But I don't think you want to (by default)
complete on single dirs either, at least not if other nondir files are
Eg, if as in the original post, I have something like::
In : !mkdir -p somedir/subdir1
In : !touch somedir/file1
In : !touch somedir/file2
In : cd somedi<TAB>
we do not want to go to somedir/subdir1 by default (unless it is an rc
choice) because somedir is a perfectly reasonable place to go. On
the bzr HEAD (what do you call HEAD in bzr?) I am being taken to
In : cd some<TAB>
takes me to::
In : cd somedir/subdir1
Now in the case of somedir containing only a *single* non-hidden dir
and *no* plain files, I think the current hyper-completion is a
feature. But if there are files and/or dirs in the target dir, I
don't think you want to assume a subdir for completion.
But many thanks for fixing my trailing space completion bug, however you did it.
More information about the IPython-dev