Currently tclsh only looks for ~/.tclshrc to run at startup. Many other interpreters provide more configuration, such as examining an environment variable or looking in $XDG_CONFIG_HOME.
A thin proposal would be to check (in order): $TCLSHRC, then check ~/.tclshrc, then check $XDG_CONFIG_HOME/tcl/tclshrc, then finally ~/.config/tcl/tclshrc using the first file that exists as the value of $tcl_rcFileName.
I was thinking about writing a TIP, but I wanted to first ask if there is a good reason this isn’t currently supported.
Anonymous <no_email@invalid.invalid> posted:
Currently tclsh only looks for ~/.tclshrc to run at startup. Many other
interpreters provide more configuration, such as examining an environment
variable or looking in $XDG_CONFIG_HOME.
A thin proposal would be to check (in order): $TCLSHRC, then check
~/.tclshrc, then check $XDG_CONFIG_HOME/tcl/tclshrc, then finally
~/.config/tcl/tclshrc using the first file that exists as the value of
$tcl_rcFileName.
I was thinking about writing a TIP, but I wanted to first ask if there is a >> good reason this isn’t currently supported.
The advantage of having a TIP is that it is very visible to the community
and that it can be discussed. One reason for Tcl not supporting it yet is that
it has not come to anybody's attention before ;). That, at the very least, is my reason.
What is the equivalent on other platforms, notably Windows, or is there none?
Regards,
Arjen
Am 13.10.2025 um 12:59 schrieb Arjen:
What is the equivalent on other platforms, notably Windows, or is there none?
Regards,
Arjen
Yes,
lease look to TIP 732, which addresses this:
https://core.tcl-lang.org/tips/doc/trunk/tip/732.md
On Windows, this is to my knowledge rarely used and is both, a waste of
time and a security risk. The security risk is specially on Windows, as
the initialization folder may be writable by other users.
Harald
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 1,072 |
Nodes: | 10 (0 / 10) |
Uptime: | 129:35:32 |
Calls: | 13,772 |
Files: | 186,986 |
D/L today: |
303 files (133M bytes) |
Messages: | 2,429,802 |