How to get Command history by cursor key in Linux tclsh How to get Command history by cursor key in Linux tclsh linux linux

How to get Command history by cursor key in Linux tclsh


You want access to the readline library, you can do that with rlwrap:

$ rlwrap tclsh

Useful options are -c for file name completion, and -f to add words from a file to the completion list:

$ rlwrap -cf my_complete_file tclsh

Since you almost always want to use rlwrap, adding a shell alias is useful:

alias tclsh='rlwrap tclsh'


I usually use tkcon which comes with ActiveTcl, or as a separate installation. tkcon has many features, but the one I use the most is the command-line editing aspect.