http://www.perlmonks.org?node_id=940134


in reply to Using Tab Completion on Windows in cmd.exe

I noticed that, by default, the environment variable TERM is set to DUMB on Windows. If I unset it, tab completion works in all packages. It's actually Term::ReadLine::Perl who is called behind the scenes.

Unfortunately, I can't use arrow keys anymore to edit the line. I can only use Ctrl-B & Ctrl-F like in vi.

Is there a way to have the arrow key comfort? By looking at the source, I suspect it can be done with Keymaps in the Term::ReadLine::Perl package, but there's no documentation. Anybody knows how to do that?
  • Comment on Re: Using Tab Completion on Windows in cmd.exe

Replies are listed 'Best First'.
Re^2: Using Tab Completion on Windows in cmd.exe
by Anonymous Monk on Nov 26, 2011 at 05:40 UTC

    Hmm, unsetting term=dumb doesn't work for me on winxp, which windows do you have?

      I'm using Windows 7. I think you must have Term::ReadLine::Perl installed. Otherwise, Term::ReadLine::Stub will be used, which doesn't do word completion.

        Yeah, I got that, I have it

        $ perl -MTerm::ReadLine -MTerm::ReadLine::Perl -d:Modlist -e 1 Carp 1.23 Exporter 5.65 Term::ReadLine 1.07 Term::ReadLine::Perl 1.0303 warnings 1.12

        perl -d:Modlist -e "  use Term::Complete; $|=1; warn $input = Complete( q[ type or tab  ] , [ qw[ ro sham bo foo bar baz ] ] ); " doesn't work for me

        update: of course, it doesn't use Term::Readline, duh ...

        So, what are you using, and how (short example please)?