Replit console logs everything multiple times when text is wrapped

Problem description:
Whenever I have a node.js repl that either has a console.log message that is too long or that contains a /n, if I use prompt() (both with prybar and via prompt-sync) every time the user types something it logs everything to the console again. So essentially, whenever a newline appears in a node.js repl, any input logs everything again.

Expected behavior:
Code:
prompt("Make a choice on this to-do list!\nOne: Add\nTwo: Remove\nThree: Exit\nYour choice: ")

Output:
Make a choice on this to-do list!
One: Add
Two: Remove
Three: Exit
Your choice: One

Actual behavior:
Make a choice on this to-do list!
One: Add
Two: Remove
Three: Exit
Your choice: O
Make a choice on this to-do list!
One: Add
Two: Remove
Three: Exit
Your choice: On
Make a choice on this to-do list!
One: Add
Two: Remove
Three: Exit
Your choice: One

Steps to reproduce:
Make a node.js repl that has text that either wraps the screen or contains \n and allows for user input, most easily achieved with the prompt-sync package

Bug appears at this link:
https://replit.com/@AugustNorman1/Sorting-Algorithms?v=1#index.js

Browser: Firefox
OS: Windows 10
Device (Android, iOS, NA leave blank):
Desktop app version (Avatar menu->“Version”) or NA:
Plan (Free, Replit Core): Free

@AugustNorman1 Hi there. I forked and ran your Repl but the output seemed identical to what I got in VSCode. Am I misunderstanding or perhaps reproducing it incorrectly?

Did you type when prompted to? The first line has \n tags that lead to the bug. The initial output is fine, but each time you type it logs everything again. I’ve tried to add an image showing this

@AugustNorman1 Yes, I can see it keeps repeating the prompt each time I type. However, it does the same in VSCode so I’m not sure this issue is specific to Replit. Are you seeing a different behavior in another IDE?

I see some reports of this in general with this module:

  1. Stack Overflow

  2. GitHub

This does not occur solely with prompt-sync, this also happens with the native prompt syntax included with prybar. Here is an older repl which used prybar and the native prompt command https://replit.com/@AugustNorman1/BMI-Calculator?v=1 I have edited the initial prompt() to include a newline to reproduce the bug. As far as I know, this is unintended behavior. It may be behavior that comes with node.js, however. I have not used the native prompt() command as written with prybar in VS code, so I don’t know if the bug occurs there too (I used to use replit essentially solely for projects with prompt() due to the prybar implementation).

It may be behavior that comes with node.js, however.

Yes, this may be the case. Thanks for reporting it, though. Definitely an interesting one I hadn’t come across yet.