Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

When I open terminal, I'd like the up arrow go to the last command I typed within nslookup. Instead I get a strange escape sequence.

What must be done to allow me to up arrow in nslookup?

share|improve this question
    
It is the default behaviour to get your last entered command when you press up arrow. You must've gotten something messed up. –  Alex Oct 25 '12 at 19:05
    
@Alex You're right, but I seemed to just notice this within an interactive nslookup. I just revised the question. –  makerofthings7 Oct 25 '12 at 19:12
    
The default "read an inputline from the user" under Unix does not support arrow keys. It is an extra library which needs to be used. –  Thorbjørn Ravn Andersen Oct 25 '12 at 19:35

2 Answers 2

up vote 2 down vote accepted

Nslookup on OS X does not seem to use readline, so it does not support the arrow keys.

You can install rlwrap, which is available in MacPorts and presumably other package managers. Then you can run

rlwrap nslookup

To get arrow key support.

Many thanks to this thread on the MacRumors forums.

share|improve this answer

If you are using bash someones changed your key bindings. Look at ~/.bash_profile and see what's in there. Alternatively go to the Preferences for Terminal and select the profile you are using and then click on the Keyboard Tab. See if the cursor up is set to anything weird there.

As someone else mentioned the default setting in Terminal and bash is to display the last command.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.