Commit ca4573d1 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Experimental patch to send function-keys to vtc processes.

(May not work due to termcap/terminfo differences)
parent b9751772
......@@ -11,9 +11,9 @@ varnish v1 -vcl+backend {
}
} -start
process p1 -dump {varnishstat -n ${v1_name}} -start
process p2 -dump {varnishstat -n ${v1_name}} -start
process p3 -dump {varnishstat -n ${v1_name}} -start
process p1 {varnishstat -n ${v1_name}} -start
process p2 {varnishstat -n ${v1_name}} -start
process p3 {varnishstat -n ${v1_name}} -start
process p1 -expect-text 0 0 "VBE.vcl1.s1.happy"
process p1 -screen_dump
......@@ -66,6 +66,24 @@ process p1 -winsz 25 132
process p1 -expect-text 4 124 "AVG_1000"
process p1 -expect-text 22 108 "UNSEEN DIAG"
process p1 -key NPAGE
process p1 -expect-text 0 0 "VBE.vcl1.s1.helddown"
process p1 -screen_dump
process p1 -key PPAGE
process p1 -expect-text 0 0 "VBE.vcl1.s1.happy"
process p1 -screen_dump
process p1 -key END
process p1 -expect-text 22 1 " "
process p1 -expect-text 4 1 "^^^"
process p1 -screen_dump
process p1 -key HOME
process p1 -expect-text 22 1 "vvv"
process p1 -expect-text 4 1 " "
process p1 -screen_dump
process p1 -screen_dump -write {q} -wait
process p2 -screen_dump -kill TERM -wait
process p3 -screen_dump -kill HUP -wait
......@@ -964,6 +964,11 @@ process_close(struct process *p)
* expression from either output, consider using it if you only need
* to match one.
*
* \-key KEYSYM
* Send emulated key-press.
* KEYSYM can be one of (NPAGE, PPAGE, HOME, END)
*
*
* \-kill SIGNAL
* Send a signal to the process. The argument can be either
* the string "TERM", "INT", or "KILL" for SIGTERM, SIGINT or SIGKILL
......@@ -1100,6 +1105,19 @@ cmd_process(CMD_ARGS)
p->log = 3;
continue;
}
if (!strcmp(*av, "-key")) {
if (!strcmp(av[1], "NPAGE"))
process_write(p, "\x1b\x5b\x36\x7e");
else if (!strcmp(av[1], "PPAGE"))
process_write(p, "\x1b\x5b\x35\x7e");
else if (!strcmp(av[1], "HOME"))
process_write(p, "\x1b\x4f\x48");
else if (!strcmp(av[1], "END"))
process_write(p, "\x1b\x4f\x46");
else
vtc_fatal(p->vl, "Unknown key %s", av[1]);
continue;
}
if (!strcmp(*av, "-kill")) {
process_kill(p, av[1]);
av++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment