start-server-and-test icon indicating copy to clipboard operation
start-server-and-test copied to clipboard

Terminal output hijacked after test finishes

Open seanforyou23 opened this issue 6 years ago • 2 comments

Thank you for this nice package!

Is this a bug report or a feature request?

Bug Report

  • Version: ^1.5.0
  • Platform: macOS High Sierra 10.13.6
  • Expected Behavior: Tool runs (as part of npm script) and releases control back to my keyboard after it finishes.
  • Actual Behavior: Script runs, and completes successfully, however the keyboard input stops coming through when I type into the terminal after the script finishes. The only way to fix it is to reset the terminal. Even tput reset doesn't clean it up!

You can find this in action in our core repository: https://github.com/patternfly/patternfly-next

  1. Clone it
  2. Install it with npm install
  3. Run npm script that uses this package with npm run test:ci
  4. Type into terminal you just ran the test in, notice the characters you type are no longer output in the console, however the input is still being captured
  5. type reset, notice problem is fixed

Apologies if I've overlooked something and this isn't a bug with this lib. Thanks for looking into this!

seanforyou23 avatar Aug 01 '18 03:08 seanforyou23

yeah, I have noticed it too, not sure how fix this

bahmutov avatar Aug 10 '18 17:08 bahmutov

Running stty -a before/after shows that input echo has been turned off by the time start server and test script completes. If you stty echo, to re-enable, after the script completes, echoing of terminal input is fixed.

Read more about this here: https://www.computerhope.com/unix/ustty.htm

Not sure if this is an acceptable solution, would it even work on Windows machine?

Btw this doesn't appear to be an issue on linux.. Hope this helps.

seanforyou23 avatar Aug 16 '18 13:08 seanforyou23