.tclshrc
author Oleksandr Gavenko <gavenkoa@gmail.com>
Tue, 04 Apr 2017 17:21:08 +0300
changeset 848 748e1e894339
parent 635 799341bb0ea7
permissions -rw-r--r--
Include current working directory into terminal emulator title (xterm/mintty supports "\e]0;...\a" command).

# -*- 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 prompt2 {} { return "\[0;31m...> \[0m" }
            } {
                proc prompt1 {} { return "tcl> " }
                proc prompt2 {} { return "...> " }
            }
        }
        ::tclreadline::Loop
    }
}