fix open_shell_in_cwd_of for root shells and gnome terminal