head	1.13;
access;
symbols
	core-8-5-9:1.11
	core-8-5-8:1.11
	macosx-cocoa-merge:1.13
	macosx-cocoa-premerge:1.13
	macosx-carbon-freeze:1.13
	core-8-5-7:1.11
	core-8-5-6:1.11
	core-8-6-b1:1.13
	core-8-6-a3:1.13
	core-8-5-5:1.11
	core-8-6-a2:1.12
	core-8-5-4:1.11
	core-8-5-3:1.11
	core-8-6-a1:1.11
	core-8-4-19:1.4.4.1
	core-8-5-branch:1.11.0.2
	core-8-5-2:1.11
	core-8-4-18:1.4.4.1
	core-8-5-1:1.11
	core-8-4-17:1.4.4.1
	core-8-5-0:1.11
	core-8-5-b3:1.10
	core-8-5-b2:1.8
	core-8-4-16:1.4.4.1
	core-8-5-b1:1.8
	core-stablilizer-merge:1.7
	core-stabilizer-branch:1.7.0.2
	core-stabilizer-merge:1.11
	core-8-4-15:1.4.4.1
	core-8-5-a6:1.7
	core-8-5-a5:1.7
	core-8-4-14:1.4.4.1
	core-8-5-a4:1.7
	core-8-4-13:1.4.4.1
	core-8-4-12:1.4.4.1
	core-8-4-11:1.4.4.1
	core-8-5-a3:1.7
	core-8-4-10:1.4.4.1
	core-8-4-9-branch:1.4.4.1.0.2
	core-8-5-a2:1.7
	core-8-4-9:1.4.4.1
	core-8-4-8:1.4.4.1
	core-8-4-7:1.4
	core-8-5-a1:1.4
	core-8-4-6:1.4
	core-8-4-5:1.4
	mistachkin-dev-branch:1.4.0.6
	core-8-4-4:1.4
	core-8-4-3:1.4
	core-8-4-branch:1.4.0.4
	core-8-4-2:1.4
	core-8-4-1:1.4
	core-8-4-0:1.4
	macosx-8-4-merge-2002-08-31-trunk:1.4
	macosx-8-4-premerge-2002-08-31-branch:1.3.2.1
	macosx-8-4-premerge-2002-08-31-trunk:1.4
	macosx-8-4-merge-2002-08-30-branch:1.3.2.1
	macosx-8-4-merge-2002-08-30-trunk:1.4
	macosx-8-4-merge-2002-08-20-branch:1.3.2.1
	macosx-8-4-merge-2002-08-20-trunk:1.4
	core-8-4-b2:1.4
	core-8-4-b1:1.4
	macosx-premerge-6-9-02:1.3
	core-8-4-win-speedup:1.4.0.2
	core-8-4-a4:1.3
	macosx-8-4-branch:1.3.0.2
	macosx-8-4-branchpoint:1.3
	core-8-4-a3:1.3
	dgp-privates-into-namespace:1.1.0.2;
locks; strict;
comment	@# @;


1.13
date	2008.09.23.13.36.38;	author dkf;	state Exp;
branches;
next	1.12;

1.12
date	2008.06.30.22.57.02;	author dkf;	state Exp;
branches;
next	1.11;

1.11
date	2007.12.13.15.23.43;	author dgp;	state Exp;
branches;
next	1.10;

1.10
date	2007.11.01.13.33.53;	author das;	state Exp;
branches;
next	1.9;

1.9
date	2007.11.01.10.19.11;	author dkf;	state Exp;
branches;
next	1.8;

1.8
date	2007.08.28.15.16.11;	author dkf;	state Exp;
branches;
next	1.7;

1.7
date	2004.10.28.10.22.51;	author dkf;	state Exp;
branches
	1.7.2.1;
next	1.6;

1.6
date	2004.06.21.21.56.44;	author dkf;	state Exp;
branches;
next	1.5;

1.5
date	2004.03.17.18.15.42;	author das;	state Exp;
branches;
next	1.4;

1.4
date	2002.03.29.02.25.06;	author davygrvy;	state Exp;
branches
	1.4.2.1
	1.4.4.1;
next	1.3;

1.3
date	2001.08.07.02.56.11;	author hobbs;	state Exp;
branches
	1.3.2.1;
next	1.2;

1.2
date	2001.08.01.16.21.11;	author dgp;	state Exp;
branches;
next	1.1;

1.1
date	2001.05.16.12.39.18;	author dkf;	state Exp;
branches
	1.1.2.1;
next	;

1.1.2.1
date	2001.07.03.20.01.07;	author dgp;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	2001.07.18.16.45.51;	author dgp;	state Exp;
branches;
next	;

1.3.2.1
date	2002.06.10.05.38.23;	author wolfsuit;	state Exp;
branches;
next	;

1.4.2.1
date	2002.04.02.20.57.53;	author hobbs;	state Exp;
branches;
next	;

1.4.4.1
date	2004.10.28.10.19.29;	author dkf;	state Exp;
branches;
next	;

1.7.2.1
date	2007.09.04.17.44.21;	author dgp;	state Exp;
branches;
next	1.7.2.2;

1.7.2.2
date	2007.11.01.16.37.14;	author dgp;	state Exp;
branches;
next	;


desc
@@


1.13
log
@Fix [Bug 2118116]
@
text
@'\"
'\" Copyright (c) 2001 Donal K. Fellows
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @@(#) $Id: console.n,v 1.12 2008/06/30 22:57:02 dkf Exp $
'\"
.so man.macros
.TH console n 8.4 Tk "Tk Built-In Commands"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
console \- Control the console on systems without a real console
.SH SYNOPSIS
\fBconsole\fR \fIsubcommand\fR ?\fIarg ...\fR?
.BE
.SH DESCRIPTION
.PP
The console window is a replacement for a real console to allow input
and output on the standard I/O channels on platforms that do not have
a real console.  It is implemented as a separate interpreter with the
Tk toolkit loaded, and control over this interpreter is given through
the \fBconsole\fR command.  The behaviour of the console window is
defined mainly through the contents of the \fIconsole.tcl\fR file in
the Tk library. Except for TkAqua, this command is not available when
Tk is loaded into a tclsh interpreter with
.QW "\fBpackage require Tk\fR" ,
as a conventional terminal is expected to be present in that case.
In TkAqua, this command is ony available when stdin is \fB/dev/null\fR
(as is the case e.g. when the application embedding Tk is started
from the Mac OS X Finder).
.PP
.TP
\fBconsole eval \fIscript\fR
Evaluate the \fIscript\fR argument as a Tcl script in the console
interpreter.  The normal interpreter is accessed through the
\fBconsoleinterp\fR command in the console interpreter.
.TP
\fBconsole hide\fR
Hide the console window from view.  Precisely equivalent to
withdrawing the \fB.\fR window in the console interpreter.
.TP
\fBconsole show\fR
Display the console window.  Precisely equivalent to deiconifying the
\fB.\fR window in the console interpreter.
.TP
\fBconsole title \fR?\fIstring\fR?
Query or modify the title of the console window.  If \fIstring\fR is
not specified, queries the title of the console window, and sets the
title of the console window to \fIstring\fR otherwise.  Precisely
equivalent to using the \fBwm title\fR command in the console
interpreter.
.SH "ACCESS TO THE MAIN INTERPRETER"
.PP
The \fBconsoleinterp\fR command in the console interpreter allows
scripts to be evaluated in the main interpreter.  It supports two
subcommands: \fBeval\fR and \fBrecord\fR.
.PP
.TP
\fBconsoleinterp eval \fIscript\fR
Evaluates \fIscript\fR as a Tcl script at the global level in the main
interpreter.
.TP
\fBconsoleinterp record \fIscript\fR
Records and evaluates \fIscript\fR as a Tcl script at the global level
in the main interpreter as if \fIscript\fR had been typed in at the
console.
.SH "ADDITIONAL TRAP CALLS"
.PP
There are several additional commands in the console interpreter that
are called in response to activity in the main interpreter.
\fIThese are documented here for completeness only; they form part of
the internal implementation of the console and are likely to change or
be modified without warning.\fR
.PP
Output to the console from the main interpreter via the stdout and
stderr channels is handled by invoking the \fBtk::ConsoleOutput\fR
command in the console interpreter with two arguments.  The first
argument is the name of the channel being written to, and the second
argument is the string being written to the channel (after encoding
and end-of-line translation processing has been performed.)
.PP
When the \fB.\fR window of the main interpreter is destroyed, the
\fBtk::ConsoleExit\fR command in the console interpreter is called
(assuming the console interpreter has not already been deleted itself,
that is.)
.SH "DEFAULT BINDINGS"
.PP
The default script creates a console window (implemented using a text
widget) that has the following behaviour:
.IP [1]
Pressing the tab key inserts a TAB character (as defined by the Tcl
\et escape.)
.IP [2]
Pressing the return key causes the current line (if complete by the
rules of \fBinfo complete\fR) to be passed to the main interpreter for
evaluation.
.IP [3]
Pressing the delete key deletes the selected text (if any text is
selected) or the character to the right of the cursor (if not at the
end of the line.)
.IP [4]
Pressing the backspace key deletes the selected text (if any text is
selected) or the character to the left of the cursor (of not at the
start of the line.)
.IP [5]
Pressing either Control+A or the home key causes the cursor to go to
the start of the line (but after the prompt, if a prompt is present on
the line.)
.IP [6]
Pressing either Control+E or the end key causes the cursor to go to
the end of the line.
.IP [7]
Pressing either Control+P or the up key causes the previous entry in
the command history to be selected.
.IP [8]
Pressing either Control+N or the down key causes the next entry in the
command history to be selected.
.IP [9]
Pressing either Control+B or the left key causes the cursor to move
one character backward as long as the cursor is not at the prompt.
.IP [10]
Pressing either Control+F or the right key causes the cursor to move
one character forward.
.IP [11]
Pressing F9 rebuilds the console window by destroying all its children
and reloading the Tcl script that defined the console's behaviour.
.PP
Most other behaviour is the same as a conventional text widget except
for the way that the \fI<<Cut>>\fR event is handled identically to the
\fI<<Copy>>\fR event.
.SH EXAMPLE
.PP
Not all platforms have the \fBconsole\fR command, so debugging code
often has the following code fragment in it so output produced by
\fBputs\fR can be seen while during development:
.CS
catch {\fBconsole show\fR}
.CE
.SH "SEE ALSO"
destroy(n), fconfigure(n), history(n), interp(n), puts(n), text(n), wm(n)
.SH KEYWORDS
console, interpreter, window, interactive, output channels
'\" Local Variables:
'\" mode: nroff
'\" End:
@


1.12
log
@Minor doc updates (removing out of date changebars, improving typedef formatting,
 etc.)
@
text
@a0 1
'\" -*- nroff -*-
d7 1
a7 1
'\" RCS: @@(#) $Id: console.n,v 1.11 2007/12/13 15:23:43 dgp Exp $
d145 3
@


1.11
log
@merge stable branch onto HEAD
@
text
@d1 1
d8 1
a8 1
'\" RCS: @@(#) $Id: console.n,v 1.7.2.2 2007/11/01 16:37:14 dgp Exp $
d135 1
@


1.10
log
@	* doc/console.n:	clarify availability of [console] in TkAqua.
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: console.n,v 1.9 2007/11/01 10:19:11 dkf Exp $
@


1.9
log
@Fix [Bug 1386955]
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: console.n,v 1.8 2007/08/28 15:16:11 dkf Exp $
d26 3
a28 3
the Tk library. Note that this command is not available when Tk is
loaded into a tclsh interpreter with
.QW "\fBpackage require Tk"
d30 3
@


1.8
log
@Assorted documentation improvements.
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: console.n,v 1.7 2004/10/28 10:22:51 dkf Exp $
a17 1

d26 4
a29 1
the Tk library.
@


1.7
log
@Assorted minor documentation fixes
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: console.n,v 1.6 2004/06/21 21:56:44 dkf Exp $
d135 2
a136 1

a138 3

.SH "SEE ALSO"
destroy(n), fconfigure(n), history(n), interp(n), puts(n), text(n), wm(n)
@


1.7.2.1
log
@merge updates from HEAD
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: console.n,v 1.7 2004/10/28 10:22:51 dkf Exp $
d135 4
a140 2
.SH KEYWORDS
console, interpreter, window, interactive, output channels
@


1.7.2.2
log
@merge updates from HEAD
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: console.n,v 1.7.2.1 2007/09/04 17:44:21 dgp Exp $
d18 1
d27 1
a27 7
the Tk library. Except for TkAqua, this command is not available when
Tk is loaded into a tclsh interpreter with
.QW "\fBpackage require Tk\fR" ,
as a conventional terminal is expected to be present in that case.
In TkAqua, this command is ony available when stdin is \fB/dev/null\fR
(as is the case e.g. when the application embedding Tk is started
from the Mac OS X Finder).
@


1.6
log
@Added example
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: console.n,v 1.5 2004/03/17 18:15:42 das Exp $
d133 1
a133 1
catch {\fBconsole\fR show}
@


1.5
log
@Removed support for Mac OS Classic platform [Patch 918139]
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: console.n,v 1.4 2002/03/29 02:25:06 davygrvy Exp $
d16 1
a16 7
\fBconsole title \fR?\fIstring\fR?
.sp
\fBconsole hide\fR
.sp
\fBconsole show\fR
.sp
\fBconsole eval \fIscript\fR
a48 1

a63 1

a82 1

d128 7
@


1.4
log
@Changed topic from "Tcl Built-In Commands" to "Tk Built-In Commands"
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: console.n,v 1.3 2001/08/07 02:56:11 hobbs Exp $
d33 1
a33 1
the Tk library (or the \fIConsole\fR resource on Macintosh systems.)
@


1.4.4.1
log
@Backport of documentation fixes
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: console.n,v 1.4 2002/03/29 02:25:06 davygrvy Exp $
d16 7
a22 1
\fBconsole\fR \fIsubcommand\fR ?\fIarg ...\fR?
d55 1
d71 1
d91 1
a136 7
.SH EXAMPLE
Not all platforms have the \fBconsole\fR command, so debugging code
often has the following code fragment in it so output produced by
\fBputs\fR can be seen while during development:
.CS
catch {\fBconsole show\fR}
.CE
@


1.4.2.1
log
@sync with head
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: console.n,v 1.4 2002/03/29 02:25:06 davygrvy Exp $
@


1.3
log
@corrected minor nroff transgressions
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: console.n,v 1.2 2001/08/01 16:21:11 dgp Exp $
d10 1
a10 1
.TH console n 8.4 Tk "Tcl Built-In Commands"
@


1.3.2.1
log
@Merging with TOT as of 06/09/2002.
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id$
d10 1
a10 1
.TH console n 8.4 Tk "Tk Built-In Commands"
@


1.2
log
@	Merged changes from feature branch dgp-privates-into-namespace,
	implementing TIP 44.  All Tk commands and variables matching
	tk[A-Z]* are now in the ::tk namespace.
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: console.n,v 1.1 2001/05/16 12:39:18 dkf Exp $
d53 1
a53 1
equivalent to using the \fBwm title\fI command in the console
@


1.1
log
@Added documentation for console command.  (Right source tree this time!)
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: console.n,v 1.1 2001/05/15 09:50:13 dkf Exp $
d81 1
a81 1
stderr channels is handled by invoking the \fBtkConsoleOutput\fR
d88 1
a88 1
\fBtkConsoleExit\fR command in the console interpreter is called
@


1.1.2.1
log
@        * Merged in updates from HEAD branch.
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: console.n,v 1.1 2001/05/16 12:39:18 dkf Exp $
@


1.1.2.2
log
@	* Updated names of private console commands.
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: console.n,v 1.1.2.1 2001/07/03 20:01:07 dgp Exp $
d81 1
a81 1
stderr channels is handled by invoking the \fBtk::ConsoleOutput\fR
d88 1
a88 1
\fBtk::ConsoleExit\fR command in the console interpreter is called
@


