Interactive Shell
Stand-Alone Interactive ShellWhen the interactive shell is started as a stand-alone tool, use the shell to help test modules and experiment with new languages or programs. Other uses for a stand-alone interactive shell include:
The interactive shell supports history recall, AutoComplete and CallTips (Tcl only), and custom colors and fonts.
Debugging with an Interactive ShellWhen the interactive shell is started from within a debug session, use the shell to access all functions and code being debugged. When the shell is closed from within a debug session, continue the debug process where you left off. Depending on the language used, changes made in the shell remain in effect for the duration of the debug session. Other uses for an interactive shell within a debug session include:
The interactive shell supports history recall, AutoComplete and CallTips (Tcl only), and custom colors and fonts.
Using the Interactive ShellEach Komodo interactive shell is associated with a corresponding interpreter and is thus language-specific. Each time a command or multi-line string is entered into the Shell tab, that code is sent to the corresponding interpreter for evaluation. The interpreter evaluates the command, and then returns output and error text.
Setting Shell PreferencesUse the Preferences dialog box to specify the default language to use within an interactive shell. Other shells can still be accessed via Tools|Interactive Shell. To set the default shell preference:
Starting the Interactive ShellThe interactive shell can be opened as a stand-alone tool or as a shell inside of a debugging session. To start the shell as a stand-alone tool:
The interactive shell opens in a Shell tab in the Bottom Pane beside the Command Output and Breakpoint tabs. To start the shell from within a debug session:
View debugging and code inspection functions by clicking the "Collapse/Expand Pane" button at the left side of the Bottom Pane. This splits the shell into a left and right pane. The left pane performs debugging functions while the right pane contains the interactive shell.
Using Multiple ShellsOpen multiple interactive shells to interact with various code snippets from a single language or use many shells to simultaneously explore a different language in each shell.
Using AutoComplete and CallTipsThe Tcl interactive shell displays AutoComplete and CallTips when recognized code and commands are entered into the shell. Use AutoComplete and CallTips to limit the amount of typing in each session. To select a suggested item, press Enter. Use the up and down arrow keys to scroll through the various options on the screen. To cancel or ignore the suggested AutoComplete or CallTip, press Esc. Komodo can also detect when further data is required at the command prompt. When insufficient programming data is entered at the prompt, Komodo displays a language-dependent "more" prompt. This prompt indicates that the language interpreter requires more information before the code can run. Once enough data is entered, Komodo executes the code and the standard language-dependent input prompt returns.
Customizing Colors and FontsThe Shell tab displays commands, variables, error messages, and all language syntax in the same scheme as specified in Edit|Preferences|Fonts and Colors. See Customizing Fonts and Colors for more information.
Viewing Shell HistoryThe code history consists of the ordered, numbered sets of commands entered in the lifetime of the shell, including interleaved output and error messages. Use the up and down arrow keys to cycle through the history of all entered commands. When viewing a multi-line command or function, use the 'Enter' key to select the desired function and then use the arrow keys to cycle through the multiple lines within that function.
Stopping a Shell SessionTo stop an interactive shell session and close the Shell tab, click the X button located in the upper-right corner of the Shell tab. To stop the interactive shell and keep the Shell tab open, click the square button, or use the associated key binding.
Clearing the Shell BufferTo clear the shell buffer, click the Clear Buffer button. There is no limit to buffer size; unless it is manually cleared, the buffer will continue to increment until the interactive shell session is closed. Manually clearing the buffer only removes the command history and command results, and has no effect on the buffer state (such as changes to the working directory, etc).
Using the Python Interactive ShellThe Python shell prompt is a group of three angle brackets
>>>. A ... prompt is displayed if
Komodo determines that more information is required before the code can execute.
A Python 2.2.2 (#37, Nov 25 2002, 13:15:27) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits" or "license" for more information. >>> The following example shows a series of Python statements with resulting output:
Debugging with the Python ShellTo start a Python shell from within
a debug session, click the
Using the Tcl Interactive ShellThe Tcl interactive shell supports the tclsh interpreter. The Tcl shell
prompt is a percent character %. A > prompt
is displayed if Komodo determines that more information is required before
the code executes. A
Debugging with the Tcl ShellTo start a Tcl shell from within
a debug session, click the
Using the Perl Interactive ShellThe Perl interactive shell prompt is a percent character %. A > prompt is displayed if Komodo determines that more information is required before the code executes. No prompt is displayed when program output is sent to the screen. Code errors are displayed in italics. The following examples show how input, output, and errors are displayed in the Perl shell:
Using Strings, Function Definitions, and Multiple Line Input Use the Perl shell to enter function definitions, long strings, and specify
Example: Using single quotes "''" to enter multiple line input.
Example: Using curly braces "{}" to define a function and enter multiple line input.
Example: Using braces to enter a multiple line string.
Example: Using a backslash to continue a statement.
Example: Using a backslash to continue a statement.
Example: Using a braced construct
Debugging with the Perl ShellTo start a Perl shell from within
a debug session, click the
|