nvbn / thefuck

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

pacman is not sudoed after typo #480

Open ishitatsuyuki opened 8 years ago

ishitatsuyuki commented 8 years ago

Example:

 ⚙  ishitatsuyuki@XPS13  ~  pacmn -Syu
zsh: correct 'pacmn' to 'pacman' [nyae]? n
zsh: command not found: pacmn
 ✘ ⚙  ishitatsuyuki@XPS13  ~  fuck
pacman -Syu [enter/↑/↓/ctrl+c]
error: you cannot perform this operation unless you are root.
 ✘ ⚙  ishitatsuyuki@XPS13  ~  fuck
pacman -Syu [enter/↑/↓/ctrl+c]
error: you cannot perform this operation unless you are root.
 ✘ ⚙  ishitatsuyuki@XPS13  ~  fuck
pacman -Syu [enter/↑/↓/ctrl+c]
error: you cannot perform this operation unless you are root.
 ✘ ⚙  ishitatsuyuki@XPS13  ~  fuck
pacman -Syu [enter/↑/↓/ctrl+c]
error: you cannot perform this operation unless you are root.
 ✘ ⚙  ishitatsuyuki@XPS13  ~  

(Ignore powerline symbols)

 ✘ ⚙  ishitatsuyuki@XPS13  ~  thefuck --version
The Fuck 3.6 using Python 3.5.1
 ⚙  ishitatsuyuki@XPS13  ~  zsh --version
zsh 5.2 (x86_64-unknown-linux-gnu)

Didn't found any duplicates in issue, but I'm not sure if this is already fixed.

ghost commented 8 years ago

I got a similar behavior but not exactly like this. It corrects the typo, then simply says no fucks given. Still haven-t checked if it's pacman related or if I cannot chain-correct at all:

[Arch Linux \m/ ~]$ pacmn -S vim bash: pacmn: command not found [Arch Linux \m/ ~]$ fuck pacman -S vim [enter/↑/↓/ctrl+c] error: you cannot perform this operation unless you are root. [Arch Linux \m/ ~]$ fuck No fucks given

EDIT: I tried with the mount command, and it seems I just cannot chain-fuck at all. Seems like the fuck command tries to correct the previous fuck command

Epse commented 7 years ago

Couldn't we just make pacman automatically correct with sudo? Like I quickly whipped up here: https://github.com/Epse/thefuck/blob/pacmansudo/thefuck/rules/pacman.py