Does ntpq have a command line history mechanism?

Eric S. Raymond esr at
Sat Dec 23 20:24:32 UTC 2017

Matthew Selsky via devel <devel at>:
> On Fri, Dec 22, 2017 at 06:42:00AM -0500, Eric S. Raymond via devel wrote:
> > Hal Murray via devel <devel at>:
> > > 
> > > I was expecting one, but I get things like this:
> > > ntpq> ^[[A^[[A^[[B
> > > ***Command `' ambiguous
> > > ntpq> 
> > > 
> > > That was up-arrow, up-arrow, down-arrow
> > > 
> > > Is there some package I need to install?
> > 
> > Up arrow and down arrow should work already.  I am shocked to find that
> > they do not.
> > 
> > This is a serious regression.  Who removed the import of readline, and why?
> I removed it.  See:
> The Cmd module should be importing readline for us, when available, since 2001. See:
> @Hal, can you double-check that the readline python module is importable on your system?  You might need libedit or GNU readline installed.
> Would it help to add an informational check for this python module in waf's configure?

Alas. I don't think so.

Hal's bug replicates on my Ubuntu 16.10. I remember
up-arrow/down-arrow working correctly, but I don't remember when.

I tried adding an explict import just after the import from future:

    import readline
    print("Import OK")

I do see "import OK", so readline is available, but control keys continue
to fail (Ctl-P and Ctl-N also don't work).

On the other hand, the following trivial use of cmd.Cmd works correctly.

import cmd, readline

class SampleInterpreter(cmd.Cmd):
    def __init__(self):
    def do_echo(self, line):
        "Sample echo command."
        print line

me = SampleInterpreter()
me.cmdloop("Hello World")

This is highly annoying. We've done someting in our interpreter that busts
that feature, but it is not obvious what.  Perhaps the polyglot changes?

I'll dig into this further when I get back from sword class
		<a href="">Eric S. Raymond</a>

My work is funded by the Internet Civil Engineering Institute:
Please visit their site and donate: the civilization you save might be your own.

More information about the devel mailing list