magpie icon indicating copy to clipboard operation
magpie copied to clipboard

[REPL Bug] stdin does not scans full string.

Open ghost opened this issue 5 years ago • 1 comments

@haifenghuang Why stdin >> variable method scans only a char, not a line in REPL?

F8AB0326-9BCD-4D1A-9338-BC2765D3D7B3

Also stdin.read() too

This is only in REPL, if running this code from file, everything works correctly.

ghost avatar Aug 21 '20 21:08 ghost

I've checked this, and cannot figure out what's the problem. I think it might related to liner problem, so I've contacted the liner author, below is the link:

os.Stdin.Read only read one character

so, my suggestion is not use stdin >> variable in the REPL, it's a REPL bug, and cannot be easily solved.

haifenghuang avatar Aug 24 '20 03:08 haifenghuang