Skip to content
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
Merged

Add isTTY function #1622

merged 29 commits into from
Feb 3, 2019

Conversation

dsseng
Copy link
Contributor

@dsseng dsseng commented Jan 29, 2019

Fixes #1607.
To test run in REPL:

deno.isTTY()

@hayd
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.

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

ry commented Jan 29, 2019

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

@hayd
Copy link
Contributor

hayd commented Jan 29, 2019

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

src/msg.fbs Outdated Show resolved Hide resolved
@dsseng
Copy link
Contributor Author

dsseng commented Jan 30, 2019

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

Will do!

js/os.ts Outdated Show resolved Hide resolved
@dsseng
Copy link
Contributor Author

dsseng commented Feb 1, 2019

@hayd @ry Fixed all problems, waiting for review

js/os.ts Outdated 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 Show resolved Hide resolved
@dsseng
Copy link
Contributor Author

dsseng commented Feb 2, 2019

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

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 Show resolved Hide resolved
tools/is_tty_test.py Outdated 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 Show resolved Hide resolved
Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now - thanks!

@ry ry merged commit 181b032 into denoland:master Feb 3, 2019
@dsseng dsseng deleted the is-tty branch February 3, 2019 05:29
ry added a commit to ry/deno that referenced this pull request Feb 9, 2019
- 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
- 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants