Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Command history by cursor key in Linux tclsh

Tags:

Can get the command history by using cursor key (like up arrow key) in TCL shell (tclsh).

I am running tclsh on fedora with linux version 2.6.21.

like image 635
Adi Avatar asked Jun 14 '10 23:06

Adi


2 Answers

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' 
like image 157
glenn jackman Avatar answered Sep 19 '22 07:09

glenn jackman


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.

like image 27
Hai Vu Avatar answered Sep 20 '22 07:09

Hai Vu