开发者

How to get Command history by cursor key in Linux tclsh

开发者 https://www.devze.com 2023-01-03 05:56 出处:网络
Can get the command history by using cursor key (like up arrow key)开发者_高级运维 in TCL shell (tclsh).

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.


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.


Another good pure-terminal option is tclsh-wrapper

Link to tclsh-wrapper on github

It provides rich command line editing, history, aliasing, and keyword completion but does not require X11. Documentation for the key mapping is also available.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号