Search code examples
terminalsqlitereadlinemacports

How to activate readline on a macports sqlite3 install


I have Sqlite3 version 3.16.2 installed on mac Os Sierra 10.12.6 using macports. It does not currently allow me to go through the history of my last SQL commmands, when I press up, it dispays ^[[A instead. I do have readline @7.0.003_1 installed through macports as well, but it does not seem to help. I use Sqlite3 in terminal.

I have searched the web for this but as far as I can tell, the information I found does not apply to a macPorts installation of Sqlite3.

How can I make it work so that I can go through the history of my last SQL commmands by pressing the up arrow? Thanks.


Solution

  • The macports installation of sqlite3 does support arrow up (and such). You just need to make sure that when you run sqlite3 you are actually running that installation and not an other installation of sqlite3 from somewhere in your system. One can check that by running the command which sqlite3, which should print something like /opt/local/bin/sqlite3 for a macports installation of sqlite3. If it shows something like /Users/UserName/Library/Android/sdk/platform-tools/ that means you are not running the macports installation of sqlite3 and than you need to edit your $PATH environment variable.