Consider the following Python 2.7 script:
#!/usr/bin/python
import cmd
class T(cmd.Cmd):
def completedefault(self, *a):
print 'completedefault called'
return []
t=T()
t.cmdloop()
When I expect:
I type a character into the shell, then hit tab, I expect to see "completedfault called" printed.
What actually happens:
I type a character into the shell, then hit tab, and nothing happens.
Tested with Python 2.7.3.
completedefault
is called to complete a input line after you entered a command for which nocomplete_<commandname>
-method is available.Try this:
now enter
test
[space] and press tab,completedefault
should be executed now.If you want to control completion for command names, you can use
completenames
to do so, notcompletedefault
.