You're probably killing processes you didn't intend to. The
-f options matches on the full command line:
The pattern is normally only matched against the process name.
When -f is set, the full command line is used.
To see which processes you're actually killing, do:
ps wwuxa |grep [t]or
The actual match as done by
pkill is the same as done by
pgrep. Compare the PIDs returned by
pgrep tor vs.
pgrep -f tor.
you'll see many processes; since you run
sudo, this means you kill all those processes. My guess is
gtk-window-decorator is the one whose absence causes the frames problem you describe. The rest of the strange behavior is due to the other system processes that also died.
In this case, since "tor" matches several system processes, you should specify a more strict regular expression, and not use
-f. This may work:
Don't use -f and ensure that it matches only one process, and that the process is indeed tor. Once you're satisfied, you can
pkill instead of
Finally, I'm unfamiliar with tor, but perhaps somewhere in the documentation you can find a more correct way to shut it down.