PHP Class PhpSchool\CliMenu\Terminal\UnixTerminal

Author: Michael Woodward ([email protected])
Inheritance: implements PhpSchool\CliMenu\Terminal\TerminalInterface
Show file Open project: php-school/cli-menu

Public Methods

Method Description
__construct ( ) Initialise the terminal from resource
clean ( ) Clean the whole console without jumping the window
clear ( ) Clear the terminal window
clearLine ( ) : void Clear the current cursors line
disableCursor ( ) Disable cursor
enableCursor ( ) Enable cursor
getDetails ( ) : string Get terminal details
getHeight ( ) : integer Get the available height of the terminal
getKeyedInput ( ) : string
getWidth ( ) : integer Get the available width of the terminal
isCanonical ( ) : boolean Check if TTY is in canonical mode Assumes the terminal was never in canonical mode
isTTY ( ) : boolean Test whether terminal is valid TTY
moveCursorToColumn ( integer $column ) Move the cursor to the start of a specific column
moveCursorToRow ( integer $rowNumber ) Move the cursor to the start of a specific row
moveCursorToTop ( ) : void Move the cursor to the top left of the window
setCanonicalMode ( boolean $useCanonicalMode = true ) Toggle canonical mode on TTY
supportsColour ( ) : boolean Test whether terminal supports colour output

Private Methods

Method Description
getOriginalConfiguration ( ) : string Get the original terminal configuration / mode

Method Details

__construct() public method

Initialise the terminal from resource
public __construct ( )

clean() public method

Clean the whole console without jumping the window
public clean ( )

clear() public method

Clear the terminal window
public clear ( )

clearLine() public method

Clear the current cursors line
public clearLine ( ) : void
return void

disableCursor() public method

Disable cursor
public disableCursor ( )

enableCursor() public method

Enable cursor
public enableCursor ( )

getDetails() public method

Get terminal details
public getDetails ( ) : string
return string

getHeight() public method

Get the available height of the terminal
public getHeight ( ) : integer
return integer

getKeyedInput() public method

public getKeyedInput ( ) : string
return string

getWidth() public method

Get the available width of the terminal
public getWidth ( ) : integer
return integer

isCanonical() public method

Check if TTY is in canonical mode Assumes the terminal was never in canonical mode
public isCanonical ( ) : boolean
return boolean

isTTY() public method

Test whether terminal is valid TTY
public isTTY ( ) : boolean
return boolean

moveCursorToColumn() public method

Move the cursor to the start of a specific column
public moveCursorToColumn ( integer $column )
$column integer

moveCursorToRow() public method

Move the cursor to the start of a specific row
public moveCursorToRow ( integer $rowNumber )
$rowNumber integer

moveCursorToTop() public method

Move the cursor to the top left of the window
public moveCursorToTop ( ) : void
return void

setCanonicalMode() public method

Toggle canonical mode on TTY
public setCanonicalMode ( boolean $useCanonicalMode = true )
$useCanonicalMode boolean

supportsColour() public method

Test whether terminal supports colour output
public supportsColour ( ) : boolean
return boolean