diff --git a/exec/load/cterm_lib.js b/exec/load/cterm_lib.js index 08413a9d6a5a951aa27e28694da073c49370546d..80064b01b521dc56173b644b5f69eb8c3f551af3 100644 --- a/exec/load/cterm_lib.js +++ b/exec/load/cterm_lib.js @@ -21,6 +21,16 @@ const font_state_field_result = 1; const font_state_field_style = 2; const da_ver_major = 0; const da_ver_minor = 1; +const cterm_device_attributes = { + valid:'0', + loadable_fonts:'1', + bright_background:'2', + palette_settable:'3', + pixelops_supported:'4', + font_selectable:'5', + extended_palette:'6', + mouse_available:'7' +}; if(console.cterm_version === undefined || console.cterm_version < 0) { var response = query_da(); @@ -192,6 +202,17 @@ function query_fontdim() return false; } +function query_ctda(which) +{ + var response = query("\x1b[<c"); + if(response.substr(0, 3) != "\x1b[<" || response.substr(-1) != "c") + return false; + var attributes = response.slice(3, -1).split(/;/); + if(which !== undefined) + return attributes.indexOf(which) >= 0; + return attributes; +} + function fontsize(n) { switch(n) {