From 3a8d170f051d53a57e9648314431ca87e5c0241a Mon Sep 17 00:00:00 2001 From: d6 Date: Sat, 21 Jan 2023 16:07:56 -0500 Subject: [PATCH] get interactive shell working --- term.py | 12 +++++------- term.tal | 11 +++++++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/term.py b/term.py index dcc63ec..51b4bd4 100755 --- a/term.py +++ b/term.py @@ -15,20 +15,18 @@ def run(args): def main(): args = sys.argv[1:] if len(args) < 2: - print('usage: %s ROM SHELL') + print('usage: %s ROM SHELL [ ARGS... ]') print('') print('execute the given uxn terminal program (ROM)') - print('and start a shell process (SHELL).') + print('and start a shell process (SHELL + ARGS).') print('') - print('example: %s term.rom /bin/bash' % sys.argv[0]) + print('example: %s term.rom /bin/bash -i' % sys.argv[0]) sys.exit(1) - rom = args[0] - shell = args[1] - term = run(['uxnemu', rom]) + term = run(['uxnemu', args[0]]) term_out = term.stdout.fileno() - shell = run([shell]) + shell = run(args[1:]) shell_out = shell.stdout.fileno() while shell.poll() is None and term.poll() is None: diff --git a/term.tal b/term.tal index 5a685ae..7946c27 100644 --- a/term.tal +++ b/term.tal @@ -27,9 +27,9 @@ .cols LDZ2 #30 SFT2 .Screen/w DEO2 ( set colors ) - #08f3 .System/r DEO2 - #0cd5 .System/g DEO2 - #0b66 .System/b DEO2 + #0ff0 .System/r DEO2 + #0f88 .System/g DEO2 + #0f0f .System/b DEO2 ( set pos, subinput flag ) .buffer .pos STZ @@ -87,7 +87,10 @@ .tint STZ JMP2r @show-cursor - ;draw-cursor JMP2 + .tint LDZ + #44 .tint STZ + ;draw-cursor JSR2 + .tint STZ JMP2r @draw-cursor .cur-x LDZ2 #30 SFT2 .Screen/x DEO2