SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2011-01-26 19:53:12

olembe
#! Junkie
From: Salisbury, England
Registered: 2009-04-29
Posts: 263

[solved] Symlinks and bash completion

Okay, this is a TOTALLY trivial question in the scheme of things, but if anybody has an answer it would remove a little daily annoyance from my life.

I use quite a lot of symlinks to organize directories on my disks, but keep falling foul of needing to do an extra tab when using bash completion. To clarify, let's say I had the following file in a directory:

/files/document.txt

I could type "cat /f", hit tab, press d, then hit tab and return.

However, if /files/ is a symlink, when I type "cat /f" and hit tab, instead of completing the input as far as "cat /files/", it completes only to "cat /files" and I have either to do an extra tab or add the slash myself. I'd be interested in anybody can explain why the system behaves this way, and also if there's some way to avoid needing to remember the extra tab when using symlink directories.

As I say, I know it's trivial, but I'm constantly tripping up over this.

Last edited by olembe (2011-01-26 20:05:51)

Offline

Be excellent to each other!

#2 2011-01-26 20:02:02

olembe
#! Junkie
From: Salisbury, England
Registered: 2009-04-29
Posts: 263

Re: [solved] Symlinks and bash completion

set mark-symlinked-directories on

Last edited by olembe (2011-01-26 20:05:39)

Offline

#3 2011-01-26 20:33:02

benj1
Wiki Wizard
From: Yorkshire, England
Registered: 2009-09-05
Posts: 1,084

Re: [solved] Symlinks and bash completion

gah yet another config file I will have to fiddle with roll

pretty cool tho, thanks for posting the solution.

Offline

#4 2011-01-26 21:19:25

luc
#! Die Hard
From: Munich, Germany
Registered: 2010-03-21
Posts: 597

Re: [solved] Symlinks and bash completion

by now my ~/.inputrc contained only this line

set completion-ignore-case On

it makes the filename matching of <TAB> case insensitive. like this:

$ ls
foo  bar  BAZ
$ cat b<TAB><TAB>
bar  BAZ
$cat ba<TAB>
$cat BAZ 

now it will contain one more line smile
thanks
luc

Offline

#5 2011-01-26 21:21:16

olembe
#! Junkie
From: Salisbury, England
Registered: 2009-04-29
Posts: 263

Re: [solved] Symlinks and bash completion

Luc,

I like your line a lot. That's going in my .inputrc right now!

Offline

#6 2011-01-27 14:20:29

slapfish
#! Die Hard
From: Athens, Greece
Registered: 2009-10-22
Posts: 601

Re: [solved] Symlinks and bash completion

Thanks for that! However, I chose to add the line in /etc/inputrc instead of creating one on my home folder.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: bleh

Debian Logo