The output of thefuck --version (something like The Fuck 3.1 using Python 3.5.0 and Bash 4.4.12(1)-release): The Fuck 3.32 using Python 3.10.7 and ZSH 5.9
Anything else you think is relevant:
It would be nice to be able to have rules where no corrected command is specifically run instead of a failty one, but simply run another command that has side effects. E.g. I have a rule for firebase CLI where at times I get
$ firebase emulators:start --import=./dump --export-on-exit
...
✔ functions: Loaded functions definitions from source: <omitted>.
^C
⚠ emulators: Received SIGINT (Ctrl-C) 2 times. You have forced the Emulator Suite to exit without waiting for 2 subprocesses to finish. These processes may still be running on your machine:
┌────────────────────┬────────────────┬────────┐
│ Emulator │ Host:Port │ PID │
├────────────────────┼────────────────┼────────┤
│ Firestore Emulator │ localhost:8180 │ 164748 │
├────────────────────┼────────────────┼────────┤
│ Pub/Sub Emulator │ localhost:8185 │ 164793 │
└────────────────────┴────────────────┴────────┘
To force them to exit run:
kill 164748 164793
firebase-kill.py
from thefuck.types import Command
def match(command: Command) -> bool:
return 'You have forced the Emulator Suite to exit without waiting' in command.output
def get_new_command(command: Command) -> str | list[str]:
import re
# ...
# To force them to exit run:
#
# kill 101663 101714
kill_pids = re.findall('(kill ((\\d+\\s?)+))', command.output)
return kill_pids[0][0].strip() or None
enabled_by_default = True
def side_effect(old_command: Command, fixed_command: str) -> None:
# actually subprocess.call(<cmd>, shell=True) here
return
priority = 1000
requires_output = True
What I would want, is to simply have a side effect: kill 101663 101714 [enter/↑/↓/ctrl+c]
since nothing was "fixed" as this is actually house-keeping/cleanup after the original command was run
The output of
thefuck --version
(something likeThe Fuck 3.1 using Python 3.5.0 and Bash 4.4.12(1)-release
):The Fuck 3.32 using Python 3.10.7 and ZSH 5.9
Anything else you think is relevant:
It would be nice to be able to have rules where no corrected command is specifically run instead of a failty one, but simply run another command that has side effects. E.g. I have a rule for
firebase
CLI where at times I getfirebase-kill.py
Result:
What I would want, is to simply have a
side effect: kill 101663 101714 [enter/↑/↓/ctrl+c]
since nothing was "fixed" as this is actually house-keeping/cleanup after the original command was run