Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 47059 - app-shells/tcsh: ignorant co[mpress] completion
Summary: app-shells/tcsh: ignorant co[mpress] completion
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Fabian Groffen
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-07 03:55 UTC by Evgeny Stambulchik
Modified: 2005-09-30 12:38 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Evgeny Stambulchik 2004-04-07 03:55:30 UTC
/etc/profile.d/tcsh-complete, installed AND activated by default in gentoo, is, apparently, an example taken from the tcsh distro which was hardly supposed to be used as is. E.g., the annoying thing I noticed today is the ambiguous completion statement:

complete -co*      p/0/"(compress)"/

(with the bold comment "make compress completion not ambiguous"), which results in shadowing any other commands beginning with "co".


Reproducible: Always
Steps to Reproduce:
1. Type "co" at the prompt
2. Press [Tab]

Actual Results:  
> compress 

Expected Results:  
> co
col                 column              composite           convcal
colcrt              comm                compress            convert
collateindex.pl     compile_et          conglomerate        
colorize            complete            conjure             
colrm               complete-ant-cmd.pl continue            


In general, the situation with tcsh in Gentoo is pathetic (see e.g. bugs #17852,
#35434). It may be a result of the credo "move all to the paradise of bash with
the mighty hand" by some of developers - which could be discussed but is hardly
worth to be implemented this way.
Comment 1 Nick Hadaway 2004-06-07 21:47:31 UTC
I have made this change.  Are there any other change you think would be sensible to make?  Please be specific.
Comment 2 Evgeny Stambulchik 2004-06-07 23:01:27 UTC
Well, there are a few other issues with tcsh-complete. E.g. $hosts defaults to a list of US universities (and parsing of .ssh/known_hosts is wrong, as it presents a list of "host,ip" entries among others), `gs' has a pretty short list of possible devices (and part of them not compiled in usually) etc etc. I suggest to limit the contents of the file to a list of _really_ sensible and _safe_ completions, e.g. `cd' expands its args to directories only, and the rest be sourced optionally at user's will.
BTW, a dangerous completion logic is enabled for `rm'. It's "smart" to not suggest removing .[c,h] and some other source files. Now a real-life experience: a user wanted to clean his work directory, typed "rm -f [TAB]", saw some .o junk and nothing important, added "*" and pressed [Enter]... Luckily, everything was backed up, but others might be less happy...
Comment 3 Markus Baumeister 2004-11-02 12:54:06 UTC
A few more changes for /etc/profile.d/tcsh-settings:

set correct=cmd
unset autocorrect
set complete

The current setting of 'correct=all' and 'complete=enhaced' leads to all kinds funny effects, which quickly become less funny when you actually try to work. E.g.:

Try to complete 'mail':
---- snip ----
/home/baumeist> mai [TAB]
Mail         Mail/        MailArchive/ mail         mail-files   mailmail     mailq        mailshar     mailx
/home/baumeist> Mail
--- snip ----
(Requires to have a 'Mail' directory in $HOME)
Note that you end up with a capital 'M' which forces you to go back to the first letter, remove it and replace it with a small 'm'.

Also nice is 'sudo':
----- snip -----
/home/baumeist> sudo emerge --search foo [RET]

CORRECT>sudo .merge --search foo (y|n|e|a)?
----- snip -----
(Requires to have a '.merge' directory in $HOME)

With the current settings tcsh autocompletion and correction is no longer an advantage but an annoyance. Default settings should follow the principle of least surprise for new users (unless the intention is indeed to drive everyone to bash).
 
In addition - as mentioned above - /etc/profile.d/tcsh-completion should be seriously trimmed down. Otherwise it becomes a maintenance nightmare. Does anyone really intend to administer entries like 'complete gcc' where each new gcc option would require a change to its entry? Alas, I have no better version handy.

BTW, The bug mentioned in the start of this thread still exists. co [TAB] expands to only 'compress' here. The solution to that bug is to remove the 'complete -co*' line from /etc/profile.d/tcsh-completion. Or, for anyone not able to edit that file, to put an 'uncomplete -co*' in one's .cshrc .
Comment 4 Evgeny Stambulchik 2005-05-10 05:12:54 UTC
Anybody alive here? The bug is STLL there after more than a year since the submission!
Comment 5 Guy Martin (RETIRED) gentoo-dev 2005-05-12 09:19:02 UTC
Guys, not sure why this bug is mine but I don't use tcsh. People working on OOo should know this thing better than me.
Comment 6 Jakub Moc (RETIRED) gentoo-dev 2005-09-04 02:43:49 UTC
Argh, damned bugzilla jumping on next found bug again. Re-assigning back, sorry
for the noise.
Comment 7 Fabian Groffen gentoo-dev 2005-09-13 11:45:22 UTC
hmmm, I found the defaults annoying as well, but I just switched the auto
completion thing off, and defined my own in .tcshrc.  Maybe we should just
disable the options by default and give a pointer to the tcsh-complete file, as
it was meant as example file, IMHO.  Indeed there need to be patched some
examples out there...
Comment 8 Fabian Groffen gentoo-dev 2005-09-27 12:20:44 UTC
note to self: done
Comment 9 Fabian Groffen gentoo-dev 2005-09-30 12:38:12 UTC
Fixed in 6.14-r1