Revert to using grep, update to use if-shell

The shell pattern match lost the case-insensitivity that `grep -iqE`
had. My vim process registers as `Vim` in `pane_current_command`, so
this broke the matching for me. Also updated to use the if-shell
mechanism.