nvbn / thefuck

Magnificent app which corrects your previous console command.
MIT License
84.95k stars 3.43k forks source link

How to configure "fuck" alias on Windows 11? #1399

Open JieJiaoDeMao-wjz opened 1 year ago

JieJiaoDeMao-wjz commented 1 year ago

I'm using Windows 11 Professional Edition. Recently, I installed thefuck module in the command line: pip install thefuck And then I ran this command: fuck And the output is:


Please put iex "$(thefuck --alias)" in your $profile and apply changes with . $profile or restart your shell.
More details - https://github.com/nvbn/thefuck#manual-installation```
And I followed the link, but I still don't know how to configure the alias. Anybody can help? Many thanks!

PS: I want to make `fuck` work correctly both in CMD and Windows Powershell.
Aworldc commented 11 months ago

It seems to be telling you to put the powershell command iex "$(thefuck --alias)" into your powershell profile.

If you use powershell, that's probably a good idea. Google how to do it, because all I know about powershell profiles is that they exist.

If you don't want to use powershell, you could use git bash, which allows you to use bash on windows, without any kind of virtualization. With that, you could put eval $(thefuck --alias) into a .bashrc file in your home directory, just as you would on linux. (see the readme)

If you otherwise really want to use standard command prompt, you may be able to do some hacky workaround with batch files, but I don't even know where to start on that.

JieJiaoDeMao-wjz commented 11 months ago

It worked! Thanks for your help. :)

At 2023-11-04 15:08:08, "Aworldc" @.***> wrote:

it seems to be telling you to put the powershell command iex "$(thefuck --alias)" into your powershell profile.

if you use powershell, that's probably a good idea. google how to do it because all i know about powershell profiles is they exist.

if you don't want to use powershell, you could use git bash, which allows you to use bash on windows, without any kind of virtualization. then you could put eval $(thefuck --alias) into a .bashrc file in your home directory, just as you would on linux. (see the readme)

If you otherwise really want to use standard command prompt, you may be able to do some hacky workaround with batch files.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>