# 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 111

##### Returns:

the actual string arguments of the command

Type
  Array.<string>

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

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

##### 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 259

##### Returns:

this command

Type
  CommandProcess

#### commandLine() → {CommandLine}

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

##### 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 302

#### 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 229

##### 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 274

##### Returns:

this command

Type
  CommandProcess

#### height() → {number}

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

##### Returns:

the current height, i.e the number of columns or if unknown

Type
  number

#### 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 181

##### Returns:

this command

Type
  CommandProcess

#### isForeground() → {boolean}

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

##### 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 288

##### 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 213

##### Returns:

this command

Type
  CommandProcess

#### session() → {Session}

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

##### Returns:

the shell session

Type
  Session

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

##### Parameters:

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

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

##### 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 197

##### Returns:

this command

Type
  CommandProcess

#### type() → {string}

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

##### Returns:

the declared tty type, for instance , , etc... it can be null when the tty does not have declared its type.

Type
  string

#### vertx() → {Vertx}

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

##### Returns:

the current Vert.x instance

Type
  Vertx

#### width() → {number}

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

##### Returns:

the current width, i.e the number of rows or if unknown

Type
  number

#### 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 244

##### Returns:

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

Type
  CommandProcess