Problem description:
Resizing (using the draggable bar) or moving the console tab/window to a different location in the workspace removes the last line of output if there is no “\n” printed at the end. Is replit intentionally designed this way or is it glitch? Please comment if you’ve also seen this bug.
print("foo")
no bug
print("foo", end = "")
bug
Seems to also be present in other coding languages
cout << "foo";
bug
cout << "foo" << endl;
no bug
Expected behavior:
Resizing/moving the console does not destroy the last line of output when there is no “\n” printed at the end.
Actual behavior:
Resizing/moving the console does destroy the last line of output when there is no “\n” printed at the end.
Workaround (maybe):
Add a trailing newline to all output.
Steps to reproduce:
- Run this code in a repl:
Python:
print("foo", end="")
C++:
#include <iostream>
using namespace std;
int main() {
cout << "foo";
}
- Resize (using the draggable bar) or move the console tab/window to a different location in the workspace.
Browser:
Chrome