Add check for tclreadline package and terminal color support.
--- a/.tclshrc Fri Aug 30 00:26:29 2013 +0300
+++ b/.tclshrc Fri Aug 30 00:28:47 2013 +0300
@@ -1,6 +1,15 @@
# -*- mode: tcl -*-
if {$tcl_interactive} {
- package require tclreadline
- ::tclreadline::Loop
+ catch {
+ package require tclreadline
+ namespace eval tclreadline {
+ if ([regexp "^(xterm|eterm-color)" "$::env(TERM)"]) {
+ proc prompt1 {} { return "\[0;31m\[1mtcl>\[0m " }
+ } {
+ proc prompt1 {} { return "tcl> " }
+ }
+ }
+ ::tclreadline::Loop
+ }
}