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

Fix getch on windows #414

Merged
merged 2 commits into from
Dec 10, 2015
Merged

Fix getch on windows #414

merged 2 commits into from
Dec 10, 2015

Conversation

pakrym
Copy link
Contributor

@pakrym pakrym commented Nov 30, 2015

Fixes #378

@@ -2,6 +2,8 @@
from warnings import warn
from pprint import pformat
import sys
import win_unicode_console
win_unicode_console.enable() #https://github.com/tartley/colorama/issues/32
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the issue related here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you need to init win_unicode_console before importing colorama

@nvbn
Copy link
Owner

nvbn commented Dec 1, 2015

I've made a few changes, please check branch pakrym-master.

@pakrym
Copy link
Contributor Author

pakrym commented Dec 1, 2015

You moved win_unicode_console.enable() call after importing colorama they fixed the issue (tartley/colorama#32) but this change is not in colorama-0.3.3 which thefuck uses.
Related: https://github.com/Drekin/win-unicode-console#compatibility

nvbn added a commit that referenced this pull request Dec 3, 2015
@nvbn
Copy link
Owner

nvbn commented Dec 3, 2015

@pakrym they said:

Since win_unicode_console replaces the streams in order to support Unicode, win_unicode_console.enable has to be called before colorama.init so everything works as expected.

So win_unicode_console.enable call is before colorama.init.

Also I've updated code in branch pakrym-master, please check is it works on windows correctly =)

@pakrym
Copy link
Contributor Author

pakrym commented Dec 3, 2015

I meant other part of it:

As of colorama v0.3.3, there is an early binding issue (tartley/colorama#32), so win_unicode_console.enable has to be called even before importing colorama

nvbn added a commit that referenced this pull request Dec 4, 2015
@nvbn
Copy link
Owner

nvbn commented Dec 4, 2015

@pakrym ok, now it calls win_unicode_console.enable before import.

Is it work ok?

@nvbn nvbn merged commit f9aa0e7 into nvbn:master Dec 10, 2015
@nvbn
Copy link
Owner

nvbn commented Dec 10, 2015

Checked by myself, seems working.

amtrivedi91 added a commit to amtrivedi91/thefuck that referenced this pull request Aug 31, 2016
amtrivedi91 added a commit to amtrivedi91/thefuck that referenced this pull request Aug 31, 2016
amtrivedi91 added a commit to amtrivedi91/thefuck that referenced this pull request Aug 31, 2016
amtrivedi91 added a commit to amtrivedi91/thefuck that referenced this pull request Aug 31, 2016
amtrivedi91 added a commit to amtrivedi91/thefuck that referenced this pull request Aug 31, 2016
amtrivedi91 added a commit to amtrivedi91/thefuck that referenced this pull request Aug 31, 2016
riley-martine pushed a commit to riley-martine/thefuck that referenced this pull request Dec 7, 2023
riley-martine pushed a commit to riley-martine/thefuck that referenced this pull request Dec 7, 2023
riley-martine pushed a commit to riley-martine/thefuck that referenced this pull request Dec 7, 2023
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.

2 participants