# HG changeset patch # User Oleksandr Gavenko # Date 1377811727 -10800 # Node ID 89a1a77ad559781416348b36abd349664129187e # Parent ef2436c182765900e1c92826bf4d43d6647c4d70 Add check for tclreadline package and terminal color support. diff -r ef2436c18276 -r 89a1a77ad559 .tclshrc --- 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 + } }