.tclshrc
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sun, 12 Nov 2023 13:44:06 +0200
changeset 1022 17e43eca7401
parent 635 799341bb0ea7
permissions -rw-r--r--
magic-space expand sequence referring to the command history in place, so you have a chance to review before executing.

# -*- 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
    }
}