-
Notifications
You must be signed in to change notification settings - Fork 563
stdio kernel server #363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stdio kernel server #363
Conversation
|
|
||
| var text = reader.ReadToEnd(); | ||
| var events = text.Split("\r\n") | ||
| var events = text.Split(Environment.NewLine) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might be running on a different system from where the input was sent, or a notebook authored on one OS might be opened on another, so we should split on both \n and \r\n. I think we have code elsewhere doing that and it might be a worthwhile utility method to pull out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated, what if the SubmitCode.Code contains newlines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A single command/response must not contain newlines because we read them by calling console.ReadLine() (effectively). The code we're looking at here is the test code, which just pushes everything into a single stream and then reads it all back at once (hence the splitting)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the process when someone submits a cell with multiple lines of code inside it? If we read the input to the end, instead of line by line, could it simplify this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not valid json to have an unescaped line break in a string. It's fair for us to expect clients to escape their newlines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add a test for this though
No description provided.