Fixed invalid reference in rnx

This commit is contained in:
Mark Qvist 2022-05-25 15:08:45 +02:00
parent fc80dd2614
commit 7848b7e396

View File

@ -28,6 +28,7 @@ import argparse
import shlex import shlex
import time import time
import sys import sys
import tty
import os import os
from RNS._version import __version__ from RNS._version import __version__
@ -565,13 +566,26 @@ def main():
) )
if args.destination != None and args.interactive: if args.destination != None and args.interactive:
# command_history_max = 5000
# command_history = []
# command_current = ""
# history_idx = 0
# tty.setcbreak(sys.stdin.fileno())
code = None code = None
while True: while True:
try: try:
cstr = str(code) if code and code != 0 else "" cstr = str(code) if code and code != 0 else ""
print(cstr+"> ",end="") prompt = cstr+"> "
command = input() print(prompt,end="")
# cmdbuf = b""
# while True:
# ch = sys.stdin.read(1)
# cmdbuf += ch.encode("utf-8")
# print("\r"+prompt+cmdbuf.decode("utf-8"), end="")
command = input()
if command.lower() == "exit" or command.lower() == "quit": if command.lower() == "exit" or command.lower() == "quit":
exit(0) exit(0)
@ -583,6 +597,10 @@ def main():
if command.lower() == "clear": if command.lower() == "clear":
print('\033c', end='') print('\033c', end='')
# command_history.append(command)
# while len(command_history) > command_history_max:
# command_history.pop(0)
else: else:
code = execute( code = execute(
configdir = args.config, configdir = args.config,
@ -608,9 +626,8 @@ def main():
print("") print("")
except KeyboardInterrupt: except KeyboardInterrupt:
# tty.setnocbreak(sys.stdin.fileno())
print("") print("")
if resource != None:
resource.cancel()
if link != None: if link != None:
link.teardown() link.teardown()
exit() exit()