How to get Command history by cursor key in Linux tclsh

荒凉一梦 提交于 2020-12-29 02:45:26

问题


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.


回答1:


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'



回答2:


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.



来源:https://stackoverflow.com/questions/3041530/how-to-get-command-history-by-cursor-key-in-linux-tclsh

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!