# Class: CommandProcess

## vertx-shell-js/command_process~ CommandProcess

#### new CommandProcess()

The command process provides interaction with the process of the command provided by Vert.x Shell.

Source:
  - vertx-shell-js/command_process.js, line 34

### Methods

#### args() → {Array.<string>}

Source:
  - vertx-shell-js/command_process.js, line 75

##### Returns:

- the actual string arguments of the command
- Type
    Array.<string>

#### argsTokens() → {Array.<CliToken>}

Source:
  - vertx-shell-js/command_process.js, line 61

##### Returns:

- the unparsed arguments tokens
- Type
    Array.<CliToken>

#### backgroundHandler(handler) → {CommandProcess}

Set a background handler, this handler is called when the command is running and put to background.

##### Parameters:

Name | Type | Description
--- | --- | ---
`handler` | function | the background handler

Source:
  - vertx-shell-js/command_process.js, line 226

##### Returns:

this command

Type
  CommandProcess

#### commandLine() → {CommandLine}

Source:
  - vertx-shell-js/command_process.js, line 89

##### Returns:

- the command line object or null
- Type
    CommandLine

#### end(status)

End the process.

##### Parameters:

Name | Type | Description
--- | --- | ---
`status` | number | the exit status.

Source:
  - vertx-shell-js/command_process.js, line 269

#### endHandler(handler) → {CommandProcess}

Set an end handler, this handler is called when the command is ended, for instance the command is running and the shell closes.

##### Parameters:

Name | Type | Description
--- | --- | ---
`handler` | function | the end handler

Source:
  - vertx-shell-js/command_process.js, line 196

##### Returns:

a reference to this, so the API can be used fluently

Type
  CommandProcess

#### foregroundHandler(handler) → {CommandProcess}

Set a foreground handler, this handler is called when the command is running and put to foreground.

##### Parameters:

Name | Type | Description
--- | --- | ---
`handler` | function | the foreground handler

Source:
  - vertx-shell-js/command_process.js, line 241

##### Returns:

this command

Type
  CommandProcess

#### interruptHandler(handler) → {CommandProcess}

Set an interrupt handler, this handler is called when the command is interrupted, for instance user press `Ctrl-C`.

##### Parameters:

Name | Type | Description
--- | --- | ---
`handler` | function | the interrupt handler

Source:
  - vertx-shell-js/command_process.js, line 148

##### Returns:

this command

Type
  CommandProcess

#### isForeground() → {boolean}

Source:
  - vertx-shell-js/command_process.js, line 117

##### Returns:

- true if the command is running in foreground
- Type
    boolean

#### resizehandler(handler) → {CommandProcess}

##### Parameters:

Name | Type | Description
--- | --- | ---
`handler` | function |

Source:
  - vertx-shell-js/command_process.js, line 255

##### Returns:

Type
  CommandProcess

#### resumeHandler(handler) → {CommandProcess}

Set a resume handler, this handler is called when the command is resumed, for instance user types `bg` or `fg` to resume the command.

##### Parameters:

Name | Type | Description
--- | --- | ---
`handler` | function | the interrupt handler

Source:
  - vertx-shell-js/command_process.js, line 180

##### Returns:

this command

Type
  CommandProcess

#### session() → {Session}

Source:
  - vertx-shell-js/command_process.js, line 103

##### Returns:

- the shell session
- Type
    Session

#### stdinHandler(handler) → {CommandProcess}

##### Parameters:

Name | Type | Description
--- | --- | ---
`handler` | function |

Source:
  - vertx-shell-js/command_process.js, line 130

##### Returns:

Type
  CommandProcess

#### suspendHandler(handler) → {CommandProcess}

Set a suspend handler, this handler is called when the command is suspended, for instance user press `Ctrl-Z`.

##### Parameters:

Name | Type | Description
--- | --- | ---
`handler` | function | the interrupt handler

Source:
  - vertx-shell-js/command_process.js, line 164

##### Returns:

this command

Type
  CommandProcess

#### vertx() → {Vertx}

Source:
  - vertx-shell-js/command_process.js, line 47

##### Returns:

- the current Vert.x instance
- Type
    Vertx

#### write(data) → {CommandProcess}

Write some text to the standard output.

##### Parameters:

Name | Type | Description
--- | --- | ---
`data` | string | the text

Source:
  - vertx-shell-js/command_process.js, line 211

##### Returns:

a reference to this, so the API can be used fluently

Type
  CommandProcess