def deactivate_text(shell: dict, env_vars: dict) -> str:
    """Returns the formatted text to write to the deactivation script
    based on the passed dictionaries."""

    lines = [shell["shebang"]]
    for k in env_vars.keys():
        lines.append(shell["deactivate"].format(k))

    return "\n".join(lines)