Method: CommandKit::Terminal#terminal

Defined in:
lib/command_kit/terminal.rb

#terminalIO?

Returns the terminal object, if stdout is connected to a terminal.

Examples:

terminal
# => #<File:/dev/tty>

Returns:

  • (IO, nil)

    The IO objects or nil if stdout is not connected to a terminal.

See Also:



97
98
99
# File 'lib/command_kit/terminal.rb', line 97

def terminal
  IO.console if terminal?
end