Skip to content

Utilities for use when printing text to terminals.

License

Notifications You must be signed in to change notification settings

sgebbie/pony-tty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TTY Utilities

TTY.isatty(n) can be used to test if the file descriptor n is connected to a terminal or not.

Obviously this requires knowing the "raw" file descriptor number. However, for the common use case it is easy to guess that you are considering:

  • 0 : stdin
  • 1 : stdout
  • 2 : stderr

And this is mostly aimed at testing of stdout is being piped elsewhere, or is connected to a terminal that supports colour, or other specialised terminal operations.

Mode Constants

The library also contains a range of ANSI constants for common colours, or common modes e.g. bold, underline, reset.

About

Utilities for use when printing text to terminals.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published