Skip to content

Commit

Permalink
Fixed headless mode on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
AcidWeb committed Nov 2, 2020
1 parent 333d94b commit 4e552fd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CurseBreaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,20 @@ def start(self):
if not self.headless:
self.console.print('Automatic update of all addons will start in 5 seconds.\n'
'Press any button to enter interactive mode.', highlight=False)
kb = KBHit()
kb = KBHit()
starttime = time.time()
keypress = None
while True:
# noinspection PyUnboundLocalVariable
if self.headless:
break
elif kb.kbhit():
keypress = kb.getch()
break
elif time.time() - starttime > 5:
break
kb.set_normal_term()
if not self.headless:
kb.set_normal_term()
if not keypress:
if not self.headless:
self.print_header()
Expand Down

0 comments on commit 4e552fd

Please sign in to comment.