Skip to documentation
DocumentationAll documentsEnglish

BWISH(1)

NAME

bwish - BRL-CAD's Tcl/Tk windowing shell

On this page

SYNOPSIS

bwish [_script_ [_arg_ ...]]

DESCRIPTION

bwish is a Tcl/Tk windowing shell, analogous to the standard Tk wish(1) interpreter, but preloaded with BRL-CAD’s Tcl/Tk extensions (libtclcad, Itcl/Itk, and the associated BRL-CAD libraries). It is the graphical counterpart to btclsh(1) and provides the scripting and GUI foundation used by BRL-CAD tools such as mged(1) and archer(1).

If the first argument does not begin with a -, it is taken as the name of a Tcl/Tk script to evaluate; bwish runs the script and then enters the event loop. Any remaining arg values are made available to the script through the Tcl global variables argv and argc, with argv0 set to the script name.

If no script is given (or the first argument begins with a -), bwish runs interactively. It reads commands from standard input with emacs-style command-line editing and history (for example, Ctrl-A, Ctrl-E, Ctrl-K, Ctrl-W, and the arrow keys for history and cursor movement), and on startup evaluates the resource file ~/.bwishrc (~/.bwishrc.tcl on Windows) if it exists.

bwish does not interpret any command-line options of its own; flags are left for the executed script to handle via argv.

EXAMPLES

Example 1. Run a Tk script with arguments
bwish make_dialog.tcl 800x600 model.g

Evaluates the Tcl/Tk script make_dialog.tcl, with the BRL-CAD extensions already loaded, passing 800x600 and model.g to the script as argv. Because libtclcad is initialized, the script can open and query BRL-CAD geometry databases directly.

Example 2. Interactive geometry scripting
bwish
bwish> package require Tk
bwish> set db [go_open db file model.g]
bwish> button .quit -text Quit -command exit; pack .quit

Starts an interactive session, builds a small Tk control, and works with a BRL-CAD database through the bundled commands, all without writing a separate script file.

SEE ALSO

brlcad(1), btclsh(1), mged(1), archer(1)

AUTHOR

BRL-CAD Team

This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory.

BUG REPORTS

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org