People who runs tclsh under Windows can use the up arrow, among other keys, to recall last commands issued. However, on the Mac and Linux environments, the up arrow only gives them ^[[A, which make for a frustrating experience. How do we get the editing capabilities that Windows users enjoy?
One of the solution which I like is to use tkcon, tk-based Tcl shell, which offer excellent command line editing, among other features. On my Mac, tkcon is in /usr/bin/tkcon, the the location may vary. To determine if tkcon is installed in your system, issue the following command:
If you don’t see any output, you will need to install it. On the Mac, head to http://tkcon.sourceforge.net/, download it and follow the instruction to install. On Linux, the instructions are different, depending on which distribution so you should search for it.
Once installed, you can start tkcon using the following command:
The ampersand will launch tkcon in the background and return control immediately to the terminal. On my Mac, tkcon pops under other windows, so after launching, I have to task switch to it using the command + tab key combination. I hope you enjoy using tkcon as I do.