on [<modes>]exec_prompt [<serial#>] [-|^]<match> { <action> }
This hook is triggered whenever an EXECed process displays a “prompt”. More precisely, it is triggered when the process returns any line of output that is not terminated by a newline. This is generally the case with interactive commands, such as nslookup(1).
$0 | process number of name of the EXECed process |
$1 | prompt string to look for |
If you do not suppress this event, the client will format the message and display it to your screen UNLESS you are redirecting the output of that exec to somewhere else.
To hook the prompt when using nslookup interactively:
on ^exec_prompt "% >" { assign foo $0 input "nslookup> " { msg %${foo} $* } }