Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > terminal & mark-directories autocompletion

terminal & mark-directories autocompletion
Thread Tools
iampivot
Junior Member
Join Date: Sep 2005
Status: Offline
Reply With Quote
Nov 18, 2008, 09:17 PM
 
Autocompletion with terminal seems to work differently from other bash shells autocomplete. Eg if I type cd /e and press Tab, I get cd /etc. If I do it under linux I get cd /etc/. See the difference? This is amazingly annoying. I know that of course you can get the same by pressing Tab twice, but it's still 'wrong'.

I've tried changing it by toggling mark-directories on and off, but with that setting off, it doesn't work even with multiple Tab presses.

Any ideas how to change this?
     
Hal Itosis
Grizzled Veteran
Join Date: Mar 2004
Status: Offline
Reply With Quote
Nov 19, 2008, 01:48 AM
 
it might help if we knew your $BASH_VERSION
(mine is: 3.2.17(1)-release from Leopard)

There are a couple of possibilities here.
The first thing i notice is you're using /etc as your example.
You are aware that /etc is not an actual directory in OSX?
It's a symlink to the folder /private/etc

You should look at (and also have shown us) this:
$ bind -v |grep mark
set mark-directories off
set mark-modified-lines off
set mark-symlinked-directories off

See that there's a separate variable for symlinked-directories?
Turn that on and the / will auto-append when tabbing /etc/

You didn't show exactly *how* you turned the setting on either.
This works for me:
$ bind 'set mark-directories on'

i put such lines in my ~/.bashrc file (but i prefer 'off' instead)
-HI-
     
iampivot  (op)
Junior Member
Join Date: Sep 2005
Status: Offline
Reply With Quote
Nov 19, 2008, 02:24 AM
 
Thanks!

bind 'set mark-symlinked-directories on' works!

I was using leopard btw,

Macintosh-3:~ torgeir$ bash --version
GNU bash, version 3.2.17(1)-release (i386-apple-darwin9.0)
Copyright (C) 2005 Free Software Foundation, Inc.

Macintosh-3:~ torgeir$ bind -v |grep mark
set mark-directories on
set mark-modified-lines off
set mark-symlinked-directories off
     
Art Vandelay
Professional Poster
Join Date: Sep 2002
Location: New York, NY
Status: Offline
Reply With Quote
Nov 19, 2008, 02:59 AM
 
Leopard changed the default setting. It was turned on prior to Leopard.
Vandelay Industries
     
   
Thread Tools
 
Forum Links
Forum 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
Top
Privacy Policy
All times are GMT -4. The time now is 09:06 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,