Skip to content
Tcl Source Code Artifact [c6386d3ae0]
Login

Artifact [c6386d3ae0]

Artifact c6386d3ae034c011924a32fd6a3b6971c7e21a5b:

Ticket change [c6386d3ae0] - Ticket [3432962fffffffff|3432962fff] <i>Some noninteractive invocations of tclsh still run .tclshrc</i> status still Pending with 4 other changes by karll on 2011-11-04 03:56:08.
D 2011-11-04T03:56:08
J icomment I\sam\sthe\sinventor\sof\s.tclshrc,\swhich\sfirst\sappeared\sin\sTclX\sin,\slike,\s1991.\s\sMy\sintention\sin\smaking\sit\sthat\stclshrc\sonly\sbe\sloaded\swhen\sTcl\sis\sused\sinteractively\swas\sto\sprevent\speoples'\stclshrc\sfiles\sfrom\schanging\sthe\sbehavior\sof\snoninteractive\sTcl\sprograms,\spreventing\s"spooky\sactions\sat\sa\sdistance"\sand\salso\strying\sto\skeep\speople\sfrom\saccidentally\sdistributing\sprograms\swith\ssubtle\sdependencies\son\ssomething\sthat's\sdone\sin\stheir\stclshrc\sfile,\sthat\sthey\smight\snot\seven\srealize,\slike\sloading\ssome\spackage.\n\nI'm\snot\sproposing\schanging\stcl_interactive\sor\show\sit\sgets\sset.\s\sI'm\snot\sproposing\schanging\show\sTcl\sbehaves\sif\sit\shas\sany\sarguments\son\sthe\scommand\sline,\swhich\sis\sby\sfar\sthe\smost\scommon\snoninteractive\suse.\sI'm\smerely\sasking\sfor\sthe\src\sfile\sto\snever\sbe\sloaded\sif\sTcl\sisn't\sinteractive,\swhereas\sright\snow\sit\s*almost*\snever\sis\sloaded\sif\sTcl\sisn't\sinteractive.\s\sWhat's\sthe\stest\sfor\ssetting\stcl_interactive?\s\sIt's\sset\sto\sthe\sresult\sof\sisatty(0).\n\nFor\sthe\sexample\sof\sa\sMakefile\saction,\slike\n\n\s\s\s\secho\s"pkg_mkIndex\s."\s|\stclsh\n\ntcl_interactive\swill\sproperly\sbe\s0.\s\sI\sassert\sthis\sis\struly\snoninteractive\sinvocation\sof\stclsh\s(you'll\snever\sget\sa\scommand\sprompt)\sand\sTcl\sagrees\swith\sme\sin\sthat\sit\sset\stcl_interactive\sto\s0.\s\sAll\sI'm\sasking\sis\sthat\stclshrc\snot\sbe\sloaded\swhen\sTcl\sisn't\sinteractive,\swhich\sis\saligned\swith\sits\soriginal\sintention.\n\nThe\sproblem\swas\sdiscovered\sby\sexactly\sthe\sproblem\sI\swas\strying\sto\sprevent.\s\sOne\sof\sour\sdevelopers\shad\sa\scustom\stclshrc\sfile\sthat\scaused\s'echo\s"pkg_mkIndex\s."\s|\stclsh'\sto\smalfunction,\sfor\sthem\sand\sthem\sonly,\sin\sa\ssubtle\sway\sthat\stook\shours\sto\strack\sdown.\n\n
J login karll
J mimetype text/plain
J username karll
K 3432962fffffffffffffffffffffffffffffffff
U karll
Z f24741761da34c7ecb517dd4b80d1d3a