LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-23-2020, 03:57 AM   #1
meir
LQ Newbie
 
Registered: Oct 2019
Posts: 9

Rep: Reputation: Disabled
autocomplete in tcsh


is there a way to imitate bash autocomplete feature in tcsh ?
I have a perl script
Code:
xtest -test <some file from test/ dir>
. If i type xtest -test TAB i would like shell to display all files in test/ dir. cannot run xtest from test/ dir
 
Old 03-23-2020, 07:32 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
autocomplete works in tcsh. I think You need to type:
xtest -test test/<TAB>
 
Old 03-23-2020, 08:00 AM   #3
meir
LQ Newbie
 
Registered: Oct 2019
Posts: 9

Original Poster
Rep: Reputation: Disabled
the script knows where to look for test files.
what i'm looking for is some way to configure autocomplete
by default list files in current directory
but when command begins with xtest to list files in ../../../dir1/dir2/tests
 
Old 03-23-2020, 08:11 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
I don't think that feature is available in tcsh (and/or in bash), but you can teach zsh to do that.
probably this: https://www.linuxquestions.org/quest...sh-4175443347/ helps.

Last edited by pan64; 03-23-2020 at 08:20 AM.
 
Old 03-24-2020, 03:39 PM   #5
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by meir View Post
If i type xtest -test TAB i would like shell to display all files in test/ dir. cannot run xtest from test/ dir
Not with TAB, but look at the ctrl-D key (D for directory).
If you give a partial name (with of without path in front) it will give all possible (visible) completions. To get hidden files you have to type the . first before pressing the ctrl-D
 
1 members found this post helpful.
Old 06-03-2020, 03:00 AM   #6
YesItsMe
Member
 
Registered: Oct 2014
Posts: 915

Rep: Reputation: 313Reputation: 313Reputation: 313Reputation: 313
Quote:
Originally Posted by meir View Post
is there a way to imitate bash autocomplete feature in tcsh ?
Code:
# ~/.cshrc:
set autolist                # Tab completion list
set complete = enhance      # Case-insensitivity for the latter
 
  


Reply

Tags
autocomplete, tcsh



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
command - autocomplete ethanchic *BSD 8 04-26-2003 12:02 AM
autocomplete figadiablo Linux - General 6 03-13-2002 04:19 PM
autocomplete marksstroud Linux - Newbie 1 11-11-2001 01:02 PM
Autocomplete in Redhat hazza96 Linux - General 9 06-24-2001 11:13 PM
inline AutoComplete hmorrow General 2 06-20-2001 04:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration