There are several ways that COMMAND actions support windows on the desktop.
If the application has its own window, the action can be written to provide no additional window support. This option is also used when an action runs a command that requires no direct user input and has no output.
If the application must run in a terminal emulator window, the action can be written to open a window and then run the application. There are several terminal options.
Use the WINDOW_TYPE field to specify the type of windowing support required by the action as shown in Table 12-2 .
Table 12-2 WINDOW_TYPE Field andWindowing Support Provided
Windowing Support Provided |
|
---|---|
None. Use NO_STDIO if the application has its own window, or if the command has no visible output. |
|
Permanent terminal emulator window. The action opens a terminal window that remains open until the user explicitly closes it. The user can enter data into the window. Use with commands that take some input, produce some output, then terminate (for example, ls directory). |
|
Temporary terminal emulator window. The action opens a terminal window that closes as soon as the command is completed. Use with full-screen commands (for example, vi). |
Use the TERM_OPTS field in the action definition to specify command-line options for the terminal emulator.
For example, the following action prompts for the execution host:
ACTION OpenTermOnSystemUserChooses { WINDOW_TYPE PERM_TERMINAL EXEC_HOST %(String)"Remote terminal on:"% TERM_OPTS -title %(String)"Window title:"% EXEC_STRING $SHELL }
The default terminal emulator used by actions is dtterm. You can change this to another terminal emulator. The default terminal emulator is used when the action does not explicitly specify a terminal emulator to use.
The terminal emulator used by actions must have these command-line options:
-title window_title
-e command
Two resources determine the default terminal emulator used by actions:
The localTerminal resource specifies the terminal emulator used by local applications.
*localTerminal: terminal
For example:
*localTerminal: xterm