Since past statements need to be re executed to maintain that the current cell is executed in the expected state, os.Stdout is redirected to nil during this phase to skip any prints.
Before executing the statements in the current cell, the stream is restored so that only the output from the current cell is captured.
This also removes the cleanEvalStmt which was, in some cases, deleting incorrect print statements such as in
f := func () {
fmt.Println("test")
}
// In another cell
f()
Since past statements need to be re executed to maintain that the current cell is executed in the expected state,
os.Stdout
is redirected tonil
during this phase to skip any prints.Before executing the statements in the current cell, the stream is restored so that only the output from the current cell is captured.
This also removes the
cleanEvalStmt
which was, in some cases, deleting incorrect print statements such as in