2

I'm running GRASS GIS 6.4.3. on Win 7, SP1, 64 bit.

The path to my grass-DB is: D:\grassdb

Within the GRASS GIS Commande Line, if I press the tab-key to auto-complete only folders, files and documents from "C:\" are listed and none of the maps from GRASS which should appear:

If I type:

r.colors map=D 

and press the tab-key after the "D" this appears:

r.colors map="data"
r.colors map="Documents and Settings"

and so on.

Instead I'd like to see my layers:

r.colors map=DTM_2012
r.colors map=DTM_2013

and so on.

Any hints?

2 Answers 2

1

That's a limitation of the shell that you are using (probably CMD on windows, but possibly sh/bash from Cygwin).

The GRASS command line is just a normal shell session that has it's path (and other variables) setup properly so you can run the GRASS programs. When you press tab, the shell program tries to complete based on the file and folder names in the current directory (C:\ in your case).

The shell doesn't know anything about your current mapset or the data in it, those are just environment variables or files and data located in folders within your grassdata folders.

1
  • Hmm, on my laptop I'm able to auto-complete layers and grass commands pressing the tab button. Is there a way to set this up? It's not very comfortable to type each and every grass command or layer name. Jun 23, 2014 at 7:25
0

As Evil Genius is saying, the (black) system (MS Windows) command line does not know anything about GRASS GIS and auto-completes only the things which it knows about, so programs on path (GRASS GIS modules are on path) and files. So, it should auto-complete GRASS GIS commands but will not complete their parameters or map names because it does not know anything about them.

For unix-like (Linux, Mac OS X, ...) command lines, you can in theory customize auto-complete and there was some work done on this topic. There was newer anything official, however you can search the grass-dev mailing list for projects on this topic.

Some people even developed also some GRASS-related features to Emacs and there might be similar things for other environments, although I haven't heard of them.

Some people are using the trick that they navigate to the directory with some files related to a map, e.g. yourlocation/yourmapset/vector and then the auto-complete for maps might start to magically works because the command line auto-completes the files in the current directory which happens to be your maps. This works on Linux but it could work also on MS Windows.

Finally and perhaps most importantly, in the GRASS GIS GUI, there is a Command console which has different type of auto-completion (then system command lines) which is more close to what different IDEs (integrated [software] development environments) have. If you type, the suggestions will appear automatically and you can select from a list. You can also force auto-complete by pressing Ctrl+Space. This works for flags, options, map names and of course module names. If you press Tab, you will get a module synopsis, i.e. list of possible options and flags. This applies to the upcoming version GRASS GIS 7.

By the way, in Python interactive shell where you have GRASS accessible (e.g. the one in GRASS GIS GUI), you can use PyGRASS which, if imported in certain way, can auto-complete GRASS module names.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.