[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Tab completion with cd and ls
From: |
John W. Eaton |
Subject: |
Tab completion with cd and ls |
Date: |
Wed, 1 Jun 2005 14:37:57 -0400 |
On 1-Jun-2005, Keith Goodman wrote:
| Is it hard to modify the behavior of tab completion when a line starts
| with a keyword like cd and ls?
|
| Currently tab completion (for cd and ls) searches through directories,
| octave commands, and variables. When using cd and ls it would be nice
| if the octave commands and variables were not included in the search.
|
| >> cd tmp/ [two tabs]
| Display all 1994 possibilities? (y or n)
|
| There's not much in my tmp directory; most of the 1994 positibilities
| are Octave functions and variables.
|
| >> cd oct [two tabs]
| octave_config_info octave_core_file_name octave_tmp_file_name
| octave_core_file_limit octave_core_file_options octcvs/
|
| In this case there is only one meaningful tab completion (cd octcvs/).
Why stop at hardwiring special forms of completion for cd or ls
commands? Wouldn't it be better to have some form of programmable
completion? I'm not sure that it would be trivial to add, but some
shells (including bash, which uses readline) have it. So that might
be a place to start looking for ideas about how to make it work.
jwe