Skip to content

Commit

Permalink
better handling of raw mode switch
Browse files Browse the repository at this point in the history
  • Loading branch information
pmp-p committed Nov 16, 2023
1 parent f55c995 commit daa4091
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pygbag/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ def truc(*argv, **kw):
fakehost.window.console = NoOp("platform.window.console")
fakehost.window.console.log = print
fakehost.window.get_terminal_console = truc
fakehost.window.RAW_MODE = 0


import aio.filelike

Expand Down
13 changes: 13 additions & 0 deletions pygbag/support/cross/aio/toplevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,16 @@ def prompt(self):
embed.prompt()

async def interact(self):

# in raw mode we don't want that loop to read input
import sys
from platform import window

if sys.platform in ('emscripten','wasi') and not aio.cross.simulator:
raw_mix = True
else:
raw_mix = False

# multiline input clumsy sentinel
last_line = ""

Expand All @@ -227,6 +237,9 @@ async def interact(self):

while not aio.exit:
await asyncio.sleep(0)
#if raw_mix:
if window.RAW_MODE:
continue

if aio.exit:
return
Expand Down
6 changes: 5 additions & 1 deletion scripts/build-rootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,17 @@ try:
except:
print('_curses not built')
#rich
import getpass
import fractions
#nurses_2
import tty
# cffi
import copy
# datetime
# datetime
import datetime
import _strptime
Expand Down

0 comments on commit daa4091

Please sign in to comment.