photo
Jordan Sissel
geek

Fri, 02 May 2008

ZSH: Disable 'cd' supporting usernames

I have a directory called "lib". If I try to do "cd l<tab>", zsh will offer me "libuuid list lib" as completion candidates. The words 'libuuid' and 'list' show up because they are usernames. This is really annoying, and there doesn't seem to be an option to disable this. What happend to doing "cd ~root" to change to root's homedir? Was typing '~' too hard?

At any rate, I figured out where to fix the unfeature: A file '_tilde' in path/to//zsh/4.3.4/functions/Completion/Zsh. It happens to be /usr/share/zsh/4.3.4/functions/Completion/Zsh on my ubuntu workstation.

... around line 22 ...
while _tags; do
  _requested users && _users "$suf[@]" "$@" && ret=0

  _requested named-directories expl 'named directory' \
...
Comment out the bold line above (starting '_requested users ...') and restart zsh. This only disabled the username completion part of zsh's cd command, but that's good enough for now. If I ever accidentally typo and cd to someone's home directory, I can just popd to return to my previous location.

Comments: 2 (view comments)
Tags: , ,
Permalink: /geekery/zsh-disable-cd-username
posted at: 15:21

new keynav version available (20080501)

Hop on over to the keynav project page and download the new version.

The changelist from the previous announced release is as follows:

20080501:
  Patches from Mark (20080501)
   * ~/.keynavrc extends defaults rather than replacing them
   * "clear" in ~/.keynavrc resets keybindings
   * comments can appear anywhere on a line

  Patches from Eric (20080501)
   * If the move or size value is greater than 1.0, then assume it is an absolute value.

  Patches from Lukas Mai (20080429)
   * Fixes a few minor bugs
   * Clean up to compile without most warnings when -pendantic and -Wall are enabled.

Comments: 0 (view comments)
Tags: ,
Permalink: /geekery/keynav-20080501
posted at: 13:44

Search this site

Navigation

Metadata

Home About Resume My Code

Articles

ARP Security Dynamic DNS with DHCP OpenLDAP+Kerberos+SASL PPP over SSH SSH Security: /bin/false Week of Unix Tools Work Efficiency

Projects

fex firefox tabsearch firefox urledit grok keynav liboverride newpsm (FreeBSD) nis2ldap pam_captcha poor man's backup Solaris audio utility xboxproxy xdotool xmlpresenter xpathtool misc scripts

Presentations

Yahoo! Hack Day '06 Unix Essentials Vi/Vim Essentials

Tag Cloud

Calendar

< May 2008
SuMoTuWeThFrSa
     1 2 3
4 5 6 7 8 910
11121314151617
18192021222324
25262728293031

Friends

BarCamp Kent Brewster Tantek Çelik John Resig Wesley Shields Tyler Shields

Technorati