def has_interactive_warning(line: str):
    """Determine whether a line of text contains a warning emitted by a shell.

    The shell program itself (e.g. bash) can emit warnings under certain circumstances
    which clutter output; for example, when running a shell in interactive mode without
    a connected terminal. This predicate can identify lines of text containing such
    warnings.

    Args:
        line: A string which may contain a shell warning.

    Returns:
        True if the line contains a shell warning, otherwise False.
    """
    return (
            "cannot set terminal process group" in line
            or "Inappropriate ioctl for device" in line
            or "no job control in this shell" in line
    )