# Class: Term

## vertx-shell-js/term~ Term

#### new Term()

The terminal.

Source:
  - vertx-shell-js/term.js, line 33

### Methods

#### close()

Close the connection to terminal.

Source:
  - vertx-shell-js/term.js, line 238

#### closeHandler(handler) → {Term}

Set a handler that will be called when the terminal is closed.

##### Parameters:

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

Source:
  - vertx-shell-js/term.js, line 224

##### Returns:

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

Type
  Term

#### echo(text) → {Term}

Echo some text in the terminal, escaped if necessary.

##### Parameters:

Name | Type | Description
--- | --- | ---
`text` | string | the text to echo

Source:
  - vertx-shell-js/term.js, line 142

##### Returns:

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

Type
  Term

#### height() → {number}

Source:
  - vertx-shell-js/term.js, line 71

##### Returns:

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

Type
  number

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

Set an interrupt signal handler on the term.

##### Parameters:

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

Source:
  - vertx-shell-js/term.js, line 171

##### Returns:

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

Type
  Term

#### lastAccessedTime() → {number}

Source:
  - vertx-shell-js/term.js, line 128

##### Returns:

the last time this term received input

Type
  number

#### readline(prompt, lineHandler, completionHandler)

Prompt the user a line of text, providing a completion handler to handle user's completion.

##### Parameters:

Name | Type | Description
--- | --- | ---
`prompt` | string | the displayed prompt
`lineHandler` | function | the line handler called with the line
`completionHandler` | function | the completion handler

Source:
  - vertx-shell-js/term.js, line 202

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

##### Parameters:

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

Source:
  - vertx-shell-js/term.js, line 84

##### Returns:

Type
  Term

#### setSession(session) → {Term}

Associate the term with a session.

##### Parameters:

Name | Type | Description
--- | --- | ---
`session` | Session | the session to set

Source:
  - vertx-shell-js/term.js, line 157

##### Returns:

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

Type
  Term

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

##### Parameters:

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

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

##### Returns:

Type
  Term

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

Set a suspend signal handler on the term.

##### Parameters:

Name | Type | Description
--- | --- | ---
`handler` | SignalHandler | the suspend handler

Source:
  - vertx-shell-js/term.js, line 186

##### Returns:

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

Type
  Term

#### type() → {string}

Source:
  - vertx-shell-js/term.js, line 45

##### Returns:

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

Type
  string

#### width() → {number}

Source:
  - vertx-shell-js/term.js, line 58

##### Returns:

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

Type
  number

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

##### Parameters:

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

Source:
  - vertx-shell-js/term.js, line 114

##### Returns:

Type
  Term