> On 10/17/11 3:07 PM, Michael Kalisz wrote: > > Hi Chet, > > > > The shopt "direxpand" feature works as advertised (Thanks!) except that I > > noticed it seems to break the name-completion of executables which are not > > in you path. > > Yes, it expands the directory name. In this case, it expands `.' to $PWD, > and the differing prefixes make the names not match. I'll have to see > what I can do about that. It might be a nasty fix, since the same function > has to make sure that `.' does expand to $PWD to honor the shell's logical > view of the file system. I'm not sure what negative consequences dropping > that rewrite might bring.
I found the easy way out and took it. Try the attached patch and see if it fixes the problem for you. It does for my testing. Chet
*** ../bash-4.2-direxpand/bashline.c 2011-11-23 17:11:31.000000000 -0500 --- bashline.c 2011-11-05 18:46:35.000000000 -0400 *************** *** 1292,1295 **** --- 1339,1343 ---- rl_filename_quote_characters = default_filename_quote_characters; + set_directory_hook (); /* Determine if this could be a command word. It is if it appears at *************** *** 1605,1608 **** --- 1672,1681 ---- else { + if (dircomplete_expand && dot_or_dotdot (filename_hint)) + { + dircomplete_expand = 0; + set_directory_hook (); + dircomplete_expand = 1; + } mapping_over = 4; goto inner; *************** *** 1805,1808 **** --- 1878,1884 ---- inner: val = rl_filename_completion_function (filename_hint, istate); + if (mapping_over == 4 && dircomplete_expand) + set_directory_hook (); + istate = 1;
``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/