Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void initializeReadline(Value readlineModule) {
Terminal terminal;
Object[] signalHandlers = stashSignalHandlers();
try {
terminal = TerminalBuilder.builder().jna(false).streams(inputStream, outputStream).system(true).build();
terminal = TerminalBuilder.builder().streams(inputStream, outputStream).system(true).build();
} catch (IOException ex) {
throw new RuntimeException("unexpected error opening console reader", ex);
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ def validate_repl(stdin, python_args=(), ignore_preamble=True, extra_input_and_o
rlist, _, _ = select.select([pty_parent], [], [], 60)
assert pty_parent in rlist, f"Timed out waiting for REPL output. Output: {whole_out}{out}"
out += os.read(pty_parent, 1024).decode('utf-8')
out = re.sub(r'\x1b\[(?:\?2004[hl]|\d+[A-G])', '', out)
# Strip terminal control sequences, including the mode 2027 and device-attributes
# probes emitted by JLine 4 while detecting grapheme-cluster support.
out = re.sub(r'\x1b\[(?:\?2004[hl]|\?2027\$p|c|\d+[A-G])', '', out)
out = re.sub(r'\r+\n', '\n', out)
if out.endswith(('\n... ', '>>> ')):
prompt = out[:3]
Expand All @@ -134,7 +136,7 @@ def validate_repl(stdin, python_args=(), ignore_preamble=True, extra_input_and_o
os.write(pty_parent, b'\x04') # Ctrl-D / EOF
proc.wait(timeout=60)
out = os.read(pty_parent, 1024).decode('utf-8')
out = re.sub(r'\x1b\[\?2004[hl]', '', out)
out = re.sub(r'\x1b\[(?:\?2004[hl]|\?2027\$p|c)', '', out)
assert not out.strip(), f"Garbage after EOF:\n{out!r}"
return
else:
Expand Down
Loading