cygwin


tcsh auto-complete for the 2nd argument


For example, for the command
cp src_file dst_file
my tcsh can complete for src_file if I type src then press TAB, but it does not try to complete for dst_file if I type dst then press TAB.
Output of complete cp (per #shx2's request):
% complete cp
complete cp 'c/--/(archive backup no-dereference force interactive link preserve parents sparse recursive symbolic-link suffix update verbose version-control one-file-system help version)/' 'c/-/(a b d f i l P p R r S s u V v x -)/' 'n/-*r/d/' 'n/{-S,--suffix}/x:<suffix>/' 'n/{-V,--version-control}/(t numbered nil existing never simple)/' 'n/-/f/' 'N/-/d/' 'p/1/f/' 'p/2/d/' 'n/*/f/'
Is there any setting I missed?
Try uncomplete cp to remove the default completion. You can even do uncomplete * if you are super-frustrated :-)
Where the completions come from : tcsh sources /etc/csh.cshrc during the logon, which, in turn, sources /etc/profile.d/complete.tcsh, which, on tcsh 6.18.01 on cygwin 1.7 is a 1228-line file with a lot of custom completions! The completion for cp does not autocomplete the 2nd file and forces you to type it just in case you accidentally overwrite an existing file in haste.
tcsh has had programmable completions since 1993 and has an extensive syntax for defining completions. The upside is that you can do stuff like
complete dbx 'p/2/(core)/'
which defines a positional completion in place 2 for dbx to be the word "core", which is the most common completion for the dbx debugger in position 2, and seeing "core" appear there when you press TAB is pretty cool.
The downside is that there's a whole syntax to learn in case /etc/profile.d/complete.tcsh is not doing what you expect. I have so far managed to avoid learning that syntax since uncomplete works fine for me in such cases. YMMV. :-)
You have a custom complete rule for cp, which results with a behavior which you report as unexpected. So it is probably a bad rule.
You can simply disable it:
uncomplete cp
and/or remove the complete cp command from your dot file (probably .cshrc, or another dot file sourced from within it.

Related Links

Running Vivado HLS in Cygwin
unable to get Cygwin 2.0.2 source code
Why nam.exe doesn't work in the cygwin without startX?
Cygwin - How can I keep original file name when outputting results of a command on a file (cut command)?
Where to find particular library files for cygwin(64bit)
cp behavior changed. How can old behavior be executed
byacc %defines syntax error when compiling with make command
Error installing GMP on cygwin “configure: error: could not find a working compiler, see config.log for details”
Starting X with Cywgin
installing specific packages on ns2
installing uwsgi on cygwin
Tab completion doesn't complete paths with escaped space
Is there a way to keep a on going log of all commands made in Cygwin?
cygwin does not create a.out file when I compile for ocaml
distinguish between MSYS and MSYS2 and CYGWIN
Google protocol buffer compiling error in cygwin

Categories

HOME
delphi-7
amp-html
gpu
formal-languages
jax-rs
toolbox
spring-data-redis
google-cloud-functions
settings
azure-container-service
nfs
commonjs
mod-security
datastage
openbugs
comsol
renjin
heat
bitnami
aws-sdk
kendo-mobile
cgbitmapcontext
angular-routing
joptionpane
qliksense
epsilon
resourcebundle
interbase
android-sharedpreferences
jasmine-node
asymptotic-complexity
nstimer
mobx
xbox
cognos-bi
rselenium
android-sugarorm
carriage-return
pdw-file-browser
browser-extension
watchman
news
doc
trigonometry
parser-generator
dbnull
contract
knime
procfile
httr
lampp
posixct
podscms
quicktime
cpu-cache
trigger.io
cmp
vibrate
restore
visual-studio-2008-sp1
google-cloud-console
async.js
dotnetnuke-7
signalr.client
delta
observablecollection
html-to-pdf
np-spring
rasterize
boomerang
snackbar
uvc
phpldapadmin
openbabel
exceldatareader
ssis-data-flow
verold
alternate
isqlquery
pclzip
insert-id
mantle
stacky
virtual-pc
booksleeve
robotlegs
patricia-trie
nokia-s40
fragmenttransaction
expression-blend-4
landscape-portrait
matlab-load
google-floodlight
timthumb
http-daemon
load-time
globals
office-2007
eclipse-marketplace
web-application-project
sifr3

Resources

Encrypt Message