tkconrc(5)
π tkconrc β the TkCon resource file π
okay so this is tkconrc(5), a File Formats Manual page, and bestie, it's literally the glow-up guide for your TkCon console. sit down, grab a strawberry π, we're doing this.
β¨ NAME β¨
tkconrc β the TkCon resource file, aka the lil config file that makes your console yours π
πΈ DESCRIPTION πΈ
TkCon is gonna go looking for a resource file at ~/.tkconrc. that's the spot. that's the vibe. π
heads up: TkCon never sources the ~/.wishrc file. not ever. don't even ask. π
Every single new instance of the console sources this resource file β so like, fresh TkCon, fresh you, every time. there's an example resource file down below if you need inspo β¨
and the file itself? it's a Tcl script, so it's required that the file conforms to Tcl script conventions. no cap, it has to be legit Tcl. π
π¦ VARIABLES π¦
Certain variables in TkCon can be modified to suit your needs. it's easiest to do this in the resource file, but you can also do it while the program is running (and some can be changed via the Prefs menu β so convenient, we love her π). All of these live in the master interpreter's ::tkcon namespace. The modifiable array variables are ::tkcon::COLOR and ::tkcon::OPT. You can call
tkcon set ::tkcon::COLOR
while the program is running to check its state, iykyk. Here's the rundown of certain variables you might change or use:
π¨ the COLOR crew
::tkcon::COLOR(bg)β The background color for tkcon text widgets. Defaults to the operating system default (determined at startup).::tkcon::COLOR(blink)β The background color of the electric brace highlighting, if on. Defaults to yellow. β‘::tkcon::COLOR(cursor)β The background color for the insertion cursor in tkcon. Defaults to black.::tkcon::COLOR(disabled)β The foreground color for disabled menu items. Defaults to dark grey.::tkcon::COLOR(proc)β The foreground color of a recognized proc, if command highlighting is on. Defaults to dark green.::tkcon::COLOR(var)β The background color of a recognized var, if command highlighting is on. Defaults to pink. π (iconic, obviously)::tkcon::COLOR(prompt)β The foreground color of the prompt as output in the console. Defaults to brown.::tkcon::COLOR(stdin)β The foreground color of the stdin for the console. Defaults to black.::tkcon::COLOR(stdout)β The foreground color of the stdout as output in the console. Defaults to blue.::tkcon::COLOR(stderr)β The foreground color of stderr as output in the console. Defaults to red. π¨
βοΈ the OPT squad
::tkcon::OPT(autoload)β Packages to automatically load into the slave interpreter (i.e.'Tk'). This is a list. Defaults to{}(none).::tkcon::OPT(blinktime)β The amount of time (in millisecs) that braced sections should blink for. Defaults to500(0.5 secs), must be at least100.::tkcon::OPT(blinkrange)β Whether to blink the entire range for electric brace matching or to just blink the actual matching braces (respectively1or0, defaults to1).::tkcon::OPT(buffer)β The size of the console scroll buffer (in lines). Defaults to512.::tkcon::OPT(calcmode)β Whether to allowexprcommands to be run at the command line without prefixing them withexpr(just a convenience).::tkcon::OPT(cols)β Number of columns for the console to start out with. Defaults to80.::tkcon::OPT(dead)β What to do with dead connected interpreters. Ifdeadisleave, TkCon automatically exits the dead interpreter. Ifdeadisignorethen it remains attached waiting for the interpreter to reappear. Otherwise TkCon will prompt you. π::tkcon::OPT(exec)β This corresponds to the-exectkcon option (seetkcon(1)).::tkcon::OPT(font)β Font to use for tkcon text widgets (also specified with-fontoption). Defaults to the system default, or a fixed width equivalent.::tkcon::OPT(gets)β Controls whether tkcon will overload thegetscommand to work with tkcon. The valid values are:congets(the default), which will redirect stdin requests to the tkcon window;gets, which will pop up a dialog to get input; and{}(empty string) which tells tkcon not to overloadgets. This value must be set at startup to alter tkcon's behavior. β οΈ::tkcon::OPT(history)β The size of the history list to keep. Defaults to48.::tkcon::OPT(hoterrors)β Whether hot errors are enabled or not. When enabled, errors that are returned to the console are marked with a link to the error info that will pop up in an minimal editor. This requires more memory because each error that occurs will maintain bindings for this feature, as long as the error is in the text widget. Defaults toon. π₯::tkcon::OPT(library)β The path to any tcl library directories (these are appended to theauto_pathwhen the after the resource file is loaded in).::tkcon::OPT(lightbrace)β Whether to use the brace highlighting feature or not (respectively1or0, defaults to1).::tkcon::OPT(lightcmd)β Whether to use the command highlighting feature or not (respectively1or0, defaults to1).::tkcon::OPT(maineval)β A tcl script to execute in the main interpreter after the slave interpreter is created and the user interface is initialized.::tkcon::OPT(maxlinelen)β A number that specifies the limit of long result lines. True result is still captured in$_(and'puts $_'works). Defaults to0(unlimited).::tkcon::OPT(maxmenu)β A number that specifies the maximum number of packages to show vertically in the Interp->Packages menu before breaking into another column. Defaults to15.::tkcon::OPT(nontcl)β For those who might be using non-Tcl based Tk attachments, set this to1. It prevents TkCon from trying to evaluate its own Tcl code in an attached interpreter. Also see my notes for non-Tcl based Tk interpreters.::tkcon::OPT(prompt1)β Liketcl_prompt1, except it doesn't require you useputs. No equivalent fortcl_prompt2is available (it's unnecessary IMHO). Defaults to{([file tail [pwd]]) [history nextid] % }. π::tkcon::OPT(rows)β Number of rows for the console to start out with. Defaults to20.::tkcon::OPT(scollypos)β Y scrollbar position. Valid values areleftorright. Defaults toright.::tkcon::OPT(showmenu)β Show the menubar on startup (1or0, defaults to1).::tkcon::OPT(showmultiple)β Show multiple matches for path/proc/var name expansion (1or0, defaults to1).::tkcon::OPT(slaveeval)β A tcl script to execute in each slave interpreter right after it's created. This allows the user to have user defined info always available in a slave.
Example:
set ::tkcon::OPT(slaveeval) {
proc foo args { puts $args }
lappend auto_path .
}
::tkcon::OPT(slaveexit)β Allows the prevention of exit in slaves from exitting the entire application. If it is equal toexit, exit will exit as usual, otherwise it will just close down that interpreter (and any children). Defaults toclose.::tkcon::OPT(subhistory)β Allow history substitution to occur (0or1, defaults to1). The history list is maintained in a single interpreter per TkCon console instance. Thus you have history which can range over a series of attached interpreters.
π EXAMPLES π
An example TkCon resource file might look like:
######################################################
## My TkCon Resource File
# Use a fixed default font
#tkcon font fixed; # valid on unix
#tkcon font systemfixed; # valid on win
tkcon font Courier 12; # valid everywhere
# Keep 50 commands in history
set ::tkcon::OPT(history) 50
# Use a pink prompt
set ::tkcon::COLOR(prompt) pink
######################################################
pink prompt supremacy, honestly. π
π SEE ALSO π
dump(3tk), idebug(3tk), observe(3tk), tkcon(1), tkcon(3tk)
π KEYWORDS π
Tk, console
Β©οΈ COPYRIGHT Β©οΈ
Copyright (c) Jeffrey Hobbs <jeff at hobbs.org>
okay that's the whole thing bestie, you're officially a tkconrc girlie now πβ¨ this was TkCon 2.5, and the page went out with tkconrc(5) β mwah, slay, periodt. π¦π
π¦ where this page comes from
- debian bookworm: tkcon 2:2.7.11-1
- debian trixie: tkcon 2:2.7.11-6
- ubuntu jammy: tkcon 2:2.7.10-2
- ubuntu noble: tkcon 2:2.7.11-1
- ubuntu resolute: tkcon 2:2.7.11-6
- ubuntu stonking: tkcon 2:2.7.11-6
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms