1 Star 0 Fork 0

SR达人/msteveb_jimtcl

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
rlprompt.tcl 1020 Bytes
一键复制 编辑 原始数据 按行查看 历史
Steve Bennett 提交于 2010-09-28 08:13 . Allow exit from .jimrc
# Readline-based interactive shell for Jim
# Copyright(C) 2005 Salvatore Sanfilippo <antirez@invece.org>
#
# In order to automatically have readline-editing features
# put this in your $HOME/.jimrc
#
# if {$jim_interactive} {
# if {[catch {package require rlprompt}] == 0} {
# rlprompt.shell
# }
# }
package require readline
proc rlprompt.shell {} {
puts "Readline shell loaded"
puts "Welcome to Jim [info version]!"
set prompt ". "
set buf ""
while 1 {
set line [readline.readline $prompt]
if {[string length $line] == 0} {
continue
}
if {$buf eq ""} {
set buf $line
} else {
append buf \n $line
}
if {![info complete $buf]} {
set prompt "> "
continue
}
readline.addhistory $buf
catch {
uplevel #0 $buf
} error
if {$error ne ""} {
puts $error
}
set buf ""
set prompt ". "
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sr-master/msteveb_jimtcl.git
git@gitee.com:sr-master/msteveb_jimtcl.git
sr-master
msteveb_jimtcl
msteveb_jimtcl
master

搜索帮助