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

running "fuck" twice almost gave me a heartattack #1

Closed
eridal opened this issue Apr 17, 2015 · 17 comments

Comments

@eridal
Copy link

commented Apr 17, 2015

who@where:~$ fuck
No fuck given
who@where:~$ fuck
fsck from util-linux 2.20.1
e2fsck 1.42.9 (4-Feb-2014)
/dev/sda6 is mounted.

WARNING!!!  The filesystem is mounted.   If you continue you ***WILL***
cause ***SEVERE*** filesystem damage.

Do you really want to continue<n>? no
check aborted.
@eridal eridal changed the title running "fuck" twice almost gave a heartattack running "fuck" twice almost gave me a heartattack Apr 17, 2015
@jbrooksuk

This comment has been minimized.

Copy link

commented Apr 17, 2015

This doesn't happen for me on OSX 10.10, that's interesting.

@nvbn

This comment has been minimized.

Copy link
Owner

commented Apr 17, 2015

It's a bit strange, do you wrote something in another terminal between two fucks?

@curtisz

This comment has been minimized.

Copy link

commented Apr 17, 2015

Haha this made my day. However, I could not replicate this on Linux Mint 17 (Ubuntu 14.04).

@brianshumate

This comment has been minimized.

Copy link

commented Apr 17, 2015

The fsck would not succeed as a non-root user anyway.

@LarsMichelsen

This comment has been minimized.

Copy link
Contributor

commented Apr 17, 2015

Can reproduce this on ubuntu 14.10. For me I just need to execute this twice:

> /usr/lib/command-not-found fuck
No command 'fuck' found, did you mean:
 Command 'suck' from package 'suck' (universe)
 Command 'fsck' from package 'util-linux' (main)
fuck: command not found

The order of suck and fsck is changed on each call. When fsck is shown first, the error appears.

When I remove the subshell from the shell alias this is easily visible:

> fuck
No fuck given
> fuck
fsck
> fuck
suck
@eridal

This comment has been minimized.

Copy link
Author

commented Apr 17, 2015

At first, I tested the apt-get, as shown in the README, and then tried running fuck again, and that was the first time the error happened.

Then I closed the console, and opened another again; and that's the output you're seeing.

btw, I'm running Linux where 3.13.0-49-generic #81-Ubuntu SMP Tue Mar 24 19:29:48 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

@LarsMichelsen

This comment has been minimized.

Copy link
Contributor

commented Apr 17, 2015

btw. I just added an additional alias for testing. It simply outputs the command fuck would execute:

alias tryfuck='thefuck $(fc -ln -1)'

@mvirkkunen

This comment has been minimized.

Copy link

commented Apr 17, 2015

@brianshumate Wouldn't a third fuck fix that though?

nvbn added a commit that referenced this issue Apr 17, 2015
@nvbn

This comment has been minimized.

Copy link
Owner

commented Apr 17, 2015

I added check if previous command is fuck. It should fix this issue.

@brianshumate

This comment has been minimized.

Copy link

commented Apr 17, 2015

@mvirkkunen given enough fucks, i think this could totally fuck one's system up, yes.

@LarsMichelsen

This comment has been minimized.

Copy link
Contributor

commented Apr 17, 2015

Confirmed. Fixed for me.

However, I would prefer to make the rule "thefuck/rules/no_command.py" ask before executing the command suggested by /usr/lib/command-not-found. Would make it a lot less dangerous.

@zmarouf

This comment has been minimized.

Copy link

commented Apr 17, 2015

fuck needs audio speech recognition. This way if it fucks things up and you end up screaming 'fuck!' out loud it will know not to do that again... or not. Fuck it if I know.

@sebie

This comment has been minimized.

Copy link

commented Apr 17, 2015

I got to admit, you created a damn good title for this issue..

@zmarouf Deffenitly a +1 on that!

@revmischa

This comment has been minimized.

Copy link

commented Apr 18, 2015

alias nostop="sudo halt"

@nvbn

This comment has been minimized.

Copy link
Owner

commented Apr 21, 2015

@LaMi- you need to try require_confirmation settings option, it's doing almost what you want.

nvbn pushed a commit that referenced this issue Apr 22, 2015
Synchronize with nvbn's repo.
@g76r

This comment has been minimized.

Copy link

commented Apr 23, 2015

I think @LaMi- pointed the most important issue: proposing once suck before fsck and the other time fsck before suck is not acceptable, since order matters: suck is far better before fsck

nvbn added a commit that referenced this issue May 1, 2015
nvbn added a commit that referenced this issue May 2, 2015
@nvbn

This comment has been minimized.

Copy link
Owner

commented Jul 20, 2015

Summing up everything, now confirmation required by default and when previous command is fuck (or another alias) will be used a command before it.

@nvbn nvbn closed this Jul 20, 2015
amtrivedi91 added a commit to amtrivedi91/thefuck that referenced this issue Aug 31, 2016
amtrivedi91 added a commit to amtrivedi91/thefuck that referenced this issue Aug 31, 2016
Synchronize with nvbn's repo.
amtrivedi91 added a commit to amtrivedi91/thefuck that referenced this issue Aug 31, 2016
amtrivedi91 added a commit to amtrivedi91/thefuck that referenced this issue Aug 31, 2016
amtrivedi91 added a commit to amtrivedi91/thefuck that referenced this issue Aug 31, 2016
amtrivedi91 added a commit to amtrivedi91/thefuck that referenced this issue Aug 31, 2016
amtrivedi91 added a commit to amtrivedi91/thefuck that referenced this issue Aug 31, 2016
amtrivedi91 added a commit to amtrivedi91/thefuck that referenced this issue Aug 31, 2016
Synchronize with nvbn's repo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.