I am working on a project need Tclsh like support with some self-defined commands. I implemented following code (based on Tcl 8.5):
Tcl_Main(argc, argv, Tcl_AppInit);
And put new commands registration in Tcl_AppInit. Everything looks fine, except that with the new command line interpreter, when I type Tcl built-in command "history", I got :
% history
invalid command name "history"
Other built-in commands work fine, like "puts", "set", etc. Why ? Do I have to implement my own "history" command instead?
在这里添加我的解决方案:事实证明, history
是Tcl脚本库的一部分,需要在初始化期间通过提供$TCL_LIBRARY/init.tcl
或调用Tcl_Init(interp)
。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.