How to get Command history by cursor key in Linux tclsh

前端 未结 2 582
悲哀的现实
悲哀的现实 2021-02-07 02:13

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.

2条回答
  •  -上瘾入骨i
    2021-02-07 02:54

    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'
    

提交回复
热议问题