8 ms·
Thefuck – Corrects your previous console command
- softinio 8y agoIs this a new millenial thing of constantly using profanities? Just based on the naming of the repo I will never use or look at this. I have kids I intend to teach programming to so not nice naming this way. I can only assume project owner thinks its cool. More like his parents never taught him manners.
- moate 8y ago>>new millenial thing No, it's an "everyone curses, and sometimes cursing is funny" thing. The irony here is that you probably use Git in the first place. Why did Linus name it that again?
- lmohseni 8y agoThat's really funny, I had to have a look at the source: https://github.com/git/git/blob/master/README.md https://github.com/git/git/blob/master/README.md TL;DR: Git can stand for > "goddamn idiotic truckload of sh*t": when it breaks
- deleted 8y ago[deleted]
- django-boy 8y agoThis is cool but I'd rather not have any magic happening when running commands
- amlozano 8y agoYou have to explicitly turn on a setting to have it run the corrected command without confirmation.
- khacking 8y agoUse this daily. Have it aliased to ‘ff’ though. Favourite use is pushing a new branch
- jimnotgym 8y agoThis is where I used it a moment ago! Not an error, just faster than the actual command.
- webdevatlurk 8y agoI used thefuck for a little while, but have removed it since I found this gist https://gist.github.com/robmiller/6018582 https://gist.github.com/robmiller/6018582 The `git publish` alias eliminated the vast majority of my thefuck usage.
- ISL 8y agoPrevious discussion (from four years ago -- many commits since then): https://news.ycombinator.com/item?id=9396116 https://news.ycombinator.com/item?id=9396116
- excalibur 8y agoAnd another (from a year and a half ago, probably the one that prompted me to install it): https://news.ycombinator.com/item?id=14133647 https://news.ycombinator.com/item?id=14133647
- another-cuppa 8y agoTraining yourself to be tolerant of mistakes on the command line seems like a very bad idea. Carpenters have a rule: measure twice, cut once. Train yourself to do the same.
- copperx 8y agoIt's almost like typing commands isn't the friendliest human-computer interface. But because we have been utterly incapable of taking the Unix paradigm to the graphical world, we have settled for the error-prone, zero-discoverability atrocity of a command line. Don't get me wrong, I love the command line because there isn't a more powerful interface, but I'm appalled to see that there aren't any attempts to make it better. 70 years isn't enough to come up with something better?
- whateveruser 8y agoEvery time this point comes up, ultimate conclusion isn't the CLI is bad or can't be improved, but the VT220 and similar emulation that's holding things back. Any person who has developed a terminal emulator can attest to that. There have been and are attempts at a much better CLI, but until we drop the legacy baggage, we can't have nicer things, at least in a sane way. But if we do that, we don't really have enough incentive to use the newer tools. Its a catch 22 after all.
- vokep 8y agoSounds like someone needs to just Do it.
- xte 8y agoMh, did you ever tried modern shell like zsh or fish, with a reasonable config? Or even better, despite a bit steep learning curve, eshell (Emacs) if you already know Emacs and elisp a bit or xonsh if you are already familiar with Python. As an Emacs (EXWM) user I agree that pure CLI is limited and pure text-based interfaces without terminal emulators limits are far superior but... Well, today outside Emacs we only have CLIs, the rest is so limited and limiting that can be used only for desktop end-user stuff. Even Microsoft Windows mandate CLI for serious system use/management...
- Symmetry 8y agoSeems really cool in general but I wish it corrected gitp ush to git push instead of git ush. That sort of thing is a fairly common typo for me :\ Still, I expect I'll find it very useful.
- AgalmicVentures 8y agoIt's possible to configure git so that git ush becomes git push; for example, this .gitconfig correct many common misspellings: https://github.com/AgalmicVentures/Environment/blob/master/configs/.gitconfig https://github.com/AgalmicVentures/Environment/blob/master/c... Obviously such corrections should be used judiciously.
- kentt 8y agoI used this for a while, but it added a lot of time to start each shell. Might not be an issue for you, but might save you some time if you are wondering why it takes a full second to open a new shell.
- JesseAldridge 8y agoI had this sitting in my .bash_profile for a while. I removed it after I realized it was adding like 2 seconds of lag before my terminal finished loading.
- Detry322 8y agoJust hopping on this thread post for a shameless plug: https://github.com/Detry322/git-psuh https://github.com/Detry322/git-psuh Why make errors do the thing you want, when you can make them do things you don't want? ¯\_(ツ)_/¯ Carpenters have "measure twice, cut once", since there's risk involved with a mistake. Let's make mistakes risky.
- dag11 8y agoThanks! I hate it :)
- fokov 8y ago"I've cut the board 3 times and it is still too short!"
- Yetanfou 8y agoI built a bathroom with a heated floor last year. For that floor I needed 42 m of heating cable. This cable is poured into the flooring screed and as such can not be spliced, it has to be in one piece. Ir ordered 42 m and got a parcel with 18 m in the mail, apparently the person who processed the order mistook the order sequence number - 18 - for the ordered amount. I notified the supplier about this mistake, added some photo's of the cable - which is helpfully marked in meter-increments - and told them to send a new cable as I ordered 42 m. The supplier sent 24 m of cable.
- moate 8y agoSpare the rod, spoil the child!
- jwilbs 8y agoThis genuinely made me chuckle. That said, if mistyping ‘git push’ is a common occurrence, why not just define an alias?
- DeRock 8y agoEven better, git supports correction of misspelled commands, but you have to turn it on: git config --global help.autocorrect 1 Although I also alias gti—>git...
- duckqlz 8y agoThis is pretty cool I usually do the following >aptget install oops ERROR!! >^t^t- >apt-get install oops WIN but thefuck saves me 2 precious keystrokes (even more when I change the command from "fuck" to "f!").
- mario0b1 8y agoThe part where it gets insane is when you realize that you don't have to type apt-get and apt only is enough, because you are not a script and (probably) don't care about different output formats. That blew my mind and cut a lot of mistakes!
- xte 8y agoNice, not really useful for me (I can correct by hand, probably at the same or higher speed and with more predictable results) however nice and scenic. Perhaps it work better inside zsh/fish autocorrection, extended it to another level :-)
- foxhop 8y agoWhat about `fc` (fix command)? It's been in unix forever. $ echoo "hi" -bash: echoo: command not found $ fc # this will open your editor to fix the command. echo "hi" hi
- dang 8y agoBig previous discussions: https://news.ycombinator.com/item?id=14133647 https://news.ycombinator.com/item?id=14133647 https://news.ycombinator.com/item?id=9396116 https://news.ycombinator.com/item?id=9396116
- jcahill84 8y agoI'm surprised at how serious people are being in the comments... This is amazing. My team and I had a good laugh. Great work.
- vanous 8y agoI run a discord bot for wot blitz and the close to 70 commands are available under about 180 names, based on observed typos people make. Autocorrect on mobile cannot be used (it puts an extra space before the word) and it's sometimes super hilarious to see what people come up with... Example: ?clantopplayers aliases=["clanplayerscharts","clanplayers","calntopplayers","calnplayerscharts","calnplayers", "clantoplayers"]
- inetsee 8y agoThis sounds a lot like "Do What I Mean" (aka DWIM), which dates back to BBN Lisp, around 1966. See https://en.wikipedia.org/wiki/DWIM https://en.wikipedia.org/wiki/DWIM
- anon49124 8y agoFYI: zsh's autocorrection is fairly good.
- Yetanfou 8y agoWhether it is this `fuck` command, an earlier `dwim` command or any of the helpful shells or missing command tools which provide me with suggestions, for some reason it still seems to be faster to do it the way I've been doing it for years: some_long_commnd^C some_long_command --wthi^C some_long_command --with these --optoin^C some_long_command --with these --options It might be that I just type fast - I do - or it might be that the cognitive load imposed by using 'helpful' tools like these is higher than the simple act of machine-gun-typing out a corrected version of the command. Repeatedly typing out a command also has a bit of a satisfying "now you listen to _me_ you frickin' pile of silicon" to it, maybe that plays a role as well. On the other side it could be viewed as a form of self-flagellation, doing penance for the sin of not typing out the correct version in the first place. Whatever its virtues, it seems to work for me.
- charlesism 8y agoThis is the umpteenth app with "Fuck" in its name to hit the front page here. I should try harder to be constructive, but these titles turn me off. Not that I understand the attraction of using an obscenity as a project title, but surely there are more creative obscenities that would suffice.