The interesting thing is, as of 3.1.2 and 3.1.3, cygwin ncftp uses the readline library for terminal handling -- just like bash does. Prior to 3.1.2, cygwin ncftp used the home-grown termhandling stuff internal to the ncftp codebase. You'd think that would be an improvement -- and that it would work the same as bash.
The way readline works, you call rl_completion_matches() and it returns a different match each time you call it -- internally, it calls a custom 'completion generator function' whose address you store in the function pointer rl_completion_entry_function (if NULL, readline uses a default file iterator). Perhaps the completion generator function that ncftp stores in rl_completion_entry_function is buggy? Anyway, as of yesterday I'm not maintaining ncftp anymore -- Hack Kampbjørn has agreed to take over. However, I'm not going anywhere -- and this IS a community project... all together now: patches gratefully accepted. :-) --Chuck Alan Dobkin wrote: > Charles, > > Thanks for taking the time to respond to this issue, > but it seems you may have missed my original message > (which was attached to the one you responded to and > is also included below). I am aware that quotes can > be used as a workaround to this problem - but IMO, > The Right Thing To Do is to have the quotes inserted > automatically. This is also not a matter of Unix vs. > Windows behavior, as both Unix and Windows properly > deal with spaces in file names during tab completion. > > In Windows 2000 (with tab completion enabled in cmd): > > C:\>cd prog<TAB> --> > C:\>cd "Program Files" > > In bash (using Cygwin or RedHat Linux): > > $ cd /cygdrive/C/Prog<TAB> --> > $ cd /cygdrive/C/Program\ Files/ > > Now, regarding the new bug I was reporting specifically > in the Cygwin version of NcFTP, you can reproduce it by > creating a bookmark list containing *only* the two I > mentioned, i.e. "RedHat Linux" and "RedHat Updates", or > any other bookmarks that begin with the same word. The > reason your scenario didn't duplicate the bug is because > you had a third bookmark that started differently. > > Incidentally, backslash can't be used to escape the space > either as it works in bash. It has to be enclosed in quotes. > > Using spaces in bookmarks may be silly, but I'm sure I'm > not the first person to try it and expect it to work, > since spaces are valid characters in most filesystems as > file names and are permitted as bookmark names in NcFTP. > > Thanks, > Alan > > --On Tuesday, April 02, 2002 9:09 PM -0500 Charles Wilson > <[EMAIL PROTECTED]> wrote: > > >>I can't reproduce this the way you see it. OTOH, I understand >>your problem, and the short answer is: use " character. >> >>ncftp> open "R<tab> U<tab> >> >>should do what you want. >> >>On cygwin, using rxvt (TERM=rxvt) or dosbox (TERM=cygwin), I get: >> >>ncftp> open <TAB> >>neuro rcn >>ncftp> open >> >>two tabs, and I get >> >>ncftp> open <TAB> <TAB> >>neuro rcn >>ncftp> open (e.g. the second tab is interpreted here) >>neuro rcn >>ncftp> open >> >>likewise, when I do something as (IMO) silly as having multi-word >>bookmark names, in both environments I get >> >>ncftp> open <TAB> >>neuro one neuro two rcn (lists all three bkmks) >>ncftp> open n<TAB> >>neuro one neuro two (lists two bookmarks, autocompletes 'euro ' >>ncftp> open neuro<TAB> >>neuro one neuro two rcn (thinks that 'open neuro ' is two words, and >> tries to autocomplete an entirely new >> word -- so it re-lists all three bkmks) >> >>If I try to help, by typing the 'o' for 'neuro one', it doesn't help -- >>it tries to match on words beginning with 'o' and since I have no bkmks >>that begin with 'o' -- no match. >> >>ncftp> open neuro o<TAB> >>ncftp> open neuro o >> >>This is The Right Thing To Do, IMO. Very unixy. Now, if I do THIS: >> >>ncftp> open "neuro <TAB> >>neuro one neuro two >> >>Then, I help by adding an 'o': >> >>ncftp> open "neuro o<TAB> (it autocompletes! 'ne"') >> >>ncftp> open "neuro one" >> >>Again, The Right Thing To Do. Remember, cygwin ain't windows. >> >>--Chuck >> >>Alan Dobkin wrote: >> >> >>>I am resending the attached request as it still applies >>>to NcFTP 3.1.3. I am copying the Cygwin list, because >>>I've noticed a related bug in the current Cygwin version. >>> >>>Consider an example with only the following two bookmarks: >>> >>>RedHat Linux --> FTP.RedHat.Com >>>RedHat Updates --> Updates.RedHat.Com >>> >>>With the non-Cygwin Win32 version, tab completion >>>displays the bookmark list with only the second words: >>> >>>ncftp> open <TAB><TAB> >>> Linux Updates >>> >>>However, with the Cygwin version, tab completion repeats >>>the first word each time without displaying the list: >>> >>>ncftp> open <TAB> >>>ncftp> open RedHat <TAB> >>>ncftp> open RedHat RedHat <TAB> >>>ncftp> open RedHat RedHat RedHat <TAB> >>> >>>Unfortunately, I am not able to contribute any patches >>>myself, but hopefully this will not be a difficult fix >>>for someone who is already familiar with the source code. >>> >>>Thanks, >>>Alan >>> >>> >>>------------------------------------------------------------------------ >>> >>>Subject: >>> >>>NcFTP Feature Request for "getline" >>>From: >>> >>>Alan Dobkin <[EMAIL PROTECTED]> >>>Date: >>> >>>Sun, 04 Nov 2001 20:14:09 -0500 >>>To: >>> >>>NcFTP <[EMAIL PROTECTED]> >>> >>> >>>Please consider the following enhancement to "getline" tab >>>completion. When using the open command with tab to list >>>the matching bookmarks, getline should enclose the string >>>in quotes if it contains spaces. Consider this example: >>> >>>ncftp> open <TAB>RedHat Linux >>>Resolving RedHat... >>> >>>Unknown host "RedHat". >>>ncftp> open "RedHat Linux" (quotes inserted manually) >>>Resolving FTP.RedHat.Com... >>>Connecting to 63.240.14.63... >>> >>>Red Hat FTP server ready. All transfers are logged. >>>Logging in... >>> >>>Login successful. Have fun. >>> >>>Automatically inserting quotes like this appears to be >>>standard behavior in most UNIX shells and Windows 2000. >>> >>>Thanks, >>>Alan >>> -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/