Go Back   The macosxhints Forums > OS X Help Requests > UNIX - General



Reply
 
Thread Tools Rating: Thread Rating: 7 votes, 5.00 average. Display Modes
Old 08-22-2002, 05:54 AM   #1
Spiff
Triple-A Player
 
Join Date: Jan 2002
Posts: 129
fixing tab auto-complete shell tricks under 10.2/Jaguar

A fun feature of 10.1.5 in the terminal was the ability to 'tab-complete' your commands or your paths etc.

now if there is a choice, hitting 'tab' results in a 'beep' and nothing else being provided. previously if you hit 'tab' while there were choices remaining, the shell would present the available choices.

i.e.

cd ~/Library/Pre [tab]

would produce

~/Library/Preferences ~/Library/PreferencePanes

and then complete the line to the point you left it before, i.e.

cd ~/Library/Pre

and leave it for you to decide.

So how do I get it back?
__________________
Spaceman Spiff

MacPro 3.33 13Gb 8TB 10.8.5
Spiff is offline   Reply With Quote
Old 08-22-2002, 07:52 AM   #2
sao
Moderator
 
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
Are you using tcsh?

In tcsh, filename completion should be always active. And as you said you hit the "TAB" key.

When more than one completion is possible, tsch can automatically display matches. Maybe you need to set autolist in your ~/.cshrc file:

set autolist (match listing for any completion failure)

In csh, you hit the "ESC" key rather than "TAB". But you also need to activate filename completion by writing in your .cshrc file:

'set filec'


Cheers...
sao is offline   Reply With Quote
Old 08-22-2002, 07:57 AM   #3
mervTormel
League Commissioner
 
Join Date: Jan 2002
Posts: 5,536
Jaguar

AFAIK, tcsh startup scriptage is completely broken in 10.2

under 10.1.x

$ cath /etc/csh.*
==> /etc/csh.cshrc <==
source /usr/share/init/tcsh/rc
==> /etc/csh.login <==
source /usr/share/init/tcsh/login
==> /etc/csh.logout <==
source /usr/share/init/tcsh/logout

under 10.2, these source'ings are gone, and so is /usr/share/init, so your startup scriptage doesn't get called.

it's a mess.
mervTormel is offline   Reply With Quote
Old 08-22-2002, 08:14 AM   #4
bluehz
MVP
 
Join Date: Jan 2002
Posts: 1,562
There are a lot of oddities in the way that Apple sets your defaults in terminal in Jag - including the autocomplete that you mention. I finally managed to get my term env back to close to normal by moving my 10.1.5 term files over.

There are two issues that are driving me nuts though:

* I have autocomplete working, BUT it is now case sensitive so /li will not expand to /Library as it used to....not ithas to be /Li before it will expand.

* MY biggest gripe though is actually part of the terminal software. Apple removed the ability to set the "option-click to insert" as a default and have it saved. You can change it on a window by window basis but I have yet to figure out how to get it to stick so all new windows open with that pref. I have searched the plist files, etc, and still no luck saving.
bluehz is offline   Reply With Quote
Old 08-22-2002, 08:23 AM   #5
mervTormel
League Commissioner
 
Join Date: Jan 2002
Posts: 5,536
Quote:
Originally posted by bluehz
...* I have autocomplete working, BUT it is now case sensitive so /li will not expand to /Library as it used to....not ithas to be /Li before it will expand...

set complete='enhance'

does that do it?
mervTormel is offline   Reply With Quote
Old 08-22-2002, 08:34 AM   #6
sao
Moderator
 
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
MervTormel,

As you said...what a mess!

How is bash working with 10.2 ?


Cheers...
sao is offline   Reply With Quote
Old 08-22-2002, 08:45 AM   #7
mervTormel
League Commissioner
 
Join Date: Jan 2002
Posts: 5,536
Jaguar

i've completely bypassed the orwellian and rococo OSX startup init mishmash and have everything driven out of ~/.bash_profile and ~/.bash_login - so 10.2 posed no problems for bash so far.
mervTormel is offline   Reply With Quote
Old 08-22-2002, 08:56 AM   #8
bluehz
MVP
 
Join Date: Jan 2002
Posts: 1,562
If using tcsh - look here:

pico /usr/share/tcsh/examples/README

This explains the standard technique used in the UNIX world for setting your tcsh env up in a modular way that works very well for me.
bluehz is offline   Reply With Quote
Old 08-22-2002, 08:59 AM   #9
bluehz
MVP
 
Join Date: Jan 2002
Posts: 1,562
thx Merv - the enhance solved the case sensitivity problem! I knw the solution was easy - just hadn't found it yet.

Now if I could just fix the option-click!
bluehz is offline   Reply With Quote
Old 08-22-2002, 09:43 AM   #10
bluehz
MVP
 
Join Date: Jan 2002
Posts: 1,562
If anyone is interested - I posted the files I use to get my tcsh back to what I am used to form OS X 10.1.5. The files are pretty generic as I removed all my own personalizations - so they should work if you want to use them or just look at them as a reference.

Download here

A quick overview of the setup:
Code:
/etc
csh.logout
csh.login
csh.cshrc

~/Library/init/tcsh
path
environment.mine
aliases.mine
completions.mine
rc.mine

/usr/share/init/tcsh
tcsh.defaults
README
rc
environment
completions
aliases
logout
login

The /etc files do nothing but source (aka read in) the files in your /usr/share/init/tcsh.

The /usr/share/init/tcsh files setup system globals and then source (aka read in) the files in your ~/Library/init/tcsh.

The files you will want to personalize are in ~/Library/init/tcsh. The other files are standard and don't really need modification.

This method allows you to modularize your setup and avoid modifying the default system setup.

I am definitely no expert on this - I created these from the old 10.1.5 setup and from a Linux machine I use as a LAN server. If anyone has any suggestions for improvements - please let me know.

Last edited by bluehz; 08-22-2002 at 09:45 AM.
bluehz is offline   Reply With Quote
Old 08-23-2002, 12:42 AM   #11
Spiff
Triple-A Player
 
Join Date: Jan 2002
Posts: 129
thanks for the files, works great!
__________________
Spaceman Spiff

MacPro 3.33 13Gb 8TB 10.8.5
Spiff is offline   Reply With Quote
Old 08-23-2002, 01:57 AM   #12
bluehz
MVP
 
Join Date: Jan 2002
Posts: 1,562
Cool! Glad to hear confirmation it works well.
bluehz is offline   Reply With Quote
Old 08-23-2002, 08:38 AM   #13
houchin
Major Leaguer
 
Join Date: Jan 2002
Location: Northern Virginai
Posts: 294
Quote:
Originally posted by mervTormel
AFAIK, tcsh startup scriptage is completely broken in 10.2

under 10.1.x

$ cath /etc/csh.*
==> /etc/csh.cshrc <==
source /usr/share/init/tcsh/rc
==> /etc/csh.login <==
source /usr/share/init/tcsh/login
==> /etc/csh.logout <==
source /usr/share/init/tcsh/logout


I don't know why, but these files have been moved to /usr/share/tcsh/examples. You will need to move any *.mine files from init/tcsh to tcsh/examples, and then change /etc/csh.* to point to the new directory.
houchin is offline   Reply With Quote
Old 08-23-2002, 08:56 AM   #14
mervTormel
League Commissioner
 
Join Date: Jan 2002
Posts: 5,536
Quote:
Originally posted by houchin
I don't know why, but these files have been moved to /usr/share/tcsh/examples. You will need to move any *.mine files from init/tcsh to tcsh/examples, and then change /etc/csh.* to point to the new directory.

very not recommended.

the recommended approach is in bluehz's post above. put the files you need back where they belong. leave your ~/.../*.mine alone. leave /usr/share/tcsh/examples alone.
mervTormel is offline   Reply With Quote
Old 08-23-2002, 09:42 AM   #15
houchin
Major Leaguer
 
Join Date: Jan 2002
Location: Northern Virginai
Posts: 294
Quote:
Originally posted by mervTormel

very not recommended.

the recommended approach is in bluehz's post above. put the files you need back where they belong. leave your ~/.../*.mine alone. leave /usr/share/tcsh/examples alone.

bluehz's post seems to put all of your custom modifications in individual user's configurations, and doesn't allow you to make modifications for all users. What's the difference between adding "all-user" .mine files to tcsh/examples as opposed to recreating init/tcsh and copying the original files from examples to there and modifiying the directory paths in rc?
houchin is offline   Reply With Quote
Old 08-23-2002, 11:19 AM   #16
bluehz
MVP
 
Join Date: Jan 2002
Posts: 1,562
I doubt there is anything 'wrong' with making a universal setup for all users. I just chose to do it the documented, recommended, tried and true, unix way.

One thing I will tell you that has made my life easier. I am in and out of root (via CLI) all the time. I got tired of customizing my aliases, tcsh defaults, etc. for the standard user then not have them available when I switched into root. So what I did was manually create a Library directory within the root home dir. Then within that Library dir I created a symlink back to my original/standard users /Library/init dir. This way - you can maintain the modular setup above - but have the settings applied to two users. You could of course apply that to other users as desired. Not something I would probably recommend on an insecure/public machine - but it works for me.
bluehz is offline   Reply With Quote
Reply


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

Forum Jump



All times are GMT -5. The time now is 10:04 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.