The VS Code REPL does not seem to handle readline()
properly - see this post.
FWIW, using a standard Julia REPL the following code works for me on Win10 to terminate with CTRL+D followed by ENTER (while the VS Code REPL misses the first input line):
function readlines_stdin()
lines = String[]
while true
s = readline(stdin)
Int(first(s)) == 4 && break # CTRL+D, then ENTER to exit
push!(lines, s)
end
return lines
end
lines = readlines_stdin()