Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This is driving me nuts. I am using ngspice in interactive mode on Ubuntu. I expected the up and down arrows to scroll through previous commands just like in bash or pretty much any CLI ever. However doing so in ngspice just prints out "^[" or "[A". There is a history command and I am able to use "!" to execute previously executed commands just like in bash but what I want to do is bring up a previous command and edit it (like I can by pressing the up arrow in bash). Is there any way to so this in ngspice or do I really have to keep typing out the command from scratch if I want to change it?

share|improve this question

migrated from electronics.stackexchange.com Jan 4 at 5:42

This question came from our site for electronics and electrical engineering professionals, students, and enthusiasts.

Did you compile the package yourself? Often you need to explicitly include support for the readline (or similar) library in order to get complex command-line editing and history. Note though that this question is better suited to the Unix & Linux stack exchange. –  Scott Winder Jan 3 at 16:44
No, I am using the pre-compiled version in the Ubuntu repository. I could compile it myself but for reasons I won't go into that option is not preferred. –  kyp4 Jan 3 at 16:54
add comment

2 Answers 2

I would upgrade to Quantal or later so the editline support be activated without having to compile stuff, but if you feel hacky you can do this easily (you must make sure that you have the sources repositories activated):

sudo apt-get build-dep ngspice
sudo apt-get install dpkg-dev
apt-get source ngspice
cd ngspice*
sed '0,/\.\/configure/{N;N;s/$/\n                --with-editline=yes \\/}' debian/rules
## Add the -i option once you are sure of the changes,
## I recommend using `| grep -A5 -B5 editline` to verify
dpkg -i ../ngspice*.deb


share|improve this answer
add comment

The ngspice package in the precise repository was compiled without editline support. This was corrected in a the newer repositories, but not in the precise one. link:

  • Change configure parameters

So if you install on 12.04 or older you will have this problem, if you install on 12.10 or newer you won't.

To solve this on 12.04 you can try compiling ngspice for yourself or you can try installing the .deb package from a newer repository, e.g quantal, hopefully installing this .deb from the newer repository won't break anything on your system.

share|improve this answer
add comment

Your Answer


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