You are not logged in.

#1 2010-06-08 19:25:01

sokuban
Member
Registered: 2006-11-11
Posts: 412

[SOLVED]zsh, mounting, and autocomplete

Okay, so normally when I mount, I use a command like this:

sudo mount -o utf8 -o loop cdtomount.iso /path/to/directory/

It works. (Is this the proper way to do it?)

The only problem is, is that zsh for some reason will not tab autocomplete the iso or the directory, which is a little annoying.

Also, I have a very bad memory, and most of the time I have to run a cat ~/.histfile|grep mount to figure out how to do it. Today I thought of making an alias, say smount to be "sudo mount -o utf8 -o loop" (and allowing sudo to run mount with no password.

I'd do that, but it has the same problem with zsh autocompletion. Is there a way to edit zsh autocompletion to tell it to look for a file (sometimes I have to mount stuff that don't have an overt .iso file extension) and a directory? Or is it not working because I am using mount incorrectly?

Thanks.

Last edited by sokuban (2010-06-08 20:18:39)

Offline

#2 2010-06-08 19:40:27

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: [SOLVED]zsh, mounting, and autocomplete

It's because you use -o twice.

Use:
sudo mount -o utf8,loop=cdtomount.iso /path/to/directory

Also, you can just grep from the history command:
history | grep
I use alias hist="history | grep".


no place like /home
github

Offline

#3 2010-06-08 19:53:42

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED]zsh, mounting, and autocomplete

Press Ctrl-R and type in part of the previously run command, press it again to get another result - that's how I enter more complex commands.

Offline

#4 2010-06-08 19:58:53

sokuban
Member
Registered: 2006-11-11
Posts: 412

Re: [SOLVED]zsh, mounting, and autocomplete

The history command sounds cool. (I don't get how it works, but I'll rtfm later and figure it out.)

But I can't seem to mount CDs with the command you provided. (Though the tab completion works.)

$ sudo mount -o utf8,loop=Planetarian\ \(voiced\).iso ~/.wine/drive_d 
Password: 
mount: can't find /home/sokuban/.wine/drive_d in /etc/fstab or /etc/mtab
$ sudo mount -o utf8 -o loop Planetarian\ \(voiced\).iso ~/.wine/drive_d                                     
$

EDIT: Ctrl+R also sounds cool... though I got to change my shortcut for FVWM restart before trying this.

Last edited by sokuban (2010-06-08 20:00:27)

Offline

#5 2010-06-08 20:15:23

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED]zsh, mounting, and autocomplete

It's "-o utf8,loop what where".

Offline

#6 2010-06-08 20:18:26

sokuban
Member
Registered: 2006-11-11
Posts: 412

Re: [SOLVED]zsh, mounting, and autocomplete

Thanks, that works.

Offline

Board footer

Powered by FluxBB