1# This pseudo-package is loaded from jimsh to add additional
2# paths to $auto_path and to source ~/.jimrc
3
4proc _jimsh_init {} {
5	rename _jimsh_init {}
6
7	# Add to the standard auto_path
8	lappend p {*}[split [env JIMLIB {}] $::tcl_platform(pathSeparator)]
9	lappend p {*}$::auto_path
10	lappend p [file dirname [info nameofexecutable]]
11	set ::auto_path $p
12
13	if {$::tcl_interactive && [env HOME {}] ne ""} {
14		foreach src {.jimrc jimrc.tcl} {
15			if {[file exists [env HOME]/$src]} {
16				uplevel #0 source [env HOME]/$src
17				break
18			}
19		}
20	}
21}
22
23if {$tcl_platform(platform) eq "windows"} {
24	set jim_argv0 [string map {\\ /} $jim_argv0]
25}
26
27_jimsh_init
28