Expanding on the answer from: https://stackoverflow.com/a/6657975/1263565
You could override the cmd module's completedefault()
method with:
def completedefault(self, *ignored):
# Set the autocomplete preferences
readline.set_completer_delims(' \t\n;')
readline.parse_and_bind("tab: complete")
readline.set_completer(complete)
with the complete method looking like:
def complete(text, state):
return (glob.glob(os.path.expanduser(text)+'*')+[None])[state]
This should now allow ~
expansion.