Skip to content

Add stdinIsTTY (#30) #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 19, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add stdinIsTTY (#30)
  • Loading branch information
matoruru committed Mar 19, 2021
commit 5e60f67d42f8a72f6641fe2701cebcd9afafe9df
6 changes: 6 additions & 0 deletions src/Node/Process.purs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module Node.Process
, stdin
, stdout
, stderr
, stdinIsTTY
, stdoutIsTTY
, stderrIsTTY
, version
Expand Down Expand Up @@ -151,6 +152,11 @@ stdout = process.stdout
stderr :: Writable ()
stderr = process.stderr

-- | Check whether the standard input stream appears to be attached to a TTY.
-- | It is a good idea to check this before processing the input data from stdin.
stdinIsTTY :: Boolean
stdinIsTTY = process.stdin.isTTY

-- | Check whether the standard output stream appears to be attached to a TTY.
-- | It is a good idea to check this before printing ANSI codes to stdout
-- | (e.g. for coloured text in the terminal).
Expand Down