def select_command_with_arrows(proc, TIMEOUT):
 _set_confirmation(proc, True)
 proc.sendline(u'git h')
 assert proc.expect([TIMEOUT, u"git: 'h' is not a git command."])
 proc.sendline(u'fuck')
 assert proc.expect([TIMEOUT, u'git show'])
 proc.send('\x1b[B')
 assert proc.expect([TIMEOUT, u'git push'])
 proc.send('\x1b[B')
 assert proc.expect([TIMEOUT, u'git help'])
 proc.send('\x1b[A')
 assert proc.expect([TIMEOUT, u'git push'])
 proc.send('\x1b[B')
 assert proc.expect([TIMEOUT, u'git help'])
 proc.send('\n')
 assert proc.expect([TIMEOUT, u'usage'])

def select_command_with_arrows ( proc , TIMEOUT ) : _set_confirmation ( proc , True ) proc . sendline ( u'git h' ) assert proc . expect ( [ TIMEOUT , u"git: 'h' is not a git command." ] ) proc . sendline ( u'fuck' ) assert proc . expect ( [ TIMEOUT , u'git show' ] ) proc . send ( '\x1b[B' ) assert proc . expect ( [ TIMEOUT , u'git push' ] ) proc . send ( '\x1b[B' ) assert proc . expect ( [ TIMEOUT , u'git help' ] ) proc . send ( '\x1b[A' ) assert proc . expect ( [ TIMEOUT , u'git push' ] ) proc . send ( '\x1b[B' ) assert proc . expect ( [ TIMEOUT , u'git help' ] ) proc . send ( '\n' ) assert proc . expect ( [ TIMEOUT , u'usage' ] )
ensures that command can be selected with arrow keys .