Skip to content

Instantly share code, notes, and snippets.

@avsej
Created July 5, 2012 09:24
Show Gist options
  • Select an option

  • Save avsej/3052537 to your computer and use it in GitHub Desktop.

Select an option

Save avsej/3052537 to your computer and use it in GitHub Desktop.
My .tclshrc
# vim:ft=tcl:
# GistID: 3052537
#
# apt-get install tcl-signal
if {$tcl_interactive} {
package require Signal
signal add SIGINT {}
if [info exists env(DISPLAY)] {
set env(TERM) xterm-color
} else {
set env(TERM) linux
}
set env(GTEST_ROOT) /home/avsej/code/cpp/googletest
set env(CFLAGS) {}
set env(CPPFLAGS) {}
set env(CXXFLAGS) {}
set env(PATH) /usr/local/sbin:/usr/sbin:/sbin:${env(HOME)}/.rbenv/shims:${env(HOME)}/.rbenv/bin:${env(HOME)}/script:${env(PATH)}
set env(EMAIL) [email protected]
package require tclreadline
namespace eval ::tclreadline {
proc ::tclreadline::prompt1 {} {
global env
if {[catch {set pwd [pwd]} tmp]} {set pwd "unable to get pwd" }
if [info exists env(HOME)] {
regsub $env(HOME) $pwd "~" pwd
}
set path [split $pwd "/"]
set pwd [lindex $path [expr [llength $path] - 1]]
return "$pwd $ "
}
}
::tclreadline::Loop
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment