Shell – How to get the arrow keys working in the at> prompt

atshellterminal

Whenever I try to use the arrow keys in the at> prompt (after, for example, running at now) it just shows control codes, eg. ^[[D for .

This makes pasting and editing long commands difficult as the only viable option is to edit, copy and paste from a separate document.

So, how do I get arrow keys to work in the at> prompt?

(Googling for anything having to do with the at> prompt or /usr/bin/at is quite difficult…)

Best Answer

You could use a program such as rlwrap (readline wrapper) for this:

rlwrap at now

Further reading:

  • hanslub42/rlwrap (github)

    * HOW TO USE IT:
    If 
    
      $ <command> <args>
    
    doesn't let you use arrow keys to edit input, or if you just want
    decent input history and completion, try:
    
      $ rlwrap [-options] <command> <args>
    
Related Question