-
-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use_pty option causes terminal to stop working correctly after running simple script #237
Comments
The problem is that sudo cannot easily tell that the command is being run in the background when it is run from a shell script where there is no job control. A workaround is to add |
If sudo is not the process group leader and stdin is not a tty, we may be running as a background job via a shell script. Start the command in the background to avoid changing the terminal mode from a background process. GitHub issue #237
This should be fixed in sudo 1.9.13. |
For anyone coming here later, please note that turning off |
After running the following innocuous looking shell script, the terminal stops working correctly and I have to type 'reset' to recover it:
I ran the script as a non-root user without sudo (i.e. just
./my-script
, notsudo ./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
The text was updated successfully, but these errors were encountered: