-
Notifications
You must be signed in to change notification settings - Fork 98
Breakage with zsh when doing Ctrl+C #11
Comments
|
Hello, Example: After the list is complete, i should enter a number. When pressing CTRL+C, yaourt should be terminated. (it was so in the history). But, only "^C" will be written, it will not terminated. The "^C"'s ware not removable via backspace. Sometimes (i found no way to "safely" reproduce this"), after exiting yaourt, my command line is "broken". When pressing the up-key, i see control chars, and the enter-key do not work always on input's. I need to close the terminal and reopen it. Some facts:
Here's an example of the location in the yaourt script, after this issue occurs: prompt $(gettext 'Enter n° of packages to be installed (ex: 1 2 3 or 1-3)') starting bash and typing "read -ea packagesnum" will work as expected. But in my case, it occurs in bash, too. So, how can a application (yaourt) break an underlinding shell? This should not be possible. Is this now a bug of the shell environment (for example readline) or yaourt? Greetings from Germany, |
|
I'm getting the same problem in zsh. I'm glad I'm not the only one... this issue has been seriously weirding me out. |
|
It seems that yaourt -Su then control+c generates some broken chars in zsh so that normal enter is not valid sometimes. Pressing ctrl+enter instead of enter after inputing password will make it work temporally. Typing "reset" will fix it for current zsh session . But it is still annoying to me. |
|
@arakis After checking the upgrade time of yaourt and zsh. It seem that the most suspected causes are bash and readline as they are updated at 4.23 which is very close to the date I began to have this bug. Yaourt on the other hand has not been upgraded since a year ago. |
|
This could be a bug in yaourt exposed by a readline upgrade. |
|
Do you have the same problem if you run yaourt without color ? |
|
Confirmed, reproduced the issue with --nocolor. Repro: |
|
I don't think it's a yaourt issue, I can reproduce it just by running : and ctrl-c Can you confirm me that ? |
|
Unable to reproduce with your test case. |
|
Ok, forget about the test, the breakage remains after a zsh exit if I stay in the same terminal. It seems like yaourt changes the state of the terminal, but I don't know how for now :| I executed an stty before and after running yaourt, here is the diff : I search why. |
|
One idea without looking into the diff or the source: By default most terminals work in the cooked mode. User input is sent to the program only after pressing Enter. To read for example "Question (Y/n)" the terminal must be in the raw mode. http://en.wikipedia.org/wiki/Cooked_mode Maybe zsh does not reset the mode after the program exits, but bash does. |
|
I think this might actually be a bug in bash (or readline) that doesn't reset the terminal correctly if a trap is set. Here is a minimal test-case that triggers the bug : #!/bin/bash
cleanup() { :; }
trap cleanup 0
read -e dummyEdit : the bug is introduced with this bash commit : http://git.savannah.gnu.org/cgit/bash.git/commit/?id=9b86eb22c434c8848c9d592cba32d7e8fdf61459 |
|
A patch has been published : https://lists.gnu.org/archive/html/bug-bash/2014-09/msg00031.html |
|
I can confirm that that patch fixes the problem for me. For some reason, the patch hasn't made it into the bash yet though. |
|
I have the same problem with zsh. |
|
I've had the same issue with zsh -- just in case anyone stumbles across this issue before it gets fixed, a temporary solution is using |
Since recently, in zsh, doing yaourt -Su followed by Ctrl+C at the "Continue upgrade ? [Y/n]" prompt results in shell breakage; password prompts no longer work properly for example.
This doesn't happen on bash. I haven't tested in yaourt-git yet.
The text was updated successfully, but these errors were encountered: