After running the following innocuous looking shell script, the terminal stops working correctly and I have to type 'reset' to recover it:
#!/bin/bash
sudo sleep 1 &
python3 -c 'print("hi")'
I ran the script as a non-root user without sudo (i.e. just ./my-script, not sudo ./my-script)
On a fresh install of Ubuntu 22.10, after running the script, the terminal stops echoing characters that you type.
On Ubuntu 22.04, carriage returns don't result in correct placement of characters (you see zig zag lines of text instead of columns).
I managed to fix the issue by turning off the use-pty option in /etc/sudoers
On Ubuntu 22.10:
Sudo version 1.9.11p3
Sudoers policy plugin version 1.9.11p3
Sudoers file grammar version 48
Sudoers I/O plugin version 1.9.11p3
Sudoers audit plugin version 1.9.11p3