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

Add isTTY function #1622

Merged
merged 29 commits into from Feb 3, 2019

Conversation

3 participants
@sh7dm
Copy link
Contributor

sh7dm commented Jan 29, 2019

Fixes #1607.
To test run in REPL:

deno.isTTY()
@hayd

This comment has been minimized.

Copy link
Contributor

hayd commented Jan 29, 2019

I think this should take the file as an argument, either file.isTTY or isTTY(file), specifically you may want to be able to see if stdout or stderr is a tty.

Note: You can use atty for this, I think there's no need to use libc/unsafe.

Show resolved Hide resolved js/os.ts Outdated
Show resolved Hide resolved src/ops.rs Outdated
@ry

This comment has been minimized.

Copy link
Collaborator

ry commented Jan 29, 2019

Needs tests. Probably custom tests written in python...

@hayd

This comment has been minimized.

Copy link
Contributor

hayd commented Jan 29, 2019

Are stdin, stdout and stderr the only files that can be TTY?

Show resolved Hide resolved src/msg.fbs Outdated

sh7dm added some commits Jan 30, 2019

@sh7dm

This comment has been minimized.

Copy link
Contributor Author

sh7dm commented Jan 30, 2019

Needs tests. Probably custom tests written in python...

Will do!

Show resolved Hide resolved js/os.ts Outdated

sh7dm added some commits Jan 30, 2019

@sh7dm

This comment has been minimized.

Copy link
Contributor Author

sh7dm commented Feb 1, 2019

@hayd @ry Fixed all problems, waiting for review

Show resolved Hide resolved js/os.ts Outdated

sh7dm added some commits Feb 1, 2019

Show resolved Hide resolved js/os.ts Outdated
Show resolved Hide resolved src/ops.rs
Show resolved Hide resolved js/os.ts Outdated
Show resolved Hide resolved js/os.ts Outdated
Show resolved Hide resolved js/os.ts
Show resolved Hide resolved js/os_test.ts Outdated
Show resolved Hide resolved js/os.ts Outdated

sh7dm added some commits Feb 2, 2019

@sh7dm

This comment has been minimized.

Copy link
Contributor Author

sh7dm commented Feb 2, 2019

@ry thanks for help, I've fixed all problems

Show resolved Hide resolved tools/is_tty_test.py Outdated
Show resolved Hide resolved tools/is_tty_test.py Outdated
Show resolved Hide resolved tools/is_tty_test.ts Outdated
Show resolved Hide resolved tools/is_tty_test.py Outdated
Show resolved Hide resolved tools/is_tty_test.py Outdated

sh7dm added some commits Feb 2, 2019

Show resolved Hide resolved tools/is_tty_test.py Outdated

sh7dm added some commits Feb 2, 2019

Show resolved Hide resolved tools/test.py
Show resolved Hide resolved tools/is_tty_test.py Outdated
Show resolved Hide resolved tools/is_tty_test.py Outdated
@ry

ry approved these changes Feb 3, 2019

Copy link
Collaborator

ry left a comment

LGTM now - thanks!

@ry ry merged commit 181b032 into denoland:master Feb 3, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
license/cla Contributor License Agreement is signed.
Details

@sh7dm sh7dm deleted the sh7dm:is-tty branch Feb 3, 2019

ry added a commit to ry/deno that referenced this pull request Feb 9, 2019

v0.2.11
- Add deps to --info output (denoland#1720)
- Add --allow-read (denoland#1689)
- Add deno.isTTY() (denoland#1622)
- Add emojis to permission prompts (denoland#1684)
- Add basic WebAssembly support (denoland#1677)
- Add `NO_COLOR` support https://no-color.org/ (denoland#1716)
- Add color exceptions (denoland#1698)
- Fix: do not load cache files when recompile flag is set (denoland#1695)
- Upgrade V8 to 7.4.98 (denoland#1640)

ry added a commit that referenced this pull request Feb 9, 2019

v0.2.11
- Add deps to --info output (#1720)
- Add --allow-read (#1689)
- Add deno.isTTY() (#1622)
- Add emojis to permission prompts (#1684)
- Add basic WebAssembly support (#1677)
- Add `NO_COLOR` support https://no-color.org/ (#1716)
- Add color exceptions (#1698)
- Fix: do not load cache files when recompile flag is set (#1695)
- Upgrade V8 to 7.4.98 (#1640)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment