ActiveState Docs

Komodo 7.0 Documentation

Run commands are operating system commands run from within
Komodo. Use the Run Command dialog box to interact with the
system command line or shell while editing or debugging files in
Komodo. Besides making it easy to run simple and complex custom
commands from within Komodo, the Run Command dialog box can
insert the results of shell commands into a document in the
Editor Pane, or pass
the contents of a document to the system command line or
shell.

To view examples of run commands, see the "Samples" folder in
the Toolbox.

Run commands can be stored for re-use in a project or the Toolbox, where they can
be assigned key bindings.

Access the last ten commands executed in the Run Command
dialog box by selecting Tools|Recent Commands.
The prefixes [i], [l] and [il] indicate that Insert
output, Pass selection as input or both
were selected with the original command.

To create a run command, select Tools|Run
Command. The Run Command dialog box is displayed.
Alternatively, invoke the Run Command dialog box from the
Projects sidebar or
the Toolbox by
selecting Add|New Command from the
Project or Toolbox menu.

The Run Command dialog box can be toggled between its "simple"
or "advanced" form by clicking the More/Less
button.

This section describes the components of the Run Command
dialog box that are displayed when the advanced commands are
hidden (via the More/Less button. See Advanced Run Commands for information about
the advanced fields.

Run: Enter the command to run.

Interpolation Shortcut: Click the arrow
button to the right of the Run field to access
a drop-down list of interpolation
shortcuts. When an interpolation shortcut is selected, it
is inserted at the current cursor position in the
Run field. Windows users should enclose
shortcuts for files and directories in double quotes (e.g.
"%F") to ensure that spaces in the file name or file path are
interpreted correctly.

Pass selection as input: If this check box
is selected, the text currently highlighted in the editor is
passed to the command in the Run field. For
example, if the Run field contains grep
myvar, each line containing "myvar" in the text selected
in the editor is returned.

Insert output: If this check box is
selected, the results of the command are inserted at the cursor
position in the current document.

Add to Toolbox: If this check box is
selected, the command is saved in the Toolbox.

Click the More button in the Run Command
dialog box to display advanced options. The following options are
available:

Start in: Enter the directory where the
command should be run, or click the Browse
button to navigate the filesystem. Click the arrow button to
the right of the Start in field to select
interpolation
shortcuts pertinent to the Start in
setting. Interpolation shortcuts are inserted at the current
cursor position in the Run field.

Run in: Specify the environment in which the
command should be run. The options are:

No Console (GUI Application): The
command launches the specified application without
displaying output in a shell or on the Command
Output tab.

Do not open output pane: If this check box
is selected, the Bottom Pane
containing the Command Output tab does not
automatically open when the command is run. To manually view
the Bottom Pane, select View|Command Output.
(This option is only accessible if the Run in
field is set to Command Output tab.)

Parse output with: If this check box is
selected, the field to the right is used to enter a regular
expression that parses the output. See Parsing Command Output in
the Run Command Tutorial for an example. (This option is only
accessible if the Run in field is set to
Command Output tab.)

Show parsed output as list: If output
parsing is configured, select Show parsed output as
list to display the output in list format on the
Command Output tab. (This option is only
accessible if the Run in field is set to
Command Output tab.)

Environment Variables: Use the
Environment Variables section of the dialog
box to configure new environment variables or change the
value of existing environment variables for the duration of
the run. To add or alter an environment variable, click
New and configure the following values:

Variable Name: Enter a name for the
variable.

Variable Value: Enter a value for the
variable.

Interpolation Shortcut: Click the
arrow button to the right of the Variable
Value field to insert an interpolation
shortcut pertinent to the Variable
Value setting. The interpolation shortcut is
inserted at the current cursor position in the
Variable Value field.

Add Path: Click this button to insert
a directory as the variable value.

Save advanced options as defaults: If this
check box is selected, the current settings are stored as the
defaults for the Run Command dialog box.

By default, the commands run in the Command
Output tab on Komodo's Bottom Pane. (Use the
Run in field to run the command in a new shell
window, or to run a graphical application without a console.)

If the command prompts for input, enter it directly on the
Command Output tab. Output written to "stderr"
(standard error output) is displayed in red at the top of the
tab. Click the Close button at the top right of
the Command Output tab to terminate a running
command. Click the Toggle Raw/Parsed Output View
button to jump from parsed results to raw output and vice versa.
(Parsing is enabled and configured via the Parse output
with field.)

To access the properties of a run command stored in a project
or the Toolbox, right-click the run command and select
Properties. The Properties dialog box contains
all the elements of the Run Command dialog box, and is therefore
used for editing stored run commands. In addition, the Properties
dialog box is used to assign a custom icon to the run command,
and to assign a custom key binding.

The default run command icon can be replaced with custom
icons. Komodo includes more than 600 icons; alternatively, select
a custom image stored on a local or network drive (use
16x16-pixel images for best results).

To assign a custom icon to a run command:

In the Projects sidebar or
Toolbox, right-click the desired run command and
select Properties. Alternatively, single click the
run command to highlight it in the sidebar then select
Projects|runcommand_name|Properties or
Toolboxruncommand_name|Properties.

In the Properties dialog box, click Change
Icon.

In the Pick an Icon dialog box, select a new icon and click
OK. Alternatively, click Choose
Other, and browse to the desired image file.

In the properties dialog box for the run command, click
OK. The custom icon is displayed next to the
run command.

To revert to the default icon for a selected run command:

In the Projects or
Toolbox sidebar, right-click the desired run
command and select Properties.

Click Reset, then click
OK. The default icon is displayed next to the
run command.

Custom key bindings can be assigned to run commands stored in
the Toolbox or
in a Project.
Use the Key Binding tab in the run command's
Properties to specify the keystrokes that invoke the run command.
See Key
Bindings for Custom Components for more information.