# $EPIC: getcap.txt,v 1.3 2006/12/13 11:07:38 sthalik Exp $ ======Synopsis:====== $__getcap__(TERM ) ======Technical:====== * The first argument must be a capability type; currently only "TERM" is supported. * If the argument is omitted, the empty string is returned. * If the argument is omitted, the name type is taken as 0. * If the argument is omitted, the mangle value is taken as 1. * This function queries a capability database (currently only TERMinal capabilities are supported) for a given symbol (), the symbol is of a given type () and returns it. * The return value will be converted from a raw binary format into something that may be passed to /bind if is 1. * Values of : 0 - is a full blown terminfo capability name * 1 - is an abbreviated "terminfo" capability name * 2 - is an abbreviated "termcap" capability name * Values of : * 0 - The return value should not be modified [dangerous!] * 1 - Ascii characters 0 <= x < 32 shall be converted into the string "^" and ascii character 127 converted into "^?". * Values of : * See your system's 'man terminfo' man page for a list. ======Practical:====== If you need to query a terminal capability so you can output it to the screen via /[[xecho]] -r, you could use this function to fetch the capability. You could fetch a key capability (ie, key_f10) to bind a certain key, but the /[[bind]] command already has a shortcut for that (/[[bind]] -symbolic key_f10). The /[[bind]] -symbolic option uses the same underlying feature that this function does. ======Example:====== $getcap(TERM has_meta_key 0 0) returns 1 if your TERM has a meta key. ======Returns:====== The terminal capability (if any) as requested.