Question

Seems like this should be obvious, but how do I send arrow key presses to a process using Expect.pm? Does it depend on the terminal type I am using (vt100) or do I send keyboard scancodes?

TIA.

Was it helpful?

Solution

It does indeed depend on your current TERM environment variable. Once that's set correctly (say VT220 or linux), then arrow keys are

up:    "\c[[A"
down:  "\c[[B"
left:  "\c[[D"
right: "\c[[C"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top