Skip to content

Commit

Permalink
don’t try to hide the cursor without a TTY present
Browse files Browse the repository at this point in the history
  • Loading branch information
trehn committed Oct 4, 2017
1 parent 59feb42 commit 6ab4634
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bundlewrap/utils/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ def activate(self):
self._signal_handler_thread.start()
signal(SIGINT, sigint_handler)
signal(SIGQUIT, sigquit_handler)
write_to_stream(STDOUT_WRITER, HIDE_CURSOR)
if TTY:
write_to_stream(STDOUT_WRITER, HIDE_CURSOR)

def ask(self, question, default, epilogue=None, input_handler=DrainableStdin()):
assert self._active
Expand Down Expand Up @@ -239,7 +240,8 @@ def ask(self, question, default, epilogue=None, input_handler=DrainableStdin()):

def deactivate(self):
self._active = False
write_to_stream(STDOUT_WRITER, SHOW_CURSOR)
if TTY:
write_to_stream(STDOUT_WRITER, SHOW_CURSOR)
signal(SIGINT, SIG_DFL)
signal(SIGQUIT, SIG_DFL)
self._signal_handler_thread.join()
Expand Down

0 comments on commit 6ab4634

Please sign in to comment.