[fx][emu] Fix terminal check script for "stty sane".

Previously we check if the shell contains option "-i" to determine
whether the script is running in interactive mode, and only reset
the terminal if script runs in interactive mode.

However when we run "fx emu", though the script is running in non-
interactive mode (because we spawn a new shell, instead of sourcing
the script in the interactive shell), the input and output are both
to a terminal; so the terminal still could be broken by QEMU, and
thus we still need a "stty sane" command after QEMU quits.

We fix this by changing the teriminal check script: we use "-t"
test operator to check if stdin is associated with a terminal
and only do stty sane when it is true.

TEST=fx emu (stty sane called)
     fx emu-remote (stty sane not called; no error messages).

Change-Id: Ie8ed877d7fe5db699e8b79e225bf53aa8773df47
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/453516
Reviewed-by: Wayne Piekarski <waynepie@google.com>
Reviewed-by: Renato Mangini Dias <mangini@google.com>
Testability-Review: Wayne Piekarski <waynepie@google.com>
Commit-Queue: Yilong Li <liyl@google.com>
1 file changed
tree: af7f5e64e2ab7fd4d989015cb2dcc9519d7d42ae
  1. boards/
  2. build/
  3. bundles/
  4. docs/
  5. examples/
  6. garnet/
  7. products/
  8. scripts/
  9. sdk/
  10. src/
  11. third_party/
  12. tools/
  13. zircon/
  14. .clang-format
  15. .clang-tidy
  16. .gitattributes
  17. .gitignore
  18. .gn
  19. .style.yapf
  20. AUTHORS
  21. BUILD.gn
  22. CODE_OF_CONDUCT.md
  23. CONTRIBUTING.md
  24. LICENSE
  25. OWNERS
  26. PATENTS
  27. README.md
  28. rustfmt.toml
README.md

Fuchsia

Pink + Purple == Fuchsia (a new operating system)

What is Fuchsia?

Fuchsia is a modular, capability-based operating system. Fuchsia runs on modern 64-bit Intel and ARM processors.

Fuchsia is an open source project with a code of conduct that we expect everyone who interacts with the project to respect.

Read more about Fuchsia's principles.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.