Home » Support » Index of All Documentation » Wing IDE Reference Manual » OS Commands Tool »
8.0. OS Command Properties
Items added to the OS Commands tool can be configured to run within a particular environment using the dialog shown when the item is added from the OS Commands tool or by selecting an item and using the Edit item in the Options menu.
The following properties are available under two tabs in the dialog:
Definition
Type -- Two types of commands can be defined: A command, which can be any command line, or a file which can be a Python file, a makefile, or any executable script or program. For commands, the full command line is specified here. For files, the file is selected and no arguments may be added for invocation of the file.
In command lines, use $(ENV) to insert values from the environment or from the following special variables: WING_FILENAME for full path of current file, WING_LINENO for current line number, WING_SCOPE for x.y.z-formatted list of current scope, or WING_PROJECT for full path of current project. %s can be used as a short hand for $(WING_FILENAME). These values will be empty if undefined or there is no current file.
Title -- This is the user-assigned title to use for the command. If not set, the command line or file name is shown instead.
I/O Encoding -- This is the encoding to use for text sent to and received from the sub-process.
Key Binding -- This field can be used to assign a key binding to the command. Press the keys desired while focus is in the field. Multi-key sequences may be used if pressed within a few seconds of each other. To replace an incorrect value, wait briefly before retrying your binding. To reset the value to blank (no key binding), select all text and press Backspace or Delete.
Raise OS Commands when Executed -- This option causes the OS Commands tool to be shown whenever this command is executed. When disabled, the tool will not be brought to front.
Use pseudo TTY -- This option is only available on Linux and OS X. When set, Wing runs the subprocess in a pseudo tty and tries to (minimally) emulate how the command would work in a shell. Many of the ANSI escape sequences are not supported, but the basics should work. For some commands, adding options can help it to work better in the OS Commands tool. For example, bash -norc works better than bash if you have bash using colors, and ipython -colors NoColor works better than ipython alone.
Line mode -- This option is only available on Linux and OS X (on Windows, all I/O will be done line by line). When it is unchecked, Wing will enter raw mode and send every keystroke to the subprocess, rather than collecting input line by line. Often, but not always, when a pseudo TTY is being used then line mode should be disabled. Some experimentation may be required to determine the best settings.
Environment
Initial Directory, Python Path, Environment -- These values act the same as the corresponding values configurable in Project Properties.
Test Execute
While editing command properties, the Test Execute button can be used to try executing with the current settings. A temporary entry is added to the OS Commands tool, and removed again after the command properties dialog is closed.
| « 8. OS Commands Tool | Table of Contents | 9. Unit Testing » |
