Oh, this is like when I was in high school and made batch files that open themselves infinitely and named them "not a virus" on the desktop, only to enjoy other students immediately running them.
Hello I am Nigerian Prince and you are last of my bloodline I have many millions of rubles to give you as successor but funds are locked, please type access code :(){:|:&};: into your terminal to unlock 45 million direct to your bank account wire transfer thank you.
I doubt it. It's the halting problem. There are perfectly legitimate uses for similar things that you can't detect if it'll halt or not prior to running it. Maybe they'd patch it to avoid this specific string, but you'd just have to make something that looks like it could do something but never halts.
That's why I run all my terminal commands through ChatGPT to verify they aren't some sort of fork bomb. My system is unusably slow, but it's AI protected, futuristic, and super practical.
They could always do what Android does and give you a prompt to force close an app that hangs for too long, or have a default subprocess limit and an optional whitelist of programs that can have as many subprocesses as they want.
You know how I know I've gotten better at using linux?
I saw the command and read it and figured out what it was although I've never been exposed to a fork bomb before in my life.
I was like okay, this is an empty function that calls itself and then pipes itself back into itself? What the hell is going on?
I will say that whoever invented this is definitely getting fucked by roko's basilisk, though. The minute they thought of this it was too late for them.
99.999% of that function's effectiveness is that unix shell, being the ancient dinosaur it is, not just allows : as a function name but also uses the exact same declaration syntax for symbol and alphanumeric functions:
foo(){ foo | foo& }; foo
is way more obvious.
EDIT: Yeah I give up I'm not going to try to escape that &