I've installed Python (to get pip) and then ran pip install thefuck.
It seems to have installed the fuck okay, but it's acting strangely in Git Bash.
In GitBash, it displays the menu, but doesn't accept Enter. It just executes whatever I enter when I press Ctrl-C (but not the unfucked command) - see this example:

Any ideas what the problem may be, and how to fix it?
I am also seeing this behavior
This is an issue with the mintty terminal. See https://github.com/git-for-windows/git/wiki/FAQ#some-native-console-programs-dont-work-when-run-from-git-bash-how-to-fix-it
So I guess we should add --winpty option, that would prepend alias with winpty:
eval $(thefuck --alias --winpty)
?
@nvbn The problem with python is, that it thinks it runs in non-interactive mode because it is connected with pipes when running in mintty. For the python interpreter it's enough to pass the -i flag:
$ python
# nothing happens, need to press Ctrl-C to quit
$ python -i
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
I'm not sure if we can somehow force python to run in interactive mode.
Any news on this issue?
Same problem here. Is there any (even dirty) workaround plz ?
Same problem here. Is there any (even dirty) workaround plz ?
You can run it from cmd.exe or from PowerShell

Any ideas on a solution for this? Been driving me crazy
So I guess we should add
--winptyoption, that would prepend alias withwinpty:eval $(thefuck --alias --winpty)?
@nvbn I tried that, no luck.
Couldn't figure out a way to solve this.
Hey, @divykj. Please, give the above referenced CL a try and LMK how it goes. Thanks!
@scorphus I tried it, and this happened,
Bummer =/ Do you feel like investigating this further?
I'll try some changes and investigate further from my side tomorrow.
But I don't see much hope there. 馃槙
@divykj, would you please give it another try? Thanks in advance!
I've re-installed python 3.8, pip and then thefuck, and it works for me in Git Bash for Windows and via ConEmu. Thanks guys - I can now use therapeutic swearing again in Git!
I think I should close this, as the original issue is resolved.
But it seems like there are similar/related issues faced by others.
Shall I close, or leave open?
@grrrrinaldi, you got it working because of the ConEmu I think, but the issue still persists in mintty based git bash. We are close to resolving that too.
@scorphus, this still won't work. Since you are using nix file path on windows installation of python (which understands windows paths like C:\tmp and not /c/tmp).
An elegant solution is using $HOME environment variable. In both git bash and python, it points to the same directory, plus it is in the proper format (C:\Users\<username> in python(windows) and /c/Users/<username> in git bash).
Edit: I tried using the $HOME env variable and got it working for me.
Yeah, @divykj, I thought about using user鈥檚 home as the base directory for the command file. More specifically, something XDG-compliant-ish like cache. And that should be a specific file, always the same鈥攏ot a temp one鈥攂eing overwritten every time. I鈥檓 not super fond of this solution. But, it seems like we鈥檙e going to have to opt for it.
Before we do so... Like @grrrrinaldi, I got it working just fine. Works for me with Git for Windows 2.26.2 on a VM with Windows 10. 2.26.2 was installed with default options (no installation option changed.)
@grrrrinaldi, do you confirm the last commit referenced above works? Just to make sure as it is not yet released. Also, would you be willing to test yet another alternative, HOME/XDG based solution? Thanks in advance.
Most helpful comment
Any ideas on a solution for this? Been driving me crazy