Error processing request

Parameters

CONTENT_LENGTH0
REQUEST_METHODGET
REQUEST_URI/revision/console?V=46
QUERY_STRINGV=46
CONTENT_TYPE
DOCUMENT_URI/revision/console
DOCUMENT_ROOT/var/www/nikit/nikit/nginx/../docroot
SCGI1
SERVER_PROTOCOLHTTP/1.1
HTTPSon
REMOTE_ADDR172.70.100.143
REMOTE_PORT21574
SERVER_PORT4443
SERVER_NAMEwiki.tcl-lang.org
HTTP_HOSTwiki.tcl-lang.org
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_X_FORWARDED_FOR3.15.235.196
HTTP_CF_RAY87a1ce2f5f8de25b-ORD
HTTP_X_FORWARDED_PROTOhttps
HTTP_CF_VISITOR{"scheme":"https"}
HTTP_ACCEPT*/*
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_CF_CONNECTING_IP3.15.235.196
HTTP_CDN_LOOPcloudflare
HTTP_CF_IPCOUNTRYUS

Body


Error

Unknow state transition: LINE -> END

-code

1

-level

0

-errorstack

INNER {returnImm {Unknow state transition: LINE -> END} {}} CALL {my render_wikit console http://purl.org/tcl/home/man/tcl8.5/TkCmd/console.htm\n\n'''\[DGP\]'''\ Many\ of\ the\ comments\ on\ this\ page\ might\ more\nusefully\ be\ made\ over\ in\ the\ Tracker\ at\ Tk\ Feature\nRequest\ 532540\ \[http://sourceforge.net/tracker/?func=detail&aid=532540&group_id=12997&atid=362997\].\n\nIt\ is\ my\ understanding\ that,\ for\ some\ strange\ reason,\ Tk\ does\ not\ yet\nsupport\ console\ on\ Unix.\ \ That\ seems\ very\ anti-Tk\ to\ me\ -\ why\ waste\ so\nmuch\ time\ being\ cross\ platform\ and\ then\ break\ it\ by\ not\ offering\ something\ so\ simple?\n\n\[RS\]\ I\ think\ it\ was\ the\ other\ way\ round:\ on\ Unixes,\ where\ Tcl\ originated,\ you'd\ start\ wish\ ''at''\ a\ console\ and\ be\ able\ to\ use\ its\ stdin/out/err\ from\ inside\ Tcl.\ Windows\ apps\ typically\ don't\ have\ these\ channels,\ so\ the\ \[Windows\ wish\ console\]\ was\ added\ to\ compensate\ for\ the\ loss.\ That\ WinTk's\ console\ grew\ more\ powerful\ (e.g.\ you\ can\ interact\ with\ the\ interpreter\ while\ a\ script\ is\ running,\ which\ you\ can't\ by\ default\ on\ Unix)\ justifies\ your\ wish\ to\ re-implant\ the\ original\ \"bugfix\"\ into\ generic\ Tk\ -\ or\ pull\ \[tkcon\]\ into\ the\ core?\n\n\[LV\]\ I\ was\ just\ thinking\ of\ the\ cases\ where\ tcl\ applications\ are\ launched\ from\ an\ application's\ exec\ command,\ or\ from\ another\ tk\ application,\ or\ from\ a\ Unix\ desktop\ icon\ or\ launcher,\ etc.\ The\ stdin\ and\ stdout\ in\ all\ these\ cases\ will\ not\ necessarily\ be\ an\ interactive\ terminal\ window.\n\n----\n\[LV\]\ over\ on\ \[manipulating\ data\ with\ tcl\]\ an\ interesting\ note\ came\ up\ -\ when\ the\ user\ invoked\ a\ piece\ of\ code\ making\ use\ of\ \[Plotchart\]\ from\ Tkcon\ on\ Windows\ XP,\ the\ console\ command\ failed,\ but\ if\ they\ invoked\ it\ from\ a\ wish\ console,\ the\ code\ worked\ fine.\ \n\n----\n\[LV\]\ Okay,\ so\ what\ is\ an\ example\ of\ portable\ code\ to\ make\ up\ for\ the\ fact\ that\nconsole\ show\ does\ not\ work\ on\ many\ platforms?\n\n\[RJM\]\ Well,\ I\ think\ this\ question\ is\ worth\ a\ separate\ page:\ \[console\ platform\ portability\]\n\n----\nCertainly\ I\ can\ see\ having\ at\ least\ the\ minimal\ console\ everywhere\ -I\ would\nalso\ be\ heartily\ in\ favor\ of\ tkcon\ or\ something\ better\ being\ the\ default\nconsole\ across\ platforms.\n\nOf\ course,\ in\ both\ cases,\ a\ \[TIP\]\ is\ going\ to\ be\ needed...\n----\nActually,\ would\ a\ TIP\ really\ be\ needed\ to\ activate\ a\ command\ that\ was\ already\ present\ on\ the\ other\ platforms?\n----\nSee\ \[console\ for\ Unix\].\n\n\[JL\]\ Why\ hasn't\ the\ console\ ever\ been\ made\ available\ on\ Unix?\ (I've\ checked\ up\ to\ 8.4)\ \ console.n\ and\ console.tcl\ are\ already\ installed,\ and\ it\ is\ useful\ for\ simple\ interactive\ debugging.\ All\ that's\ needed\ is\ to\ supply\ the\ 'console'\ command,\ or\ use\ something\ like\ the\ workaround\ above.\n\nThis\ is\ not\ the\ same\ as\ adding\ tkcon.\ All\ I\ want\ is\ just\ the\ same,\ simple\ console\ across\ all\ platforms.\n----\n\[LV\]\ I\ don't\ recall\ whether\ a\ \[TIP\]\ has\ been\ filed\ to\ make\ this\ happen.\n\n----\n\[RS\]\ uses\ the\ following\ binding\ to\ have\ a\ console\ for\ debugging\ pop\ up\ when\ needed:\n\ bind\ .\ ?\ \{catch\ \{console\ show\}\}\n\n-----\n\[RA2\]\ Hi!\ I'd\ like\ to\ attach\ a\ console\ to\ my\ TCL\ program.\ What\ code\ do\ I\ enter,\ where\ and\ how\ to\ start\ a\ console\ maximized\ (100%)?\ Thanks\ I\ appreciate!\ \n\n\[RS\]:\ See\ \[console\]\ and\ \[Maximizing\ a\ toplevel\ window\],\ but\ here's\ what\ works\ for\ me\ on\ Win\ XP:\n\ %\ console\ show\n\ %\ console\ eval\ \{wm\ state\ .\ zoomed\}\n\n\[RA2\]\ Thanks\ so\ much\ Richard!\ You\ are\ very\ kind!\ \ \n----\n\n\[MG\]\ Feb\ 16th\ 2005\ -\ Out\ of\ sheer\ curiousity,\ I\ had\ a\ quick\ poke\ around\ to\ see\ if\ I\ could\ find\ how\ to\ change\ the\ prompt\ on\ the\ console,\ and\ found\ this\ (in\ ActiveTcl\ 8.4.9.0\ on\ WinXP):\n\ \ (Griffiths)\ 2\ %\ console\ eval\ \{set\ ::tk::console::defaultPrompt\}\n\ \ subst\ \{(\[file\ tail\ \[pwd\]\])\ \[history\ nextid\]\ %\ \}\n\nI\ don't\ know\ if\ that's\ the\ default\ on\ all\ platforms,\ and\ I\ doubt\ that\ this\ is\ the\ Right\ Way\ to\ change\ the\ prompt\ (I\ think\ the\ internals\ of\ the\ console\ are\ subject\ to\ change\ without\ notification),\ but\ for\ now\ at\ least\ this\ works..\n\n\ \ console\ eval\ \{set\ ::tk::console::defaultPrompt\ \{return\ \"%\ \"\}\}\n\ \ proc\ %\ \{args\}\ \{\n\ \ \ \ \ eval\ \$args\n\ \ \}\n\nThat\ sets\ the\ prompt\ to\ \"%\ \",\ so\ that\ you\ can\ copy\ things\ you've\ typed\ into\ the\ console\ and\ paste\ them\ back\ in\ to\ run\ them\ again\ without\ having\ to\ remove\ the\ prompt.\ If\ you\ want\ the\ same\ effect\ but\ you\ want\ to\ keep\ the\ line\ number,\ just\ use\n\ \ console\ eval\ \{set\ ::tk::console::defaultPrompt\ \{subst\ \{%\ (\[history\ nextid\])\ \}\}\n\ \ proc\ %\ \{lineNumber\ args\}\ \{\n\ \ \ \ eval\ \$args\n\ \ \}\n\n----\n2005-04-23\ \[Derek\ Peschel\]\ Evidently\ the\ discussion\ goes\ here\ and\ the\ code\ goes\ on\ the\ \[console\ for\ UNIX\]\ page.\nSee\ my\ questions\ in\ \[Ask,\ and\ it\ shall\ be\ given\ #\ 2\].\nI've\ put\ these\ items\ here\ because\ they\ aren't\ questions.\n\nBrian\ Theado\ and\ I\ and\ maybe\ others\ have\ changed\ the\ \[console\ for\ UNIX\]\ script\ as\ part\ of\ the\ TkOutline\ project\ \[http://tkoutline.sourceforge.net/wiki/\].\nAfter\ someone\ helps\ answer\ two\ questions\ I\ have,\ I\ think\ the\ changes\ should\ be\ propagated\ back\ here.\nThey\ are:\n\ \ \ 1.\ The\ script\ has\ a\ few\ more\ comments.\ \ I\ also\ changed\ the\ punctuation\ of\ the\ comments\ for\ no\ other\ reason\ than\ personal\ taste.\n\ \ \ 2.\ It\ uses\ the\ '''\$_'''\ variable\ when\ evaluating\ the\ library\ '''console.tcl'''\ file\ as\ well\ as\ when\ checking\ it\ for\ readability.\ \ I\ changed\ the\ name\ of\ the\ library\ file\ (so\ I\ could\ have\ my\ own\ version\ with\ a\ bigger\ font)\ and\ wasted\ some\ time\ wondering\ why\ my\ changes\ weren't\ being\ read.\n\ \ \ 3.\ Maybe\ more\;\ I\ haven't\ looked\ in\ detail.\n\n\[Brian\ Theado\]\ -\ I'm\ pretty\ sure\ my\ console.tcl\ code\ is\ verbatim\ from\ \[console\ for\ UNIX\]--I've\ made\ no\ changes\ to\ it.\ \ I\ don't\ think\ anyone\ would\ object\ to\ enhancing\ the\ comments\ in\ the\ code\ on\ that\ page.\n\nAs\ mentioned\ in\ private\ email,\ I\ recommend\ against\ having\ your\ own\ copy\ of\ the\ library\ console.tcl\ and\ instead\ use\ the\ \[\[console\ eval\]\ command\ to\ get\ access\ to\ the\ console's\ interpreter\ and\ change\ the\ font.\ i.e.\n\ console\ eval\ \{.console\ configure\ -font\ \{Courier\ 14\}\}\n\n----\n'''Examples\ illustrating\ the\ console\ interpreter\ vs.\ the\ main\ Tcl\ interpreter'''\n\nShow\ the\ windows\ available\ to\ the\ main\ application\ interpreter:\n\ winfo\ children\ .\nShow\ the\ windows\ that\ makeup\ the\ console\ toplevel:\n\ console\ eval\ \{winfo\ children\ .\}\n\nText\ typed\ into\ the\ console\ is\ read\ by\ the\ console\ interpreter\ and\ the\ command\ is\ passed\ to\ the\ main\ application\ interpreter.\ \ The\ \[\[console\ eval\]\ command\ provides\ access\ to\ the\ console's\ interpreter.\n\nThe\ console\ uses\ a\ separate\ interpreter\ likely\ in\ order\ to\ avoid\ confusion/collision\ of\ window\ names\ and\ command\ names\ that\ are\ used\ by\ the\ console.\ \ By\ having\ this\ interpreter,\ these\ windows\ and\ commands\ are\ hidden\ unless\ the\ \[\[console\ eval\]\ command\ is\ used.\n\n----\n08/31/2005\ \[BHE\]\ I\ added\ an\ extra\ menu\ to\ the\ menubar\ for\ 'Options'\ and\ created\ an\ (un)word\ wrap\ option.\ \ It\ required\ that\ I\ also\ add\ a\ horizontal\ scrollbar\ and\ change\ the\ geometry\ manager\ from\ 'pack'\ to\ 'grid'.\n\nAdd\ this\ block\ to\ proc\ tk::ConsoleInit\ before\ the\ help\ menu\ is\ added:\n\n\ \ \ \ \ \ \ .menubar\ add\ cascade\ -label\ Options\ -menu\ .menubar.options\ -underline\ 0\n\ \ \ \ \ \ \ menu\ .menubar.options\ -tearoff\ 0\n\ \ \ \ \ \ \ .menubar.options\ add\ checkbutton\ -label\ \"Word\ Wrap\"\ \\\n\ \ \ \ \ \ \ \ \ \ -underline\ 0\ -command\ tk::ConsoleWrap\ -variable\ ::tk::console::wrapLines\ \\\n\ \ \ \ \ \ \ \ \ \ -onvalue\ char\ -offvalue\ none\n\ \ \ \ \ \ \ variable\ ::tk::console::wrapLines\ char\n\nAnd\ then\ add\ the\ horizontal\ scrollbar\ to\ proc\ tk::ConsoleInit\ and\ change\ the\ geometry\ manager:\n\n\ \ \ \ set\ con\ \[text\ .console\ \ -yscrollcommand\ \[list\ .sb\ set\]\ -xscrollcommand\ \[list\ .hsb\ set\]\ -setgrid\ true\]\n\ \ \ \ scrollbar\ .sb\ -command\ \[list\ \$con\ yview\]\n\ \ \ \ scrollbar\ .hsb\ -orient\ horizontal\ -command\ \[list\ \$con\ xview\]\n\ \ \ \ #pack\ .sb\ -side\ right\ -fill\ both\n\ \ \ \ #pack\ \$con\ -fill\ both\ -expand\ 1\ -side\ left\n\ \ \ \ grid\ \$con\ .sb\ -sticky\ nsew\n\ \ \ \ grid\ .hsb\ -column\ 0\ -row\ 1\ -sticky\ ew\n\ \ \ \ grid\ remove\ .hsb\n\ \ \ \ \n\ \ \ \ grid\ columnconfigure\ .\ 0\ -weight\ 1\n\ \ \ \ grid\ rowconfigure\ .\ 0\ -weight\ 1\n\nand\ finally,\ add\ this\ procedure:\n\n\ #\ ::tk::ConsoleWrap\ --\n\ #\n\ #\ Toggles\ the\ word\ wrapping\ in\ the\ console\n\ #\n\ #\ Arguments:\n\ #\ None.\n\ \n\ proc\ tk::ConsoleWrap\ \{\}\ \{\n\ \ \ \ \ variable\ ::tk::console::wrapLines\n\ \ \ \ \ .console\ config\ -wrap\ \$::tk::console::wrapLines\n\ \ \ \ \ if\ \{\$::tk::console::wrapLines\ ==\ \"char\"\}\ \{\n\ \ \ \ \ \ \ \ \ #\ hide\ the\ hscrollbar\n\ \ \ \ \ \ \ \ \ grid\ remove\ .hsb\n\ \ \ \ \ \ \ \ \ \n\ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ grid\ .hsb\n\ \ \ \ \ \}\n\ \}\n\nIt\ might\ be\ a\ good\ idea\ to\ add\ a\ font\ dialog\ option\ to\ the\ Options\ menu\ as\ well.\n\n\[LV\]\ One\ of\ the\ frustrating\ things\ when\ using\ GUI\ applications\ is\ finding\ that\ they\ haven't\ made\ it\ easy\ to\ change\ the\ font\ size.\ \ Some\ authors\ just\ point\ people\ to\ resource\ files\ or\ suggest\ they\ hack\ the\ code.\ \ But\ adding\ something\ like\ a\ font\ dialog\ option\ would\ be\ a\ great\ step\ forward.\ \n-----\n'''Inline\ image\ in\ console:'''\ This\ is\ a\ good\ one-liner\ with\ fascinating\ effect:\n\n\[WikiDbImage\ see_inline.jpg\]\n\n\ proc\ see\ name\ \{\n\ \ \ \ console\ eval\ \[string\ map\ \[list\ @\ \$name\]\ \{.console\ image\ create\ end\ -image\ \[image\ create\ photo\ -file\ @\]\}\]\n\ \}\nTested\ to\ work\ on\ Windows\ XP\ and\ CE\ (\[eTcl\]\ console).\ With\ \[Img\]\ loaded\ before\ for\ extra\ formats,\ a\ lot\ of\ images\ can\ be\ inspected\ interactively...\ \[RS\]\ 2006-01-16\n\n\[NEM\]\ See\ the\ \[TkCon\]\ page\ for\ a\ version\ for\ that\ console.\ -\ \[RS\]:\ \[NEM\]\ convinced\ me\ that\ to\ do\ it\nin\ two\ lines\ can\ make\ more\ robust\ code\ (say\ when\ spaces\ are\ in\ the\ filename).\ So\ the\ revised\ version\ is:\n\ proc\ see\ name\ \ \{\n\ \ \ set\ im\ \[console\ eval\ \[list\ image\ create\ photo\ -file\ \$name\]\]\n\ \ \ console\ eval\ \[list\ .console\ image\ create\ end\ -image\ \$im\]\n\ \}\n----\n'''Console\ menu\ magic''':\ Put\ the\ commands\ you\ need\ most\ often\ into\ existing\ or\ newly\ created\ sub-menus.\ This\ way\ you\ can\ turn\ the\ \[console\]\ into\ your\ custom\ \[IDE\],\ step\ by\ step.\ (\[RS\]\ 2006-01-19)\n\ \n''Add\ a\ heading\ to\ the\ console\ menu:''\n\ \ console\ eval\ \{\n\ \ \ \ .menubar\ add\ casc\ -label\ Extra\ -menu\ \[menu\ .menubar.extra\ -tearoff\ 0\]\n\ \}\n''Add\ an\ item\ to\ the\ console\ menu:''\ \n\ proc\ menu+\ \{head\ label\ cmd\}\ \{\n\ \ \ set\ cmd2\ \[list\ consoleinterp\ eval\ \$cmd\]\n\ \ \ console\ eval\ \[list\ .menubar.\$head\ add\ command\ -label\ \$label\ -command\ \$cmd2\]\n\ \}\nUsage\ example\ (with\ the\ \"Extra\"\ menu\ created\ just\ before):\n\ menu+\ extra\ auto_mkindex\ \{auto_mkindex\ .\ *.tcl\}\n\nSee\ also\ \[Extending\ the\ eTcl\ console\]\ -\ except\ for\ the\ toolbar\ stuff,\ what's\ said\ there\ applies\ to\ all\ consoles.\n\nSee\ also\ \[a\ minimal\ console\].\n\nThe\ wiki\ page\ \[deep\ console\]\ covers\ an\ enhanced\ console.\n----\n\[LV\]\ 2007\ June\ 05\ -\ is\ there\ a\ way\ to\ add\ code\ to\ my\ application\ so\ that\ if\ the\ application\ attempts\ to\ write\ to\ \[stdout\],\ \[stderr\],\ or\ attempts\ to\ read\ from\ \[stdin\],\ then\ the\ console\ is\ shown,\ but\ otherwise,\ it\ remains\ hidden?\n\n\[MG\]\ You\ could\ overload\ \[puts\]\ (and\ probably\ \[read\]\ and\ \[gets\]\ as\ well)\ to\ run\ a\ \[\[console\ show\]\]\ when\ they're\ used\ on\ one\ of\ those\ channels.\ This\ isn't\ a\ complete\ solution,\ though\ -\ I'm\ fairly\ sure\ there\ are\ commands\ that\ can\ take\ a\ -channel\ arg\ to\ read\ or\ output\ to\ a\ channel\ directly\ which\ don't\ go\ through\ \[puts\]\ or\ \[gets\]/\[read\].\ It's\ the\ closest\ I\ can\ think\ of,\ though...\n----\n'''Set\ the\ maximum\ number\ of\ lines'''\n===\nconsole\ eval\ \{set\ ::tk::console::maxLines\ 10000\}\n===\n----\n\n'''Add\ color\ and\ style\ to\ console\ output'''\n===\nproc\ cputs\ \{dest\ string\}\ \{\n\ \ \ \ if\ \{\ !\ \[info\ exist\ ::tk::my_color_set\]\ \}\ \{\n\ \ \ \ \ \ \ \ set\ ::tk::my_color_set\ 1\n\ \ \ \ \ \ \ \ console\ eval\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ .console\ tag\ configure\ green\ \ \ \ \ \ \ \ \ \ \ \ -foreground\ green\ \ -font\ \{courier\ 20\ bold\}\n\ \ \ \ \ \ \ \ \ \ \ \ .console\ tag\ configure\ yellowonblack\ \ \ \ -foreground\ yellow\ -background\ black\n\ \ \ \ \ \ \ \ \ \ \ \ .console\ tag\ configure\ yellow\ \ \ \ \ \ \ \ \ \ \ -foreground\ yellow\n\ \ \ \ \ \ \ \ \ \ \ \ .console\ tag\ configure\ whiteonred\ \ \ \ \ \ \ -foreground\ white\ -background\ red\n\ \ \ \ \ \ \ \ \ \ \ \ .console\ tag\ configure\ red\ \ \ \ \ \ \ \ \ \ \ \ \ \ -foreground\ red\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \}\n\ \ \ \ \ \ \ \ console\ eval\ \[list\ ::tk::ConsoleOutput\ \$dest\ \$string\]\n\n\}\n\n#\ demo\ use\n\ncputs\ yellowonblack\ \"this\ is\ a\ sample\ warning\"\ \;\ cputs\ normal\ \"\\n\"\ncputs\ whiteonred\ \ \ \ \"this\ will\ extend\ to\ window\ border\\n\"\ncputs\ green\ \"go\ ahead,\ the\ light\ is\ green\\n\"\n\n#Any\ unknown\ color\ reverts\ to\ black\ on\ white\ -\ e.g.\ use\ of\ the\ tag\ normal\ here.\ \n#Tags\ can\ be\ reconfigured\ and\ will\ affect\ all\ previous\ cputs\ output.\n\n===\n\[ET\]\ The\ above\ provides\ an\ alternative\ to\ puts,\ this\ lets\ you\ define\ your\ own\ text\ formatting.\ The\ actual\ console\ code\ defines\ a\ number\ of\ tags\ already,\ (stderr\ =\ red,\ stdin\ =\ blue,\ and\ others).\ This\ is\ why\ \[\[puts\ stderr\ \{string\}\]\]\ writes\ to\ the\ console\ in\ red.\ \n\nThis\ does\ not\ output\ a\ newline.\ You\ can\ add\ the\ \\n\ escape\ in\ your\ string.\ You\ can\ intersperse\ with\ puts\ statements,\ as\ these\ eventually\ all\ get\ to\ the\ ConsoleOutput\ code.\n\[ET\]\ old\ version\ would\ bug\ out\ with\ a\ \}\ in\ the\ text\ string.\n\n===\n\[ET\]\ I've\ recently\ tried\ out\ a\ new\ version\ of\ tcl/tk\ (8.6b1.1\ as\ of\ 6/6/2010)\ and\ now\ the\ added\ widgets\ I've\ included\ into\ my\ console\ get\ focus\ when\ I\ type\ <tab>\ in\ the\ console\ window\ (to\ fill\ in\ such\ things\ as\ variable\ names\ -\ like\ tab\ in\ a\ unix\ shell).\ Since\ <escape>\ does\ the\ same\ function\ as\ <tab>\ in\ the\ console,\ this\ is\ not\ a\ showstopper\ but\ is\ just\ rather\ annoying.\ I\ haven't\ been\ able\ to\ figure\ out\ what\ has\ changed\ and\ how\ to\ fix\ it.\n\n\n!!!!!!\n\[Arts\ and\ crafts\ of\ Tcl-Tk\ programming\]\n%|\ \[Tk\ syntax\ help\]\ |\ \[Category\ Command\],\ a\ part\ of\ the\ \[Tk\]\ package\ |\ \[Category\ Platform\ Issues\]\ |%\n!!!!!! regexp2} CALL {my render console http://purl.org/tcl/home/man/tcl8.5/TkCmd/console.htm\n\n'''\[DGP\]'''\ Many\ of\ the\ comments\ on\ this\ page\ might\ more\nusefully\ be\ made\ over\ in\ the\ Tracker\ at\ Tk\ Feature\nRequest\ 532540\ \[http://sourceforge.net/tracker/?func=detail&aid=532540&group_id=12997&atid=362997\].\n\nIt\ is\ my\ understanding\ that,\ for\ some\ strange\ reason,\ Tk\ does\ not\ yet\nsupport\ console\ on\ Unix.\ \ That\ seems\ very\ anti-Tk\ to\ me\ -\ why\ waste\ so\nmuch\ time\ being\ cross\ platform\ and\ then\ break\ it\ by\ not\ offering\ something\ so\ simple?\n\n\[RS\]\ I\ think\ it\ was\ the\ other\ way\ round:\ on\ Unixes,\ where\ Tcl\ originated,\ you'd\ start\ wish\ ''at''\ a\ console\ and\ be\ able\ to\ use\ its\ stdin/out/err\ from\ inside\ Tcl.\ Windows\ apps\ typically\ don't\ have\ these\ channels,\ so\ the\ \[Windows\ wish\ console\]\ was\ added\ to\ compensate\ for\ the\ loss.\ That\ WinTk's\ console\ grew\ more\ powerful\ (e.g.\ you\ can\ interact\ with\ the\ interpreter\ while\ a\ script\ is\ running,\ which\ you\ can't\ by\ default\ on\ Unix)\ justifies\ your\ wish\ to\ re-implant\ the\ original\ \"bugfix\"\ into\ generic\ Tk\ -\ or\ pull\ \[tkcon\]\ into\ the\ core?\n\n\[LV\]\ I\ was\ just\ thinking\ of\ the\ cases\ where\ tcl\ applications\ are\ launched\ from\ an\ application's\ exec\ command,\ or\ from\ another\ tk\ application,\ or\ from\ a\ Unix\ desktop\ icon\ or\ launcher,\ etc.\ The\ stdin\ and\ stdout\ in\ all\ these\ cases\ will\ not\ necessarily\ be\ an\ interactive\ terminal\ window.\n\n----\n\[LV\]\ over\ on\ \[manipulating\ data\ with\ tcl\]\ an\ interesting\ note\ came\ up\ -\ when\ the\ user\ invoked\ a\ piece\ of\ code\ making\ use\ of\ \[Plotchart\]\ from\ Tkcon\ on\ Windows\ XP,\ the\ console\ command\ failed,\ but\ if\ they\ invoked\ it\ from\ a\ wish\ console,\ the\ code\ worked\ fine.\ \n\n----\n\[LV\]\ Okay,\ so\ what\ is\ an\ example\ of\ portable\ code\ to\ make\ up\ for\ the\ fact\ that\nconsole\ show\ does\ not\ work\ on\ many\ platforms?\n\n\[RJM\]\ Well,\ I\ think\ this\ question\ is\ worth\ a\ separate\ page:\ \[console\ platform\ portability\]\n\n----\nCertainly\ I\ can\ see\ having\ at\ least\ the\ minimal\ console\ everywhere\ -I\ would\nalso\ be\ heartily\ in\ favor\ of\ tkcon\ or\ something\ better\ being\ the\ default\nconsole\ across\ platforms.\n\nOf\ course,\ in\ both\ cases,\ a\ \[TIP\]\ is\ going\ to\ be\ needed...\n----\nActually,\ would\ a\ TIP\ really\ be\ needed\ to\ activate\ a\ command\ that\ was\ already\ present\ on\ the\ other\ platforms?\n----\nSee\ \[console\ for\ Unix\].\n\n\[JL\]\ Why\ hasn't\ the\ console\ ever\ been\ made\ available\ on\ Unix?\ (I've\ checked\ up\ to\ 8.4)\ \ console.n\ and\ console.tcl\ are\ already\ installed,\ and\ it\ is\ useful\ for\ simple\ interactive\ debugging.\ All\ that's\ needed\ is\ to\ supply\ the\ 'console'\ command,\ or\ use\ something\ like\ the\ workaround\ above.\n\nThis\ is\ not\ the\ same\ as\ adding\ tkcon.\ All\ I\ want\ is\ just\ the\ same,\ simple\ console\ across\ all\ platforms.\n----\n\[LV\]\ I\ don't\ recall\ whether\ a\ \[TIP\]\ has\ been\ filed\ to\ make\ this\ happen.\n\n----\n\[RS\]\ uses\ the\ following\ binding\ to\ have\ a\ console\ for\ debugging\ pop\ up\ when\ needed:\n\ bind\ .\ ?\ \{catch\ \{console\ show\}\}\n\n-----\n\[RA2\]\ Hi!\ I'd\ like\ to\ attach\ a\ console\ to\ my\ TCL\ program.\ What\ code\ do\ I\ enter,\ where\ and\ how\ to\ start\ a\ console\ maximized\ (100%)?\ Thanks\ I\ appreciate!\ \n\n\[RS\]:\ See\ \[console\]\ and\ \[Maximizing\ a\ toplevel\ window\],\ but\ here's\ what\ works\ for\ me\ on\ Win\ XP:\n\ %\ console\ show\n\ %\ console\ eval\ \{wm\ state\ .\ zoomed\}\n\n\[RA2\]\ Thanks\ so\ much\ Richard!\ You\ are\ very\ kind!\ \ \n----\n\n\[MG\]\ Feb\ 16th\ 2005\ -\ Out\ of\ sheer\ curiousity,\ I\ had\ a\ quick\ poke\ around\ to\ see\ if\ I\ could\ find\ how\ to\ change\ the\ prompt\ on\ the\ console,\ and\ found\ this\ (in\ ActiveTcl\ 8.4.9.0\ on\ WinXP):\n\ \ (Griffiths)\ 2\ %\ console\ eval\ \{set\ ::tk::console::defaultPrompt\}\n\ \ subst\ \{(\[file\ tail\ \[pwd\]\])\ \[history\ nextid\]\ %\ \}\n\nI\ don't\ know\ if\ that's\ the\ default\ on\ all\ platforms,\ and\ I\ doubt\ that\ this\ is\ the\ Right\ Way\ to\ change\ the\ prompt\ (I\ think\ the\ internals\ of\ the\ console\ are\ subject\ to\ change\ without\ notification),\ but\ for\ now\ at\ least\ this\ works..\n\n\ \ console\ eval\ \{set\ ::tk::console::defaultPrompt\ \{return\ \"%\ \"\}\}\n\ \ proc\ %\ \{args\}\ \{\n\ \ \ \ \ eval\ \$args\n\ \ \}\n\nThat\ sets\ the\ prompt\ to\ \"%\ \",\ so\ that\ you\ can\ copy\ things\ you've\ typed\ into\ the\ console\ and\ paste\ them\ back\ in\ to\ run\ them\ again\ without\ having\ to\ remove\ the\ prompt.\ If\ you\ want\ the\ same\ effect\ but\ you\ want\ to\ keep\ the\ line\ number,\ just\ use\n\ \ console\ eval\ \{set\ ::tk::console::defaultPrompt\ \{subst\ \{%\ (\[history\ nextid\])\ \}\}\n\ \ proc\ %\ \{lineNumber\ args\}\ \{\n\ \ \ \ eval\ \$args\n\ \ \}\n\n----\n2005-04-23\ \[Derek\ Peschel\]\ Evidently\ the\ discussion\ goes\ here\ and\ the\ code\ goes\ on\ the\ \[console\ for\ UNIX\]\ page.\nSee\ my\ questions\ in\ \[Ask,\ and\ it\ shall\ be\ given\ #\ 2\].\nI've\ put\ these\ items\ here\ because\ they\ aren't\ questions.\n\nBrian\ Theado\ and\ I\ and\ maybe\ others\ have\ changed\ the\ \[console\ for\ UNIX\]\ script\ as\ part\ of\ the\ TkOutline\ project\ \[http://tkoutline.sourceforge.net/wiki/\].\nAfter\ someone\ helps\ answer\ two\ questions\ I\ have,\ I\ think\ the\ changes\ should\ be\ propagated\ back\ here.\nThey\ are:\n\ \ \ 1.\ The\ script\ has\ a\ few\ more\ comments.\ \ I\ also\ changed\ the\ punctuation\ of\ the\ comments\ for\ no\ other\ reason\ than\ personal\ taste.\n\ \ \ 2.\ It\ uses\ the\ '''\$_'''\ variable\ when\ evaluating\ the\ library\ '''console.tcl'''\ file\ as\ well\ as\ when\ checking\ it\ for\ readability.\ \ I\ changed\ the\ name\ of\ the\ library\ file\ (so\ I\ could\ have\ my\ own\ version\ with\ a\ bigger\ font)\ and\ wasted\ some\ time\ wondering\ why\ my\ changes\ weren't\ being\ read.\n\ \ \ 3.\ Maybe\ more\;\ I\ haven't\ looked\ in\ detail.\n\n\[Brian\ Theado\]\ -\ I'm\ pretty\ sure\ my\ console.tcl\ code\ is\ verbatim\ from\ \[console\ for\ UNIX\]--I've\ made\ no\ changes\ to\ it.\ \ I\ don't\ think\ anyone\ would\ object\ to\ enhancing\ the\ comments\ in\ the\ code\ on\ that\ page.\n\nAs\ mentioned\ in\ private\ email,\ I\ recommend\ against\ having\ your\ own\ copy\ of\ the\ library\ console.tcl\ and\ instead\ use\ the\ \[\[console\ eval\]\ command\ to\ get\ access\ to\ the\ console's\ interpreter\ and\ change\ the\ font.\ i.e.\n\ console\ eval\ \{.console\ configure\ -font\ \{Courier\ 14\}\}\n\n----\n'''Examples\ illustrating\ the\ console\ interpreter\ vs.\ the\ main\ Tcl\ interpreter'''\n\nShow\ the\ windows\ available\ to\ the\ main\ application\ interpreter:\n\ winfo\ children\ .\nShow\ the\ windows\ that\ makeup\ the\ console\ toplevel:\n\ console\ eval\ \{winfo\ children\ .\}\n\nText\ typed\ into\ the\ console\ is\ read\ by\ the\ console\ interpreter\ and\ the\ command\ is\ passed\ to\ the\ main\ application\ interpreter.\ \ The\ \[\[console\ eval\]\ command\ provides\ access\ to\ the\ console's\ interpreter.\n\nThe\ console\ uses\ a\ separate\ interpreter\ likely\ in\ order\ to\ avoid\ confusion/collision\ of\ window\ names\ and\ command\ names\ that\ are\ used\ by\ the\ console.\ \ By\ having\ this\ interpreter,\ these\ windows\ and\ commands\ are\ hidden\ unless\ the\ \[\[console\ eval\]\ command\ is\ used.\n\n----\n08/31/2005\ \[BHE\]\ I\ added\ an\ extra\ menu\ to\ the\ menubar\ for\ 'Options'\ and\ created\ an\ (un)word\ wrap\ option.\ \ It\ required\ that\ I\ also\ add\ a\ horizontal\ scrollbar\ and\ change\ the\ geometry\ manager\ from\ 'pack'\ to\ 'grid'.\n\nAdd\ this\ block\ to\ proc\ tk::ConsoleInit\ before\ the\ help\ menu\ is\ added:\n\n\ \ \ \ \ \ \ .menubar\ add\ cascade\ -label\ Options\ -menu\ .menubar.options\ -underline\ 0\n\ \ \ \ \ \ \ menu\ .menubar.options\ -tearoff\ 0\n\ \ \ \ \ \ \ .menubar.options\ add\ checkbutton\ -label\ \"Word\ Wrap\"\ \\\n\ \ \ \ \ \ \ \ \ \ -underline\ 0\ -command\ tk::ConsoleWrap\ -variable\ ::tk::console::wrapLines\ \\\n\ \ \ \ \ \ \ \ \ \ -onvalue\ char\ -offvalue\ none\n\ \ \ \ \ \ \ variable\ ::tk::console::wrapLines\ char\n\nAnd\ then\ add\ the\ horizontal\ scrollbar\ to\ proc\ tk::ConsoleInit\ and\ change\ the\ geometry\ manager:\n\n\ \ \ \ set\ con\ \[text\ .console\ \ -yscrollcommand\ \[list\ .sb\ set\]\ -xscrollcommand\ \[list\ .hsb\ set\]\ -setgrid\ true\]\n\ \ \ \ scrollbar\ .sb\ -command\ \[list\ \$con\ yview\]\n\ \ \ \ scrollbar\ .hsb\ -orient\ horizontal\ -command\ \[list\ \$con\ xview\]\n\ \ \ \ #pack\ .sb\ -side\ right\ -fill\ both\n\ \ \ \ #pack\ \$con\ -fill\ both\ -expand\ 1\ -side\ left\n\ \ \ \ grid\ \$con\ .sb\ -sticky\ nsew\n\ \ \ \ grid\ .hsb\ -column\ 0\ -row\ 1\ -sticky\ ew\n\ \ \ \ grid\ remove\ .hsb\n\ \ \ \ \n\ \ \ \ grid\ columnconfigure\ .\ 0\ -weight\ 1\n\ \ \ \ grid\ rowconfigure\ .\ 0\ -weight\ 1\n\nand\ finally,\ add\ this\ procedure:\n\n\ #\ ::tk::ConsoleWrap\ --\n\ #\n\ #\ Toggles\ the\ word\ wrapping\ in\ the\ console\n\ #\n\ #\ Arguments:\n\ #\ None.\n\ \n\ proc\ tk::ConsoleWrap\ \{\}\ \{\n\ \ \ \ \ variable\ ::tk::console::wrapLines\n\ \ \ \ \ .console\ config\ -wrap\ \$::tk::console::wrapLines\n\ \ \ \ \ if\ \{\$::tk::console::wrapLines\ ==\ \"char\"\}\ \{\n\ \ \ \ \ \ \ \ \ #\ hide\ the\ hscrollbar\n\ \ \ \ \ \ \ \ \ grid\ remove\ .hsb\n\ \ \ \ \ \ \ \ \ \n\ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ grid\ .hsb\n\ \ \ \ \ \}\n\ \}\n\nIt\ might\ be\ a\ good\ idea\ to\ add\ a\ font\ dialog\ option\ to\ the\ Options\ menu\ as\ well.\n\n\[LV\]\ One\ of\ the\ frustrating\ things\ when\ using\ GUI\ applications\ is\ finding\ that\ they\ haven't\ made\ it\ easy\ to\ change\ the\ font\ size.\ \ Some\ authors\ just\ point\ people\ to\ resource\ files\ or\ suggest\ they\ hack\ the\ code.\ \ But\ adding\ something\ like\ a\ font\ dialog\ option\ would\ be\ a\ great\ step\ forward.\ \n-----\n'''Inline\ image\ in\ console:'''\ This\ is\ a\ good\ one-liner\ with\ fascinating\ effect:\n\n\[WikiDbImage\ see_inline.jpg\]\n\n\ proc\ see\ name\ \{\n\ \ \ \ console\ eval\ \[string\ map\ \[list\ @\ \$name\]\ \{.console\ image\ create\ end\ -image\ \[image\ create\ photo\ -file\ @\]\}\]\n\ \}\nTested\ to\ work\ on\ Windows\ XP\ and\ CE\ (\[eTcl\]\ console).\ With\ \[Img\]\ loaded\ before\ for\ extra\ formats,\ a\ lot\ of\ images\ can\ be\ inspected\ interactively...\ \[RS\]\ 2006-01-16\n\n\[NEM\]\ See\ the\ \[TkCon\]\ page\ for\ a\ version\ for\ that\ console.\ -\ \[RS\]:\ \[NEM\]\ convinced\ me\ that\ to\ do\ it\nin\ two\ lines\ can\ make\ more\ robust\ code\ (say\ when\ spaces\ are\ in\ the\ filename).\ So\ the\ revised\ version\ is:\n\ proc\ see\ name\ \ \{\n\ \ \ set\ im\ \[console\ eval\ \[list\ image\ create\ photo\ -file\ \$name\]\]\n\ \ \ console\ eval\ \[list\ .console\ image\ create\ end\ -image\ \$im\]\n\ \}\n----\n'''Console\ menu\ magic''':\ Put\ the\ commands\ you\ need\ most\ often\ into\ existing\ or\ newly\ created\ sub-menus.\ This\ way\ you\ can\ turn\ the\ \[console\]\ into\ your\ custom\ \[IDE\],\ step\ by\ step.\ (\[RS\]\ 2006-01-19)\n\ \n''Add\ a\ heading\ to\ the\ console\ menu:''\n\ \ console\ eval\ \{\n\ \ \ \ .menubar\ add\ casc\ -label\ Extra\ -menu\ \[menu\ .menubar.extra\ -tearoff\ 0\]\n\ \}\n''Add\ an\ item\ to\ the\ console\ menu:''\ \n\ proc\ menu+\ \{head\ label\ cmd\}\ \{\n\ \ \ set\ cmd2\ \[list\ consoleinterp\ eval\ \$cmd\]\n\ \ \ console\ eval\ \[list\ .menubar.\$head\ add\ command\ -label\ \$label\ -command\ \$cmd2\]\n\ \}\nUsage\ example\ (with\ the\ \"Extra\"\ menu\ created\ just\ before):\n\ menu+\ extra\ auto_mkindex\ \{auto_mkindex\ .\ *.tcl\}\n\nSee\ also\ \[Extending\ the\ eTcl\ console\]\ -\ except\ for\ the\ toolbar\ stuff,\ what's\ said\ there\ applies\ to\ all\ consoles.\n\nSee\ also\ \[a\ minimal\ console\].\n\nThe\ wiki\ page\ \[deep\ console\]\ covers\ an\ enhanced\ console.\n----\n\[LV\]\ 2007\ June\ 05\ -\ is\ there\ a\ way\ to\ add\ code\ to\ my\ application\ so\ that\ if\ the\ application\ attempts\ to\ write\ to\ \[stdout\],\ \[stderr\],\ or\ attempts\ to\ read\ from\ \[stdin\],\ then\ the\ console\ is\ shown,\ but\ otherwise,\ it\ remains\ hidden?\n\n\[MG\]\ You\ could\ overload\ \[puts\]\ (and\ probably\ \[read\]\ and\ \[gets\]\ as\ well)\ to\ run\ a\ \[\[console\ show\]\]\ when\ they're\ used\ on\ one\ of\ those\ channels.\ This\ isn't\ a\ complete\ solution,\ though\ -\ I'm\ fairly\ sure\ there\ are\ commands\ that\ can\ take\ a\ -channel\ arg\ to\ read\ or\ output\ to\ a\ channel\ directly\ which\ don't\ go\ through\ \[puts\]\ or\ \[gets\]/\[read\].\ It's\ the\ closest\ I\ can\ think\ of,\ though...\n----\n'''Set\ the\ maximum\ number\ of\ lines'''\n===\nconsole\ eval\ \{set\ ::tk::console::maxLines\ 10000\}\n===\n----\n\n'''Add\ color\ and\ style\ to\ console\ output'''\n===\nproc\ cputs\ \{dest\ string\}\ \{\n\ \ \ \ if\ \{\ !\ \[info\ exist\ ::tk::my_color_set\]\ \}\ \{\n\ \ \ \ \ \ \ \ set\ ::tk::my_color_set\ 1\n\ \ \ \ \ \ \ \ console\ eval\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ .console\ tag\ configure\ green\ \ \ \ \ \ \ \ \ \ \ \ -foreground\ green\ \ -font\ \{courier\ 20\ bold\}\n\ \ \ \ \ \ \ \ \ \ \ \ .console\ tag\ configure\ yellowonblack\ \ \ \ -foreground\ yellow\ -background\ black\n\ \ \ \ \ \ \ \ \ \ \ \ .console\ tag\ configure\ yellow\ \ \ \ \ \ \ \ \ \ \ -foreground\ yellow\n\ \ \ \ \ \ \ \ \ \ \ \ .console\ tag\ configure\ whiteonred\ \ \ \ \ \ \ -foreground\ white\ -background\ red\n\ \ \ \ \ \ \ \ \ \ \ \ .console\ tag\ configure\ red\ \ \ \ \ \ \ \ \ \ \ \ \ \ -foreground\ red\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \}\n\ \ \ \ \ \ \ \ console\ eval\ \[list\ ::tk::ConsoleOutput\ \$dest\ \$string\]\n\n\}\n\n#\ demo\ use\n\ncputs\ yellowonblack\ \"this\ is\ a\ sample\ warning\"\ \;\ cputs\ normal\ \"\\n\"\ncputs\ whiteonred\ \ \ \ \"this\ will\ extend\ to\ window\ border\\n\"\ncputs\ green\ \"go\ ahead,\ the\ light\ is\ green\\n\"\n\n#Any\ unknown\ color\ reverts\ to\ black\ on\ white\ -\ e.g.\ use\ of\ the\ tag\ normal\ here.\ \n#Tags\ can\ be\ reconfigured\ and\ will\ affect\ all\ previous\ cputs\ output.\n\n===\n\[ET\]\ The\ above\ provides\ an\ alternative\ to\ puts,\ this\ lets\ you\ define\ your\ own\ text\ formatting.\ The\ actual\ console\ code\ defines\ a\ number\ of\ tags\ already,\ (stderr\ =\ red,\ stdin\ =\ blue,\ and\ others).\ This\ is\ why\ \[\[puts\ stderr\ \{string\}\]\]\ writes\ to\ the\ console\ in\ red.\ \n\nThis\ does\ not\ output\ a\ newline.\ You\ can\ add\ the\ \\n\ escape\ in\ your\ string.\ You\ can\ intersperse\ with\ puts\ statements,\ as\ these\ eventually\ all\ get\ to\ the\ ConsoleOutput\ code.\n\[ET\]\ old\ version\ would\ bug\ out\ with\ a\ \}\ in\ the\ text\ string.\n\n===\n\[ET\]\ I've\ recently\ tried\ out\ a\ new\ version\ of\ tcl/tk\ (8.6b1.1\ as\ of\ 6/6/2010)\ and\ now\ the\ added\ widgets\ I've\ included\ into\ my\ console\ get\ focus\ when\ I\ type\ <tab>\ in\ the\ console\ window\ (to\ fill\ in\ such\ things\ as\ variable\ names\ -\ like\ tab\ in\ a\ unix\ shell).\ Since\ <escape>\ does\ the\ same\ function\ as\ <tab>\ in\ the\ console,\ this\ is\ not\ a\ showstopper\ but\ is\ just\ rather\ annoying.\ I\ haven't\ been\ able\ to\ figure\ out\ what\ has\ changed\ and\ how\ to\ fix\ it.\n\n\n!!!!!!\n\[Arts\ and\ crafts\ of\ Tcl-Tk\ programming\]\n%|\ \[Tk\ syntax\ help\]\ |\ \[Category\ Command\],\ a\ part\ of\ the\ \[Tk\]\ package\ |\ \[Category\ Platform\ Issues\]\ |%\n!!!!!!} CALL {my revision console} CALL {::oo::Obj1155889 process revision/console} CALL {::oo::Obj1155887 process}

-errorcode

NONE

-errorinfo

Unknow state transition: LINE -> END
    while executing
"error $msg"
    (class "::Wiki" method "render_wikit" line 6)
    invoked from within
"my render_$default_markup $N $C $mkup_rendering_engine"
    (class "::Wiki" method "render" line 8)
    invoked from within
"my render $name $C"
    (class "::Wiki" method "revision" line 31)
    invoked from within
"my revision $page"
    (class "::Wiki" method "process" line 56)
    invoked from within
"$server process [string trim $uri /]"

-errorline

4