.tclshrc
author Oleksandr Gavenko <gavenkoa@gmail.com>
Fri, 30 Aug 2013 00:28:47 +0300
changeset 634 89a1a77ad559
parent 632 500dcbf3445d
child 635 799341bb0ea7
permissions -rw-r--r--
Add check for tclreadline package and terminal color support.

# -*- mode: tcl -*-

if {$tcl_interactive} {
    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
    }
}