Skip to content
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

Added an infinite loop after updating packages. #21

Merged
merged 1 commit into from Nov 3, 2015

Conversation

DavidEGrayson
Copy link
Contributor

This prevents control from returning to the parent shell, which might in turn try to execute commands found inside PS1 and PROMPT_COMMAND.

My tests showed that adding this loop is sufficient to stop issues like msys2/MSYS2-packages#373. Commit 3f3ecb3 (which sets PS1 and PROMPT_COMMAND to safe values) might not even be necessary any more if we add this infinite loop, but it's good to keep that just in case. To test this loop, I opened a fresh copy of msys64 (extracted from the .tar.xz file), added my loop to /usr/bin/update-core, ran update-core, then closed the window, and everything was fine even though my PS1 had shell commands in it.

One annoying thing is that when I click on the "X" to close the Window after updating packages, MinTTY detects that update-core is still running and it shows a message box to ask if I really want to quit. That is unfortunate but I hope that our users are smart enough to click "OK".

This is cleaner than turning update-core into a shell function, because doing it that way puts environment variables like TEXTDOMAIN and shell functions like msg into the scope of the user's current shell even if no packages are updated. (I tested this claim to verify it is true.)

Sorry for making 3 pull requests instead of thinking ahead a little bit and just making one.

This prevents control from returning to the parent shell, which might in
turn try to execute commands found inside PS1 and PROMPT_COMMAND.

This commit should fix issues like this:

msys2/MSYS2-packages#373
Alexpux added a commit that referenced this pull request Nov 3, 2015
Added an infinite loop after updating packages.
@Alexpux Alexpux merged commit f5bbd79 into Alexpux:master Nov 3, 2015
@DavidEGrayson
Copy link
Contributor Author

Thanks @Alexpux!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants