new Term()
The terminal.
- Source:
Methods
-
close()
-
Close the connection to terminal.
- Source:
-
closeHandler(handler) → {Term}
-
Set a handler that will be called when the terminal is closed.
Parameters:
Name Type Description handlerfunction the handler - Source:
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 textstring the text to echo - Source:
Returns:
a reference to this, so the API can be used fluently- Type
- Term
-
interruptHandler(handler) → {Term}
-
Set an interrupt signal handler on the term.
Parameters:
Name Type Description handlerSignalHandler the interrupt handler - Source:
Returns:
a reference to this, so the API can be used fluently- Type
- Term
-
lastAccessedTime() → {number}
-
- Source:
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 promptstring the displayed prompt lineHandlerfunction the line handler called with the line completionHandlerfunction the completion handler - Source:
-
resizehandler(handler) → {Term}
-
Parameters:
Name Type Description handlerfunction - Source:
Returns:
- Type
- Term
-
setSession(session) → {Term}
-
Associate the term with a session.
Parameters:
Name Type Description sessionSession the session to set - Source:
Returns:
a reference to this, so the API can be used fluently- Type
- Term
-
stdinHandler(handler) → {Term}
-
Parameters:
Name Type Description handlerfunction - Source:
Returns:
- Type
- Term
-
suspendHandler(handler) → {Term}
-
Set a suspend signal handler on the term.
Parameters:
Name Type Description handlerSignalHandler the suspend handler - Source:
Returns:
a reference to this, so the API can be used fluently- Type
- Term
-
write(data) → {Term}
-
Parameters:
Name Type Description datastring - Source:
Returns:
- Type
- Term