Created attachment 399158 [details] cook tty if operating in a multibyte environment (utf-8) Description of problem: When a read command is run in a ksh script and is allowed to time out, ksh fails to restore the tty settings. Due to this the terminal stops echoing characters anymore until it is reset. This happens only when the locale is set to something with utf-8 encoding (en_US.UTF-8 for example) Version-Release number of selected component (if applicable): ksh-20100309-1.fc14.x86_64 How reproducible: Always Steps to Reproduce: Run the following script and wait for it to return: ############################## #!/bin/ksh TMOUT=5 read ############################## Actual results: Script returns after 5 seconds and the terminal no longer echoes key strokes Expected results: Script returns after 5 seconds and the terminal behaves normally Additional info: When running in a UTF-8 locale, ksh employs viraw mode to accept input, due to which the tty is made into a raw terminal with echo disabled. It does not however, restore the terminal on exit, leading to a tty which does not echo keystrokes. Attached patch fixes this.
I can reproduce this, but attached patch does not fix the problem for me. I'll forward this issue to upstream
That's odd, I had tested this on rawhide. Can you try this scratch build; it's for x86_64: https://koji.fedoraproject.org/koji/taskinfo?taskID=2044973 -- Fedora Bugzappers volunteer triage team https://fedoraproject.org/wiki/BugZappers
oops, I've updated wrong ksh package. I can confirm the patch fixes this bug
fixed since: ksh-20100309-2.fc14 (and also F13,F12,F11)
The fix is incorrect and does not work. It should not be: sh_isoption(mbwide()||SH_EMACS) It should be: mbwide()||sh_isoption(SH_EMACS) Can we reopen this or do I need to file another bug? -- Fedora Bugzappers volunteer triage team https://fedoraproject.org/wiki/BugZappers
oops, my bad... will fix it now thanks for catching this
fixed since: ksh-20100309-3.fc14 (and also F13,F12,F11)
ksh-20100309-3.fc12 has been submitted as an update for Fedora 12. http://admin.fedoraproject.org/updates/ksh-20100309-3.fc12
ksh-20100309-3.fc11 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/ksh-20100309-3.fc11
ksh-20100309-3.fc13 has been submitted as an update for Fedora 13. http://admin.fedoraproject.org/updates/ksh-20100309-3.fc13
ksh-20100309-3.fc13 has been pushed to the Fedora 13 stable repository. If problems still persist, please make note of it in this bug report.
ksh-20100309-3.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report.
ksh-20100309-3.fc12 has been pushed to the Fedora 12 stable repository. If problems still persist, please make note of it in this bug report.
this is still broken in ksh for the following reproducer: ############################## #!/bin/ksh -i TMOUT=5 read ############################## Tested on: (locale en_US.UTF-8) ksh-20110630-2.fc17.x86_64 ksh-20110505-2.fc15.x86_64