OS Commands Tool

Index of All Documentation » Wing Pro Reference Manual »

The OS Commands tool in Wing Pro and Wing Personal executes and interacts with external commands provided by the OS or by other software. It can be used to execute Python code outside of the debugger, run build commands, integrate external tools into Wing, start code that is debugged using wingdbstub, and so forth.

Adding and Editing Commands

There are three types of OS Commands:

(1) Command Lines are executed in the environment configured in the OS Command itself.

(2) Python Files are executed in the environment configured in their File Properties.

(3) Named Entry Points are executed in the environment configured by the selected Named Entry Point.

Commands can be added, edited, and deleted with the icons in the OS Commands tool and from its Options menu.

Additionally, whenever a file is executed outside of the debugger, or when a build command is configured in Project Properties or Launch Configurations, these are added automatically to the OS Commands tool.

For details on setting up a new command, see OS Command Properties.

Executing Commands

Commands can be executed and terminated from icons in the OS Command tool and from its Options menu.

The bottom portion of the OS Commands tool contains the console where commands are executed, where output is shown, and where input can be entered for sending to the sub-process. Use the popup menu to switch between running processes, or add multiple instances of the OS Commands tool to view them at the same time.

The console provides a right-click context menu for controlling the process, copy/pasting, and clearing or saving a copy of the output to a file.

Start Terminal

On Linux and OS X, or when working with a project that points to a remote host, Wing offers Start Terminal in the OS Commands tool menus and the Tools menu in the menu bar. This configures and starts a new Command Line style OS Command that runs a bash terminal.

For projects that use a virtualenv Python, the terminal will be started after running activate. This is set in the Command Line property, which can be set back to bash -norc to avoid activating the virtualenv.

To set up a terminal that runs a different shell, add a Command Line style OS Command with Command Line set to your shell executable (for example, Wing's default terminal configuration uses bash -norc) and then enable the Use pseudo-TTY and Line mode options.

Note that Wing's OS Commands tool does not fully emulate a TTY, so the tab key, color, and cursor movement are not supported. As a result of this, Wing sets TERM=dumb in the Environment in the OS Command configuration for terminals.


The Options menu includes items for restarting a command and clearing the execution console, and also the following options:

  • Auto-Clear Consoles controls whether the console is automatically cleared each time a command is started or restarted.
  • Python Prompt After Execution controls whether Python File style commands drop into the Python prompt after the file is executed, rather than exiting the process.
  • Wrap Long Lines controls whether long lines are shown on a single line or wrapped to the width of the OS Commands tool.


The OS Commands toolbox contains the same items in the popup menu at the top of the tool, but is more convenient for editing or removing multiple items, or quickly executing a series of commands. The toolbox is hidden by default but can be shown with Show Toolbox in the Options menu. Right-click on the list for available actions, or middle-click or double-click on the list to execute items.

Section Contents