News for hackers. Stuff that matters.
Re:Show HN: Oh-heck, a terminal command for when you forget ... by imglorp on Friday March 18, 2022 @09:37AM (#30722052)
And here's a command that tries to fix up a mistake after you type it. Like this one, it's also named like what you might say afterwards.

https://github.com/nvbn/thefuck

Re:Show HN: Oh-heck, a terminal command for when you forget ... by frx on Friday March 18, 2022 @09:44AM (#30722138)
I was just about to share this. I use this daily and this magnificent tool is really helpful.
Re:Show HN: Oh-heck, a terminal command for when you forget ... by throwaway158497 on Friday March 18, 2022 @04:15PM (#30726976)
This is great. Is there an easy "open source terminal emulator" where I can run this after I typed enter but before it is executed? More like. is there a way the terminal can understand I typed a bad command and then give suggestions for changing it.
Re:Show HN: Oh-heck, a terminal command for when you forget ... by mikevin on Saturday March 19, 2022 @08:13AM (#30733152)
GNU Emacs has a module called eshell-smart that borrows from Plan 9's 9term.

When you run a command it moves the cursor (point in Emacs) to the beginning of the line and shows output below it. If you start typing it jumps to a new prompt allowing you to enter a separate command. If instead you move right from the beginning of the line it sees you are correcting/tweaking the command and doesn't jump to a new line when you type something. If you press space it acts like a pager.

It's pretty neat because it allows you to review the output without getting in the way.

Re:Show HN: Oh-heck, a terminal command for when you forget ... by alanbernstein on Friday March 18, 2022 @05:35PM (#30727850)
I would guess the shell is a more accessible place to accomplish something like this. For example: https://superuser.com/questions/175799/does-bash-have-a-hook...
Re:Show HN: Oh-heck, a terminal command for when you forget ... by throwaway158497 on Monday March 21, 2022 @01:41PM (#30757277)
Interesting. Thanks very much. I will try it out.
Re:Show HN: Oh-heck, a terminal command for when you forget ... by wffurr on Friday March 18, 2022 @11:03AM (#30723189)
efb
Re:Show HN: Oh-heck, a terminal command for when you forget ... by bitbatbangboo on Friday March 18, 2022 @01:47PM (#30725261)
aliased as 'duck' to be work-friendly
Re:Show HN: Oh-heck, a terminal command for when you forget ... by thiht on Friday March 18, 2022 @05:55PM (#30728037)
Where do you work that anyone would care you use a command called « fuck »?
Re:Show HN: Oh-heck, a terminal command for when you forget ... by matyasrichter on Friday March 18, 2022 @07:52PM (#30729186)
Damn, imagine working at a place where at the end of each day, the management goes through your shell history and includes it in a "performance review".
Re:Show HN: Oh-heck, a terminal command for when you forget ... by imglorp on Saturday March 19, 2022 @11:54AM (#30734793)
Or you're giving a live demo in a terminal to the bosses and you mistype a command, then your fingers slip by habit...
Re:Show HN: Oh-heck, a terminal command for when you forget ... by perlwle on Saturday March 19, 2022 @10:54AM (#30734224)
I afraid that I may say it out loud if I type `fuck` too many times.. ;0
Re:Show HN: Oh-heck, a terminal command for when you forget ... by pmarreck on Friday March 18, 2022 @08:52PM (#30729696)
Mormon boss, eh