def _terminal_settings(spawn, prompt, timeout):
    """Run commands for terminal settings
    :param spawn: a Spawn object
    :param prompt: a string representing a pattern to match against the content of the buffer
    :param timeout: in seconds
    :return:
    """
    initcommands = """
        top
        terminal length 0
        terminal width 511
    """
    for cmd in initcommands.split('\n'):
        cmd = cmd.strip()
        spawn.sendline(cmd)
        spawn.expect(prompt, timeout=timeout)
