def _get_activate_script(cmd, venv):
    """Returns the string to activate a virtualenv.

    This is POSIX-only at the moment since the compat (pexpect-based) shell
    does not work elsewhere anyway.
    """
    if 'fish' in cmd:
        suffix = '.fish'
        command = 'source'
    elif 'csh' in cmd:
        suffix = '.csh'
        command = 'source'
    else:
        suffix = ''
        command = '.'
    venv_location = str(venv).replace(' ', '\\ ')
    return ' {2} {0}/bin/activate{1}'.format(venv_location, suffix, command)
