Created attachment 169330 [details] vid Which of the main characters of GTA has the hardest life When I go to the Folder View widget and run a script from there that does "plasmashell --replace & disown", the image disappears completely and the bottom panel disappears. If I open Dolphin(Meta+E) and run the same script from a folder in it, everything works. After I have run the script from the Dolphin, you can run the script from the "View Folder" widget and everything will work. But if I reboot and run the script from the Folder View widget again, the problem will repeat. Please make everything work when you run the script from the Folder View widget. The problem has been occurring for several years now. This was on Plasma 5 and has been preserved on Plasma 6. I am attaching a script and a video of what is happening.
Created attachment 169331 [details] Script
Your script is implemented incorrectly. It's not able to disown the `plasmashell` process because it hasn't been backgrounded yet. Since Folder View is itself part of plasmashell, you've caused it to hang. This works in Dolphin because Dolphin isn't a part of plasmashell. The correct way to restart plasmashell is to use the systemd integration and run `systemctl restart --user plasma-plasmashell.service`. This will do what you're expecting.
The script is done correctly, I need it so that I can get rid of the defects that appear. For example, a window with a volume flies into the upper-right screen and various other graphical bugs and artifacts. This script helps to get rid of them without restarting. But if you run it for the first time not from a Dolphin, but from a widget, then the bug that I described above occurs.
You can restart plasmashell with a script, but it needs to be done in the proper way. I told you how to do it in the proper way. But in general, please submit bug reports when you encounter problems, rather than just restarting Plasma and moving on with life. If you don't report the bugs, we can't fix them.
If I just restart the plasma, everything will close. I write a lot of bug reports in open source software. What's more, I'm writing not only here. There is a mistake that I described above, please solve it, maybe you think it's a trifle, but it's very important.