git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Handle path completion and colon for tcsh script

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 3, 2013, 20:43 UTC
Message-ID
<7vhalt86wj.fsf@alter.siamese.dyndns.org>
In-Reply-To
<510EC1A4.4000207@gmail.com>
Manlio Perillo <manlio.perillo@gmail.com> writes:
Show 6 quoted lines
> The problem is that when using the "new"
> `compopt -o filenames` command, Bash assumes COMPREPLY contains a list
> of filenames, and when it detects a directory name, it adds a slash.
>
> The problem is, if the directory name *already* has a slash, Bash adds
> another slash!

So bash users do see the trailing slash because bash adds one to what we compute and return, which we do strip the trailing slash exactly because we know bash will add one. Because tcsh completion uses what we compute directly, without bash massaging our output to add the trailing slash, it needs some magic.

OK, that makes sense. It was this part from the originally proposed log message:

>> ... Such completions do not add the '/' at the end of directories
>> for recent versions of bash.  However, the '/' is needed by tcsh,
>> ...

with a large gap between the two sentences that fooled me, and the explanation in your message helped to fill the gap to understand the situation better.

Perhaps
	... for recent versions of bash, which will then add the
	trailing slash for paths that are directory to the result of
	our completion.  The completion for tcsh however uses the
	result of our completion directly, so it either needs to add
	the necessary slash itself, or needs to ask us to keep the
	trailiing slash.  This patch does the latter.
or something?
Previous: Manlio PerilloNext: Marc Khouzam
Message 4 of 6 in “Handle path completion and colon for tcsh script”
  1. Handle path completion and colon for tcsh scriptMarc Khouzam, Feb 2, 2013
  2. Junio C HamanoFeb 2, 2013
  3. Manlio PerilloFeb 3, 2013
  4. Junio C HamanoFeb 3, 2013
  5. Marc KhouzamFeb 4, 2013
  6. Junio C HamanoFeb 4, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.