linux – Sudo commands just go to newline

When entering sudo commands, my system sometimes arbitrarily doesnt execute the command but goes to a newline.

For instance, typing sudo apt-get update and hitting enter just goes to a blank newline where I can carry on typing.

When I reset my machine, two out of five times it goes back to normal which is quite baffling given that I dont really change anything between resets.

Can anyone provide any insights as to why my system does this?

I am using the Ubuntu distribution.