Key lag stacking when typing in console or shell

Problem description:
When typing via replit (fast) it seems to be bundling up all the sent characters at once, resulting in my program thinking they are all one character and using only the last one.

Expected behavior:
The keystrokes are delivered one at a time (like when i test locally).

Actual behavior:
The keystrokes come all at once.

Steps to reproduce:
Run the microchat repl and type fast.

Bug appears at this link:

Chrome on windows