From a5a5c83608e6d4455ac40e8786fd16eaf817c608 Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 23 May 2017 00:16:23 +0300 Subject: [PATCH 001/161] api/vim: Fix nvim_list_runtimepaths It used to 1. Always omit last component in runtimepath. 2. Always omit trailing empty item and leave uninitialized memory in place of it. --- src/nvim/api/vim.c | 11 +++++---- test/functional/api/vim_spec.lua | 40 ++++++++++++++++++++++++++++---- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 53e5f71fd4..de1d099c11 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -299,7 +299,7 @@ ArrayOf(String) nvim_list_runtime_paths(void) FUNC_API_SINCE(1) { Array rv = ARRAY_DICT_INIT; - uint8_t *rtp = p_rtp; + char_u *rtp = p_rtp; if (*rtp == NUL) { // No paths @@ -313,13 +313,14 @@ ArrayOf(String) nvim_list_runtime_paths(void) } rtp++; } + rv.size++; // Allocate memory for the copies - rv.items = xmalloc(sizeof(Object) * rv.size); + rv.items = xmalloc(sizeof(*rv.items) * rv.size); // Reset the position rtp = p_rtp; // Start copying - for (size_t i = 0; i < rv.size && *rtp != NUL; i++) { + for (size_t i = 0; i < rv.size; i++) { rv.items[i].type = kObjectTypeString; rv.items[i].data.string.data = xmalloc(MAXPATHL); // Copy the path from 'runtimepath' to rv.items[i] @@ -708,7 +709,7 @@ void nvim_unsubscribe(uint64_t channel_id, String event) Integer nvim_get_color_by_name(String name) FUNC_API_SINCE(1) { - return name_to_color((uint8_t *)name.data); + return name_to_color((char_u *)name.data); } Dictionary nvim_get_color_map(void) @@ -859,7 +860,7 @@ static void write_msg(String message, bool to_err) #define PUSH_CHAR(i, pos, line_buf, msg) \ if (message.data[i] == NL || pos == LINE_BUFFER_SIZE - 1) { \ line_buf[pos] = NUL; \ - msg((uint8_t *)line_buf); \ + msg((char_u *)line_buf); \ pos = 0; \ continue; \ } \ diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 161682b973..c531d4af46 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -327,11 +327,11 @@ describe('api', function() {'nvim_get_mode', {}}, {'nvim_eval', {'1'}}, } - eq({{{mode='n', blocking=false}, - 13, - {mode='n', blocking=false}, -- TODO: should be blocked=true - 1}, - NIL}, meths.call_atomic(req)) + eq({ { {mode='n', blocking=false}, + 13, + {mode='n', blocking=false}, -- TODO: should be blocked=true + 1 }, + NIL}, meths.call_atomic(req)) eq({mode='r', blocking=true}, nvim("get_mode")) end) -- TODO: bug #6166 @@ -588,6 +588,36 @@ describe('api', function() end) end) + describe('list_runtime_paths', function() + it('returns nothing with empty &runtimepath', function() + meths.set_option('runtimepath', '') + eq({}, meths.list_runtime_paths()) + end) + it('returns single runtimepath', function() + meths.set_option('runtimepath', 'a') + eq({'a'}, meths.list_runtime_paths()) + end) + it('returns two runtimepaths', function() + meths.set_option('runtimepath', 'a,b') + eq({'a', 'b'}, meths.list_runtime_paths()) + end) + it('returns empty strings when appropriate', function() + meths.set_option('runtimepath', 'a,,b') + eq({'a', '', 'b'}, meths.list_runtime_paths()) + meths.set_option('runtimepath', ',a,b') + eq({'', 'a', 'b'}, meths.list_runtime_paths()) + meths.set_option('runtimepath', 'a,b,') + eq({'a', 'b', ''}, meths.list_runtime_paths()) + end) + it('truncates too long paths', function() + local long_path = ('/a'):rep(8192) + meths.set_option('runtimepath', long_path) + local paths_list = meths.list_runtime_paths() + neq({long_path}, paths_list) + eq({long_path:sub(1, #(paths_list[1]))}, paths_list) + end) + end) + it('can throw exceptions', function() local status, err = pcall(nvim, 'get_option', 'invalid-option') eq(false, status) From 97602371e6b00f280ede5e3f6b0e0c1144f46c72 Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 23 May 2017 00:46:57 +0300 Subject: [PATCH 002/161] lua: Add paths from &runtimepath to package.path and package.cpath --- runtime/doc/if_lua.txt | 27 +++++- runtime/doc/vim_diff.txt | 2 + src/nvim/lua/executor.c | 71 +++++++++------ src/nvim/lua/vim.lua | 57 +++++++++++- test/functional/helpers.lua | 19 ++++ test/functional/lua/overrides_spec.lua | 116 +++++++++++++++++++++++++ 6 files changed, 265 insertions(+), 27 deletions(-) diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt index 470f3bde7a..2e4d32027d 100644 --- a/runtime/doc/if_lua.txt +++ b/runtime/doc/if_lua.txt @@ -9,7 +9,32 @@ Lua Interface to Nvim *lua* *Lua* Type to see the table of contents. ============================================================================== -1. Commands *lua-commands* +1. Importing modules *lua-require* + +Neovim lua interface automatically adjusts `package.path` and `package.cpath` +according to effective &runtimepath value. Adjustment happens after each time +'runtimepath' is changed, `package.path` and `package.cpath` are adjusted by +prepending directories from 'runtimepath' each suffixed by `/lua` and +`?`-containing suffixes from `package.path` and `package.cpath`. I.e. when +'runtimepath' option contains `/foo` and `package.path` contains only +`./a?d/j/g.nlua;./?.lua;/bar/?.lua` the resulting `package.path` after +adjustments will look like this: > + + /foo/lua/?.lua;/foo/lua/a?d/j/g.nlua;./a?d/j/g.nlua;./?.lua;/bar/?.lua + +Note that code have taken everything starting from the last path component +from existing paths containing a question mark as a `?`-containing suffix, but +only applied unique suffixes. + +Note 2: even though adjustments happens automatically Neovim does not track +current values of `package.path` or `package.cpath`. If you happened to delete +some paths from there you need to reset 'runtimepath' to make them readded. + +Note 3: paths from 'runtimepath' which contain semicolons cannot be put into +`package.[c]path` and thus are ignored. + +============================================================================== +2. Commands *lua-commands* *:lua* :[range]lua {chunk} diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 8851ef2d4b..24410ddaac 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -244,6 +244,8 @@ Lua interface (|if_lua.txt|): while calling lua chunk: [string ""]:1: TEST” in Neovim. - Lua has direct access to Nvim |API| via `vim.api`. +- Lua package.path and package.cpath are automatically updated according to + 'runtimepath': |lua-require|. - Currently, most legacy Vim features are missing. |input()| and |inputdialog()| gained support for each other’s features (return diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index 6f9e381d8d..531cc42862 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -14,6 +14,7 @@ #include "nvim/api/vim.h" #include "nvim/vim.h" #include "nvim/ex_getln.h" +#include "nvim/ex_cmds2.h" #include "nvim/message.h" #include "nvim/memline.h" #include "nvim/buffer_defs.h" @@ -284,7 +285,9 @@ static int nlua_state_init(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL /// /// Crashes NeoVim if initialization fails. Should be called once per lua /// interpreter instance. -static lua_State *init_lua(void) +/// +/// @return New lua interpreter instance. +static lua_State *nlua_init(void) FUNC_ATTR_NONNULL_RET FUNC_ATTR_WARN_UNUSED_RESULT { lua_State *lstate = luaL_newstate(); @@ -297,7 +300,43 @@ static lua_State *init_lua(void) return lstate; } -static lua_State *global_lstate = NULL; +/// Enter lua interpreter +/// +/// Calls nlua_init() if needed. Is responsible for pre-lua call initalization +/// like updating `package.[c]path` with directories derived from &runtimepath. +/// +/// @return Interprter instance to use. Will either be initialized now or taken +/// from previous initalization. +static lua_State *nlua_enter(void) + FUNC_ATTR_NONNULL_RET FUNC_ATTR_WARN_UNUSED_RESULT +{ + static lua_State *global_lstate = NULL; + if (global_lstate == NULL) { + global_lstate = nlua_init(); + } + lua_State *const lstate = global_lstate; + // Last used p_rtp value. Must not be dereferenced because value pointed to + // may already be freed. Used to check whether &runtimepath option value + // changed. + static const void *last_p_rtp = NULL; + if (last_p_rtp != (const void *)p_rtp) { + // stack: (empty) + lua_getglobal(lstate, "vim"); + // stack: vim + lua_getfield(lstate, -1, "_update_package_paths"); + // stack: vim, vim._update_package_paths + if (lua_pcall(lstate, 0, 0, 0)) { + // stack: vim, error + nlua_error(lstate, _("E5117: Error while updating package paths: %.*s")); + // stack: vim + } + // stack: vim + lua_pop(lstate, 1); + // stack: (empty) + last_p_rtp = (const void *)p_rtp; + } + return lstate; +} /// Execute lua string /// @@ -308,11 +347,7 @@ static lua_State *global_lstate = NULL; void executor_exec_lua(const String str, typval_T *const ret_tv) FUNC_ATTR_NONNULL_ALL { - if (global_lstate == NULL) { - global_lstate = init_lua(); - } - - NLUA_CALL_C_FUNCTION_2(global_lstate, nlua_exec_lua_string, 0, + NLUA_CALL_C_FUNCTION_2(nlua_enter(), nlua_exec_lua_string, 0, (void *)&str, ret_tv); } @@ -551,11 +586,7 @@ void executor_eval_lua(const String str, typval_T *const arg, typval_T *const ret_tv) FUNC_ATTR_NONNULL_ALL { - if (global_lstate == NULL) { - global_lstate = init_lua(); - } - - NLUA_CALL_C_FUNCTION_3(global_lstate, nlua_eval_lua_string, 0, + NLUA_CALL_C_FUNCTION_3(nlua_enter(), nlua_eval_lua_string, 0, (void *)&str, arg, ret_tv); } @@ -570,12 +601,8 @@ void executor_eval_lua(const String str, typval_T *const arg, /// @return Return value of the execution. Object executor_exec_lua_api(const String str, const Array args, Error *err) { - if (global_lstate == NULL) { - global_lstate = init_lua(); - } - Object retval = NIL; - NLUA_CALL_C_FUNCTION_4(global_lstate, nlua_exec_lua_string_api, 0, + NLUA_CALL_C_FUNCTION_4(nlua_enter(), nlua_exec_lua_string_api, 0, (void *)&str, (void *)&args, &retval, err); return retval; } @@ -609,9 +636,6 @@ void ex_lua(exarg_T *const eap) void ex_luado(exarg_T *const eap) FUNC_ATTR_NONNULL_ALL { - if (global_lstate == NULL) { - global_lstate = init_lua(); - } if (u_save(eap->line1 - 1, eap->line2 + 1) == FAIL) { EMSG(_("cannot save undo information")); return; @@ -621,7 +645,7 @@ void ex_luado(exarg_T *const eap) .data = (char *)eap->arg, }; const linenr_T range[] = { eap->line1, eap->line2 }; - NLUA_CALL_C_FUNCTION_2(global_lstate, nlua_exec_luado_string, 0, + NLUA_CALL_C_FUNCTION_2(nlua_enter(), nlua_exec_luado_string, 0, (void *)&cmd, (void *)range); } @@ -633,9 +657,6 @@ void ex_luado(exarg_T *const eap) void ex_luafile(exarg_T *const eap) FUNC_ATTR_NONNULL_ALL { - if (global_lstate == NULL) { - global_lstate = init_lua(); - } - NLUA_CALL_C_FUNCTION_1(global_lstate, nlua_exec_lua_file, 0, + NLUA_CALL_C_FUNCTION_1(nlua_enter(), nlua_exec_lua_file, 0, (void *)eap->arg); } diff --git a/src/nvim/lua/vim.lua b/src/nvim/lua/vim.lua index 8d1c5bdf4f..736182de11 100644 --- a/src/nvim/lua/vim.lua +++ b/src/nvim/lua/vim.lua @@ -1,2 +1,57 @@ -- TODO(ZyX-I): Create compatibility layer. -return {} +--{{{1 package.path updater function +-- Last inserted paths. Used to clear out items from package.[c]path when they +-- are no longer in &runtimepath. +local last_nvim_paths = {} +local function _update_package_paths() + local cur_nvim_paths = {} + local rtps = vim.api.nvim_list_runtime_paths() + local sep = package.config:sub(1, 1) + for _, key in ipairs({'path', 'cpath'}) do + local orig_str = package[key] .. ';' + local pathtrails = {} + local pathtrails_ordered = {} + local orig = {} + -- Note: ignores trailing item without trailing `;`. Not using something + -- simpler in order to preserve empty items (stand for default path). + for s in orig_str:gmatch('[^;]*;') do + s = s:sub(1, -2) -- Strip trailing semicolon + orig[#orig + 1] = s + -- Find out path patterns. pathtrail should contain something like + -- /?.so, /?/init.lua, /?.lua. This allows not to bother determining what + -- correct suffixes are. + local pathtrail = s:match('[/\\][^/\\]*%?.*$') + if pathtrail and not pathtrails[pathtrail] then + pathtrails[pathtrail] = true + pathtrails_ordered[#pathtrails_ordered + 1] = pathtrail + end + end + local new = {} + for _, rtp in ipairs(rtps) do + if not rtp:match(';') then + for _, pathtrail in pairs(pathtrails_ordered) do + local new_path = rtp .. sep .. 'lua' .. pathtrail + -- Always keep paths from &runtimepath at the start: + -- append them here disregarding orig possibly containing one of them. + new[#new + 1] = new_path + cur_nvim_paths[new_path] = true + end + end + end + for _, orig_path in ipairs(orig) do + -- Handle removing obsolete paths originating from &runtimepath: such + -- paths either belong to cur_nvim_paths and were already added above or + -- to last_nvim_paths and should not be added at all if corresponding + -- entry was removed from &runtimepath list. + if not (cur_nvim_paths[orig_path] or last_nvim_paths[orig_path]) then + new[#new + 1] = orig_path + end + end + package[key] = table.concat(new, ';') + end + last_nvim_paths = cur_nvim_paths +end +--{{{1 Module definition +return { + _update_package_paths = _update_package_paths, +} diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index b03840b3fe..4bd9ae4bfb 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -579,6 +579,24 @@ local function missing_provider(provider) end end +local function alter_slashes(obj) + if not iswin() then + return obj + end + if type(obj) == 'string' then + local ret = obj:gsub('/', '\\') + return ret + elseif type(obj) == 'table' then + local ret = {} + for k, v in pairs(obj) do + ret[k] = alter_slashes(v) + end + return ret + else + assert(false, 'Could only alter slashes for tables of strings and strings') + end +end + local module = { prepend_argv = prepend_argv, clear = clear, @@ -646,6 +664,7 @@ local module = { NIL = mpack.NIL, get_pathsep = get_pathsep, missing_provider = missing_provider, + alter_slashes = alter_slashes, } return function(after_each) diff --git a/test/functional/lua/overrides_spec.lua b/test/functional/lua/overrides_spec.lua index c8aee130a7..927bddc373 100644 --- a/test/functional/lua/overrides_spec.lua +++ b/test/functional/lua/overrides_spec.lua @@ -3,14 +3,17 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local eq = helpers.eq +local neq = helpers.neq local NIL = helpers.NIL local feed = helpers.feed local clear = helpers.clear local funcs = helpers.funcs local meths = helpers.meths +local iswin = helpers.iswin local command = helpers.command local write_file = helpers.write_file local redir_exec = helpers.redir_exec +local alter_slashes = helpers.alter_slashes local screen @@ -173,3 +176,116 @@ describe('debug.debug', function() ]]) end) end) + +describe('package.path/package.cpath', function() + local sl = alter_slashes + + local function get_new_paths(sufs, runtimepaths) + runtimepaths = runtimepaths or meths.list_runtime_paths() + local new_paths = {} + for _, v in ipairs(runtimepaths) do + for _, suf in ipairs(sufs) do + new_paths[#new_paths + 1] = v .. suf:sub(1, 1) .. 'lua' .. suf + end + end + return new_paths + end + local function execute_lua(cmd, ...) + return meths.execute_lua(cmd, {...}) + end + local function eval_lua(expr, ...) + return meths.execute_lua('return ' .. expr, {...}) + end + local function set_path(which, value) + return execute_lua('package[select(1, ...)] = select(2, ...)', which, value) + end + + it('contains directories from &runtimepath on first invocation', function() + local new_paths = get_new_paths(sl{'/?.lua', '/?/init.lua'}) + local new_paths_str = table.concat(new_paths, ';') + eq(new_paths_str, eval_lua('package.path'):sub(1, #new_paths_str)) + + local new_cpaths = get_new_paths(iswin() and {'\\?.dll'} or {'/?.so'}) + local new_cpaths_str = table.concat(new_cpaths, ';') + eq(new_cpaths_str, eval_lua('package.cpath'):sub(1, #new_cpaths_str)) + end) + it('puts directories from &runtimepath always at the start', function() + meths.set_option('runtimepath', 'a,b') + local new_paths = get_new_paths(sl{'/?.lua', '/?/init.lua'}, {'a', 'b'}) + local new_paths_str = table.concat(new_paths, ';') + eq(new_paths_str, eval_lua('package.path'):sub(1, #new_paths_str)) + + set_path('path', sl'foo/?.lua;foo/?/init.lua;' .. new_paths_str) + + neq(new_paths_str, eval_lua('package.path'):sub(1, #new_paths_str)) + + command('set runtimepath+=c') + new_paths = get_new_paths(sl{'/?.lua', '/?/init.lua'}, {'a', 'b', 'c'}) + new_paths_str = table.concat(new_paths, ';') + eq(new_paths_str, eval_lua('package.path'):sub(1, #new_paths_str)) + end) + it('understands uncommon suffixes', function() + set_path('path', './?/foo/bar/baz/x.nlua') + meths.set_option('runtimepath', 'a') + local new_paths = get_new_paths({'/?/foo/bar/baz/x.nlua'}, {'a'}) + local new_paths_str = table.concat(new_paths, ';') + eq(new_paths_str, eval_lua('package.path'):sub(1, #new_paths_str)) + + set_path('path', './yyy?zzz/x') + meths.set_option('runtimepath', 'b') + new_paths = get_new_paths({'/yyy?zzz/x'}, {'b'}) + new_paths_str = table.concat(new_paths, ';') + eq(new_paths_str, eval_lua('package.path'):sub(1, #new_paths_str)) + + set_path('path', './yyy?zzz/123?ghi/x') + meths.set_option('runtimepath', 'b') + new_paths = get_new_paths({'/yyy?zzz/123?ghi/x'}, {'b'}) + new_paths_str = table.concat(new_paths, ';') + eq(new_paths_str, eval_lua('package.path'):sub(1, #new_paths_str)) + end) + it('preserves empty items', function() + local many_empty_path = ';;;;;;' + local many_empty_cpath = ';;;;;;./?.luaso' + set_path('path', many_empty_path) + set_path('cpath', many_empty_cpath) + meths.set_option('runtimepath', 'a') + -- No suffixes known, so can’t add anything + eq(many_empty_path, eval_lua('package.path')) + local new_paths = get_new_paths({'/?.luaso'}, {'a'}) + local new_paths_str = table.concat(new_paths, ';') + eq(new_paths_str .. ';' .. many_empty_cpath, eval_lua('package.cpath')) + end) + it('preserves empty value', function() + set_path('path', '') + meths.set_option('runtimepath', 'a') + -- No suffixes known, so can’t add anything + eq('', eval_lua('package.path')) + end) + it('purges out all additions if runtimepath is set to empty', function() + local new_paths = get_new_paths(sl{'/?.lua', '/?/init.lua'}) + local new_paths_str = table.concat(new_paths, ';') + local path = eval_lua('package.path') + eq(new_paths_str, path:sub(1, #new_paths_str)) + + local new_cpaths = get_new_paths(iswin() and {'\\?.dll'} or {'/?.so'}) + local new_cpaths_str = table.concat(new_cpaths, ';') + local cpath = eval_lua('package.cpath') + eq(new_cpaths_str, cpath:sub(1, #new_cpaths_str)) + + meths.set_option('runtimepath', '') + eq(path:sub(#new_paths_str + 2, -1), eval_lua('package.path')) + eq(cpath:sub(#new_cpaths_str + 2, -1), eval_lua('package.cpath')) + end) + it('works with paths with escaped commas', function() + meths.set_option('runtimepath', '\\,') + local new_paths = get_new_paths(sl{'/?.lua', '/?/init.lua'}, {','}) + local new_paths_str = table.concat(new_paths, ';') + eq(new_paths_str, eval_lua('package.path'):sub(1, #new_paths_str)) + end) + it('ignores paths with semicolons', function() + meths.set_option('runtimepath', 'foo;bar,\\,') + local new_paths = get_new_paths(sl{'/?.lua', '/?/init.lua'}, {','}) + local new_paths_str = table.concat(new_paths, ';') + eq(new_paths_str, eval_lua('package.path'):sub(1, #new_paths_str)) + end) +end) From 643d620164646257392fb6df65fc7560341ba088 Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 23 May 2017 22:49:08 +0300 Subject: [PATCH 003/161] doc: Add example plugin --- runtime/doc/if_lua.txt | 81 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 79 insertions(+), 2 deletions(-) diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt index 2e4d32027d..2961e2adba 100644 --- a/runtime/doc/if_lua.txt +++ b/runtime/doc/if_lua.txt @@ -17,10 +17,10 @@ according to effective &runtimepath value. Adjustment happens after each time prepending directories from 'runtimepath' each suffixed by `/lua` and `?`-containing suffixes from `package.path` and `package.cpath`. I.e. when 'runtimepath' option contains `/foo` and `package.path` contains only -`./a?d/j/g.nlua;./?.lua;/bar/?.lua` the resulting `package.path` after +`./?.lua;./a?d/j/g.nlua;/bar/?.lua` the resulting `package.path` after adjustments will look like this: > - /foo/lua/?.lua;/foo/lua/a?d/j/g.nlua;./a?d/j/g.nlua;./?.lua;/bar/?.lua + /foo/lua/?.lua;/foo/lua/a?d/j/g.nlua;./?.lua;./a?d/j/g.nlua;/bar/?.lua Note that code have taken everything starting from the last path component from existing paths containing a question mark as a `?`-containing suffix, but @@ -33,6 +33,83 @@ some paths from there you need to reset 'runtimepath' to make them readded. Note 3: paths from 'runtimepath' which contain semicolons cannot be put into `package.[c]path` and thus are ignored. +------------------------------------------------------------------------------ +1.1. Example of the plugin which uses lua modules: *lua-require-example* + +The following example plugin adds a command `:MakeCharBlob` which transforms +current buffer into a long `unsigned char` array. Lua contains transformation +function in a module `lua/charblob.lua` which is imported in +`autoload/charblob.vim` (`require("charblob")`). Example plugin is supposed +to be put into any directory from 'runtimepath', e.g. `~/.config/nvim` (in +this case `lua/charblob.lua` means `~/.config/nvim/lua/charblob.lua`). + +autoload/charblob.vim: > + + function charblob#encode_buffer() + call setline(1, luaeval( + \ 'require("charblob").encode(unpack(_A))', + \ [getline(1, '$'), &textwidth, ' '])) + endfunction + +plugin/charblob.vim: > + + if exists('g:charblob_loaded') + finish + endif + let g:charblob_loaded = 1 + + command MakeCharBlob :call charblob#encode_buffer() + +lua/charblob.lua: > + + local function charblob_bytes_iter(lines) + local init_s = { + next_line_idx = 1, + next_byte_idx = 1, + lines = lines, + } + local function next(s, _) + if lines[s.next_line_idx] == nil then + return nil + end + if s.next_byte_idx > #(lines[s.next_line_idx]) then + s.next_line_idx = s.next_line_idx + 1 + s.next_byte_idx = 1 + return ('\n'):byte() + end + local ret = lines[s.next_line_idx]:byte(s.next_byte_idx) + if ret == ('\n'):byte() then + ret = 0 -- See :h NL-used-for-NUL. + end + s.next_byte_idx = s.next_byte_idx + 1 + return ret + end + return next, init_s, nil + end + + local function charblob_encode(lines, textwidth, indent) + local ret = { + 'const unsigned char blob[] = {', + indent, + } + for byte in charblob_bytes_iter(lines) do + -- .- space + number (width 3) + comma + if #(ret[#ret]) + 5 > textwidth then + ret[#ret + 1] = indent + else + ret[#ret] = ret[#ret] .. ' ' + end + ret[#ret] = ret[#ret] .. (('%3u,'):format(byte)) + end + ret[#ret + 1] = '};' + return ret + end + + return { + bytes_iter = charblob_bytes_iter, + encode = charblob_encode, + } + ============================================================================== 2. Commands *lua-commands* From 5b84c211824e0a7306bc975c88d4cd6138fe5b98 Mon Sep 17 00:00:00 2001 From: ZyX Date: Thu, 25 May 2017 16:34:04 +0300 Subject: [PATCH 004/161] cmake: Rename RunTestsLint to RunLuacheck --- cmake/{RunTestsLint.cmake => RunLuacheck.cmake} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cmake/{RunTestsLint.cmake => RunLuacheck.cmake} (100%) diff --git a/cmake/RunTestsLint.cmake b/cmake/RunLuacheck.cmake similarity index 100% rename from cmake/RunTestsLint.cmake rename to cmake/RunLuacheck.cmake From 58f6ef50a86b968b923dfcf5efffacb665fdfa44 Mon Sep 17 00:00:00 2001 From: ZyX Date: Thu, 25 May 2017 16:50:06 +0300 Subject: [PATCH 005/161] ci: Also lint lua code in src/nvim/lua --- CMakeLists.txt | 21 +++++++++++++++++++-- Makefile | 7 +++++-- ci/run_lint.sh | 6 ++++++ cmake/RunLuacheck.cmake | 17 +++++++++++++---- 4 files changed, 43 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ab7595eb11..e2c99d9fd8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -605,9 +605,26 @@ if(LUACHECK_PRG) add_custom_target(testlint COMMAND ${CMAKE_COMMAND} -DLUACHECK_PRG=${LUACHECK_PRG} - -DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test + -DLUAFILES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test + -DIGNORE_PATTERN="*/preload.lua" -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} - -P ${PROJECT_SOURCE_DIR}/cmake/RunTestsLint.cmake) + -P ${PROJECT_SOURCE_DIR}/cmake/RunLuacheck.cmake) + + add_custom_target( + blobcodelint + COMMAND + ${CMAKE_COMMAND} + -DLUACHECK_PRG=${LUACHECK_PRG} + -DLUAFILES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/src/nvim/lua + -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} + -DREAD_GLOBALS=vim + -P ${PROJECT_SOURCE_DIR}/cmake/RunLuacheck.cmake + ) + # TODO(ZyX-I): Run linter for all lua code in src + add_custom_target( + lualint + DEPENDS blobcodelint + ) endif() set(CPACK_PACKAGE_NAME "Neovim") diff --git a/Makefile b/Makefile index e69475a514..e349cc4d0f 100644 --- a/Makefile +++ b/Makefile @@ -107,6 +107,9 @@ functionaltest-lua: | nvim testlint: | build/.ran-cmake deps $(BUILD_CMD) -C build testlint +lualint: | build/.ran-cmake deps + $(BUILD_CMD) -C build lualint + unittest: | nvim +$(BUILD_CMD) -C build unittest @@ -138,6 +141,6 @@ check-single-includes: build/.ran-cmake appimage: bash scripts/genappimage.sh -lint: check-single-includes clint testlint +lint: check-single-includes clint testlint lualint -.PHONY: test testlint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage +.PHONY: test testlint lualint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage diff --git a/ci/run_lint.sh b/ci/run_lint.sh index 73647dacaa..e7f6727448 100755 --- a/ci/run_lint.sh +++ b/ci/run_lint.sh @@ -20,6 +20,12 @@ run_test 'top_make testlint' testlint exit_suite --continue +enter_suite 'lualint' + +run_test 'top_make lualint' lualint + +exit_suite --continue + enter_suite single-includes CLICOLOR_FORCE=1 run_test_wd \ diff --git a/cmake/RunLuacheck.cmake b/cmake/RunLuacheck.cmake index addc9ab35e..5129541cd8 100644 --- a/cmake/RunLuacheck.cmake +++ b/cmake/RunLuacheck.cmake @@ -1,11 +1,20 @@ -set(IGNORE_FILES "${TEST_DIR}/*/preload.lua") +set(LUACHECK_ARGS -q "${LUAFILES_DIR}") +if(DEFINED IGNORE_PATTERN) + list(APPEND LUACHECK_ARGS --exclude-files "${LUAFILES_DIR}/${IGNORE_PATTERN}") +endif() +if(DEFINED CHECK_PATTERN) + list(APPEND LUACHECK_ARGS --include-files "${LUAFILES_DIR}/${CHECK_PATTERN}") +endif() +if(DEFINED READ_GLOBALS) + list(APPEND LUACHECK_ARGS --read-globals "${READ_GLOBALS}") +endif() execute_process( - COMMAND ${LUACHECK_PRG} -q ${TEST_DIR} --exclude-files ${IGNORE_FILES} - WORKING_DIRECTORY ${TEST_DIR} + COMMAND "${LUACHECK_PRG}" ${LUACHECK_ARGS} + WORKING_DIRECTORY "${LUAFILES_DIR}" ERROR_VARIABLE err RESULT_VARIABLE res - ${EXTRA_ARGS}) +) if(NOT res EQUAL 0) message(STATUS "Output to stderr:\n${err}") From a409fa2b3f821a40a01d3919cd93384b1403156f Mon Sep 17 00:00:00 2001 From: ZyX Date: Fri, 26 May 2017 00:17:36 +0300 Subject: [PATCH 006/161] lua: Use automatic determining of suffixes only for package.cpath --- runtime/doc/if_lua.txt | 18 +++++++++------- src/nvim/lua/vim.lua | 23 +++++++++++++------- test/functional/lua/overrides_spec.lua | 29 ++++++++++++++------------ 3 files changed, 42 insertions(+), 28 deletions(-) diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt index 2961e2adba..d28a03e144 100644 --- a/runtime/doc/if_lua.txt +++ b/runtime/doc/if_lua.txt @@ -13,14 +13,17 @@ Lua Interface to Nvim *lua* *Lua* Neovim lua interface automatically adjusts `package.path` and `package.cpath` according to effective &runtimepath value. Adjustment happens after each time -'runtimepath' is changed, `package.path` and `package.cpath` are adjusted by -prepending directories from 'runtimepath' each suffixed by `/lua` and -`?`-containing suffixes from `package.path` and `package.cpath`. I.e. when -'runtimepath' option contains `/foo` and `package.path` contains only -`./?.lua;./a?d/j/g.nlua;/bar/?.lua` the resulting `package.path` after +'runtimepath' is changed. `package.path` is adjusted by simply appending +`/lua/?.lua` and `/lua/?/init.lua` to each directory from 'runtimepath' (`/` +is actually a first character from `package.config`). + +`package.cpath` is adjusted by prepending directories from 'runtimepath' each +suffixed by `/lua` and `?`-containing suffixes from existing `package.cpath`. +I.e. when 'runtimepath' option contains `/foo` and `package.cpath` contains +only `./?.so;./a?d/j/g.elf;/bar/?.so` the resulting `package.cpath` after adjustments will look like this: > - /foo/lua/?.lua;/foo/lua/a?d/j/g.nlua;./?.lua;./a?d/j/g.nlua;/bar/?.lua + /foo/lua/?.so;/foo/lua/a?d/j/g.elf;./?.so;./a?d/j/g.elf;/bar/?.so Note that code have taken everything starting from the last path component from existing paths containing a question mark as a `?`-containing suffix, but @@ -31,7 +34,8 @@ current values of `package.path` or `package.cpath`. If you happened to delete some paths from there you need to reset 'runtimepath' to make them readded. Note 3: paths from 'runtimepath' which contain semicolons cannot be put into -`package.[c]path` and thus are ignored. +`package.[c]path` for that being a semicolon-separated list and thus are +ignored. ------------------------------------------------------------------------------ 1.1. Example of the plugin which uses lua modules: *lua-require-example* diff --git a/src/nvim/lua/vim.lua b/src/nvim/lua/vim.lua index 736182de11..c7952520b0 100644 --- a/src/nvim/lua/vim.lua +++ b/src/nvim/lua/vim.lua @@ -9,7 +9,6 @@ local function _update_package_paths() local sep = package.config:sub(1, 1) for _, key in ipairs({'path', 'cpath'}) do local orig_str = package[key] .. ';' - local pathtrails = {} local pathtrails_ordered = {} local orig = {} -- Note: ignores trailing item without trailing `;`. Not using something @@ -17,13 +16,21 @@ local function _update_package_paths() for s in orig_str:gmatch('[^;]*;') do s = s:sub(1, -2) -- Strip trailing semicolon orig[#orig + 1] = s - -- Find out path patterns. pathtrail should contain something like - -- /?.so, /?/init.lua, /?.lua. This allows not to bother determining what - -- correct suffixes are. - local pathtrail = s:match('[/\\][^/\\]*%?.*$') - if pathtrail and not pathtrails[pathtrail] then - pathtrails[pathtrail] = true - pathtrails_ordered[#pathtrails_ordered + 1] = pathtrail + end + if key == 'path' then + -- /?.lua and /?/init.lua + pathtrails_ordered = {sep .. '?.lua', sep .. '?' .. sep .. 'init.lua'} + else + local pathtrails = {} + for _, s in ipairs(orig) do + -- Find out path patterns. pathtrail should contain something like + -- /?.so, \?.dll. This allows not to bother determining what correct + -- suffixes are. + local pathtrail = s:match('[/\\][^/\\]*%?.*$') + if pathtrail and not pathtrails[pathtrail] then + pathtrails[pathtrail] = true + pathtrails_ordered[#pathtrails_ordered + 1] = pathtrail + end end end local new = {} diff --git a/test/functional/lua/overrides_spec.lua b/test/functional/lua/overrides_spec.lua index 927bddc373..6e1d50071d 100644 --- a/test/functional/lua/overrides_spec.lua +++ b/test/functional/lua/overrides_spec.lua @@ -183,9 +183,10 @@ describe('package.path/package.cpath', function() local function get_new_paths(sufs, runtimepaths) runtimepaths = runtimepaths or meths.list_runtime_paths() local new_paths = {} + local sep = package.config:sub(1, 1) for _, v in ipairs(runtimepaths) do for _, suf in ipairs(sufs) do - new_paths[#new_paths + 1] = v .. suf:sub(1, 1) .. 'lua' .. suf + new_paths[#new_paths + 1] = v .. sep .. 'lua' .. suf end end return new_paths @@ -225,23 +226,23 @@ describe('package.path/package.cpath', function() eq(new_paths_str, eval_lua('package.path'):sub(1, #new_paths_str)) end) it('understands uncommon suffixes', function() - set_path('path', './?/foo/bar/baz/x.nlua') + set_path('cpath', './?/foo/bar/baz/x.nlua') meths.set_option('runtimepath', 'a') local new_paths = get_new_paths({'/?/foo/bar/baz/x.nlua'}, {'a'}) local new_paths_str = table.concat(new_paths, ';') - eq(new_paths_str, eval_lua('package.path'):sub(1, #new_paths_str)) + eq(new_paths_str, eval_lua('package.cpath'):sub(1, #new_paths_str)) - set_path('path', './yyy?zzz/x') + set_path('cpath', './yyy?zzz/x') meths.set_option('runtimepath', 'b') new_paths = get_new_paths({'/yyy?zzz/x'}, {'b'}) new_paths_str = table.concat(new_paths, ';') - eq(new_paths_str, eval_lua('package.path'):sub(1, #new_paths_str)) + eq(new_paths_str, eval_lua('package.cpath'):sub(1, #new_paths_str)) - set_path('path', './yyy?zzz/123?ghi/x') + set_path('cpath', './yyy?zzz/123?ghi/x') meths.set_option('runtimepath', 'b') new_paths = get_new_paths({'/yyy?zzz/123?ghi/x'}, {'b'}) new_paths_str = table.concat(new_paths, ';') - eq(new_paths_str, eval_lua('package.path'):sub(1, #new_paths_str)) + eq(new_paths_str, eval_lua('package.cpath'):sub(1, #new_paths_str)) end) it('preserves empty items', function() local many_empty_path = ';;;;;;' @@ -249,17 +250,19 @@ describe('package.path/package.cpath', function() set_path('path', many_empty_path) set_path('cpath', many_empty_cpath) meths.set_option('runtimepath', 'a') - -- No suffixes known, so can’t add anything - eq(many_empty_path, eval_lua('package.path')) - local new_paths = get_new_paths({'/?.luaso'}, {'a'}) + local new_paths = get_new_paths(sl{'/?.lua', '/?/init.lua'}, {'a'}) local new_paths_str = table.concat(new_paths, ';') - eq(new_paths_str .. ';' .. many_empty_cpath, eval_lua('package.cpath')) + eq(new_paths_str .. ';' .. many_empty_path, eval_lua('package.path')) + local new_cpaths = get_new_paths({'/?.luaso'}, {'a'}) + local new_cpaths_str = table.concat(new_cpaths, ';') + eq(new_cpaths_str .. ';' .. many_empty_cpath, eval_lua('package.cpath')) end) it('preserves empty value', function() set_path('path', '') meths.set_option('runtimepath', 'a') - -- No suffixes known, so can’t add anything - eq('', eval_lua('package.path')) + local new_paths = get_new_paths(sl{'/?.lua', '/?/init.lua'}, {'a'}) + local new_paths_str = table.concat(new_paths, ';') + eq(new_paths_str .. ';', eval_lua('package.path')) end) it('purges out all additions if runtimepath is set to empty', function() local new_paths = get_new_paths(sl{'/?.lua', '/?/init.lua'}) From cab3a248b2704e8f188eaf20206f2c87d1a76c0d Mon Sep 17 00:00:00 2001 From: ZyX Date: Fri, 26 May 2017 01:31:02 +0300 Subject: [PATCH 007/161] doc: Clarify documentation --- runtime/doc/if_lua.txt | 66 ++++++++++++++++++++++++++++++++---------- 1 file changed, 50 insertions(+), 16 deletions(-) diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt index d28a03e144..c4efd57b45 100644 --- a/runtime/doc/if_lua.txt +++ b/runtime/doc/if_lua.txt @@ -12,30 +12,64 @@ Lua Interface to Nvim *lua* *Lua* 1. Importing modules *lua-require* Neovim lua interface automatically adjusts `package.path` and `package.cpath` -according to effective &runtimepath value. Adjustment happens after each time +according to effective &runtimepath value. Adjustment happens after 'runtimepath' is changed. `package.path` is adjusted by simply appending `/lua/?.lua` and `/lua/?/init.lua` to each directory from 'runtimepath' (`/` -is actually a first character from `package.config`). +is actually the first character of `package.config`). -`package.cpath` is adjusted by prepending directories from 'runtimepath' each -suffixed by `/lua` and `?`-containing suffixes from existing `package.cpath`. -I.e. when 'runtimepath' option contains `/foo` and `package.cpath` contains -only `./?.so;./a?d/j/g.elf;/bar/?.so` the resulting `package.cpath` after -adjustments will look like this: > +Similarly to `package.path`, modified directories from `runtimepath` are also +added to `package.cpath`. In this case, instead of appending `/lua/?.lua` and +`/lua/?/init.lua` to each runtimepath, all unique `?`-containing suffixes of +the existing `package.cpath` are used. Here is an example: - /foo/lua/?.so;/foo/lua/a?d/j/g.elf;./?.so;./a?d/j/g.elf;/bar/?.so +1. Given that + - 'runtimepath' contains `/foo/bar,/xxx;yyy/baz,/abc`; + - initial (defined at compile time or derived from + `$LUA_CPATH`/`$LUA_INIT`) `package.cpath` contains + `./?.so;/def/ghi/a?d/j/g.elf;/def/?.so`. +2. It finds `?`-containing suffixes `/?.so`, `/a?d/j/g.elf` and `/?.so`, in + order: parts of the path starting from the first path component containing + question mark and preceding path separator. +3. The suffix of `/def/?.so`, namely `/?.so` is not unique, as it’s the same + as the suffix of the first path from `package.path` (i.e. `./?.so`). Which + leaves `/?.so` and `/a?d/j/g.elf`, in this order. +4. 'runtimepath' has three paths: `/foo/bar`, `/xxx;yyy/baz` and `/abc`. The + second one contains semicolon which is a paths separator so it is out, + leaving only `/foo/bar` and `/abc`, in order. +5. The cartesian product of paths from 4. and suffixes from 3. is taken, + giving four variants. In each variant `/lua` path segment is inserted + between path and suffix, leaving -Note that code have taken everything starting from the last path component -from existing paths containing a question mark as a `?`-containing suffix, but -only applied unique suffixes. + - `/foo/bar/lua/?.so` + - `/foo/bar/lua/a?d/j/g.elf` + - `/abc/lua/?.so` + - `/abc/lua/a?d/j/g.elf` + +6. New paths are prepended to the original `package.cpath`. + +The result will look like this: + + `/foo/bar,/xxx;yyy/baz,/abc` ('runtimepath') + × `./?.so;/def/ghi/a?d/j/g.elf;/def/?.so` (`package.cpath`) + + = `/foo/bar/lua/?.so;/foo/bar/lua/a?d/j/g.elf;/abc/lua/?.so;/abc/lua/a?d/j/g.elf;./?.so;/def/ghi/a?d/j/g.elf;/def/?.so` + +Note: to keep up with 'runtimepath' updates paths added at previous update are +remembered and removed at the next update, while all paths derived from the +new 'runtimepath' are prepended as described above. This allows removing +paths when path is removed from 'runtimepath', adding paths when they are +added and reordering `package.path`/`package.cpath` content if 'runtimepath' +was reordered. Note 2: even though adjustments happens automatically Neovim does not track -current values of `package.path` or `package.cpath`. If you happened to delete -some paths from there you need to reset 'runtimepath' to make them readded. +current values of `package.path` or `package.cpath`. If you happened to +delete some paths from there you need to reset 'runtimepath' to make them +readded. Just running `let &runtimepath = &runtimepath` should work. -Note 3: paths from 'runtimepath' which contain semicolons cannot be put into -`package.[c]path` for that being a semicolon-separated list and thus are -ignored. +Note 3: skipping paths from 'runtimepath' which contain semicolons applies +both to `package.path` and `package.cpath`. Given that there is a number of +badly written plugins using shell which will not work with paths containing +semicolons it is better to not have them in 'runtimepath' at all. ------------------------------------------------------------------------------ 1.1. Example of the plugin which uses lua modules: *lua-require-example* From d5468d3cdeda54dc7fa108ea7f1612aa88fe22a4 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Fri, 5 May 2017 15:17:32 +0100 Subject: [PATCH 008/161] Change TUI resize to use an extended terminal capability. ... rather than hardwiring the string and testing the terminal type every time the screen is re-sized. --- src/nvim/tui/tui.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 736d50ee8b..9587195e8c 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1132,11 +1132,11 @@ static void fix_terminfo(TUIData *data) } // Only define this capability for terminal types that we know understand it. - if (data->term == kTermDTTerm // originated this extension - || data->term == kTermXTerm // per xterm ctlseqs doc - || data->term == kTermKonsole // per commentary in VT102Emulation.cpp - || data->term == kTermTeraTerm // per "Supported Control Functions" doc - || data->term == kTermRxvt) { // per command.C + if (data->term == kTermDTTerm // originated this extension + || data->term == kTermXTerm // per xterm ctlseqs doco + || data->term == kTermKonsole // per commentary in VT102Emulation.cpp + || data->term == kTermTeraTerm // per TeraTerm "Supported Control Functions" doco + || data->term == kTermRxvt) { // per command.C data->unibi_ext.resize_screen = (int)unibi_add_ext_str(ut, NULL, "\x1b[8;%p1%d;%p2%dt"); } From 7821eef258eac66905c4490bbd2f0e98d29ff226 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Mon, 22 May 2017 15:27:03 +0100 Subject: [PATCH 009/161] Separate 16- and 256- colour control sequences and tidy up some redundancy. --- src/nvim/tui/tui.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 9587195e8c..93ad022470 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1065,7 +1065,6 @@ static void fix_terminfo(TUIData *data) data->term = detect_term(term, colorterm); if (data->term == kTermRxvt) { - unibi_set_if_empty(ut, unibi_exit_attribute_mode, "\x1b[m\x1b(B"); unibi_set_if_empty(ut, unibi_flash_screen, "\x1b[?5h$<20/>\x1b[?5l"); unibi_set_if_empty(ut, unibi_enter_italics_mode, "\x1b[3m"); unibi_set_if_empty(ut, unibi_to_status_line, "\x1b]2"); @@ -1115,9 +1114,9 @@ static void fix_terminfo(TUIData *data) data->unibi_ext.disable_focus_reporting = (int)unibi_add_ext_str(ut, NULL, "\x1b[?1004l"); -#define XTERM_SETAF \ +#define XTERM_SETAF_256 \ "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m" -#define XTERM_SETAB \ +#define XTERM_SETAB_256 \ "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m" if ((colorterm && strstr(colorterm, "256")) @@ -1127,8 +1126,8 @@ static void fix_terminfo(TUIData *data) // Linux 4.8+ supports 256-color SGR, but terminfo has 8-color setaf/setab. // Assume TERM=~xterm|linux or COLORTERM=~256 supports 256 colors. unibi_set_num(ut, unibi_max_colors, 256); - unibi_set_str(ut, unibi_set_a_foreground, XTERM_SETAF); - unibi_set_str(ut, unibi_set_a_background, XTERM_SETAB); + unibi_set_str(ut, unibi_set_a_foreground, XTERM_SETAF_256); + unibi_set_str(ut, unibi_set_a_background, XTERM_SETAB_256); } // Only define this capability for terminal types that we know understand it. @@ -1147,6 +1146,12 @@ static void fix_terminfo(TUIData *data) } end: + +#define XTERM_SETAF_16 \ + "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e39%;m" +#define XTERM_SETAB_16 \ + "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e39%;m" + // Fill some empty slots with common terminal strings if (data->term == kTermiTerm) { data->unibi_ext.set_cursor_color = (int)unibi_add_ext_str( @@ -1165,14 +1170,14 @@ end: "\x1b[48;2;%p1%d;%p2%d;%p3%dm"); unibi_set_if_empty(ut, unibi_cursor_address, "\x1b[%i%p1%d;%p2%dH"); unibi_set_if_empty(ut, unibi_exit_attribute_mode, "\x1b[0;10m"); - unibi_set_if_empty(ut, unibi_set_a_foreground, XTERM_SETAF); - unibi_set_if_empty(ut, unibi_set_a_background, XTERM_SETAB); + unibi_set_if_empty(ut, unibi_set_a_foreground, XTERM_SETAF_16); + unibi_set_if_empty(ut, unibi_set_a_background, XTERM_SETAB_16); unibi_set_if_empty(ut, unibi_enter_bold_mode, "\x1b[1m"); unibi_set_if_empty(ut, unibi_enter_underline_mode, "\x1b[4m"); unibi_set_if_empty(ut, unibi_enter_reverse_mode, "\x1b[7m"); unibi_set_if_empty(ut, unibi_bell, "\x07"); - unibi_set_if_empty(data->ut, unibi_enter_ca_mode, "\x1b[?1049h"); - unibi_set_if_empty(data->ut, unibi_exit_ca_mode, "\x1b[?1049l"); + unibi_set_if_empty(ut, unibi_enter_ca_mode, "\x1b[?1049h"); + unibi_set_if_empty(ut, unibi_exit_ca_mode, "\x1b[?1049l"); unibi_set_if_empty(ut, unibi_delete_line, "\x1b[M"); unibi_set_if_empty(ut, unibi_parm_delete_line, "\x1b[%p1%dM"); unibi_set_if_empty(ut, unibi_insert_line, "\x1b[L"); From 5e5914655ba546c424a13d768469c21b444b8883 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Mon, 22 May 2017 21:07:23 +0100 Subject: [PATCH 010/161] tui: document fix_terminfo()'s several tasks --- src/nvim/tui/tui.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 93ad022470..83198ee33c 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1052,6 +1052,14 @@ static TermType detect_term(const char *term, const char *colorterm) return kTermUnknown; } +/// This has three tasks. +/// 1. On termcap-only systems, it reads $TERM and fills in all of the things +/// that unibilium (which uses terminfo) will not have. +/// 2. It fills in extra capabilities that unibilium and terminfo do not know +/// anything about, such as bracketed paste control. Some of these are +/// (wrongly) assumed to be universal. Others are dependent from $TERM . +/// 3. It fills in capabilities that might have been missing from the termcap +/// entry that we nonetheless need, which are also worked out from $TERM . static void fix_terminfo(TUIData *data) { unibi_term *ut = data->ut; From d711bb84e6a78360e470d82f3671da64583089c2 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Mon, 22 May 2017 21:16:02 +0100 Subject: [PATCH 011/161] tui: Eliminate superfluous SGR resets. Track whether the terminal is in no attribute mode, assuming that it starts this way, and do not attempt to reset back to that mode if already in it. --- src/nvim/tui/tui.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 83198ee33c..84f23062ff 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -90,6 +90,7 @@ typedef struct { bool busy; cursorentry_T cursor_shapes[SHAPE_IDX_COUNT]; HlAttrs print_attrs; + bool default_attr; ModeShape showing_mode; TermType term; struct { @@ -155,6 +156,7 @@ static void terminfo_start(UI *ui) data->scroll_region_is_full_screen = true; data->bufpos = 0; data->bufsize = sizeof(data->buf) - CNORM_COMMAND_MAX_SIZE; + data->default_attr = false; data->showing_mode = SHAPE_IDX_N; data->unibi_ext.enable_mouse = -1; data->unibi_ext.disable_mouse = -1; @@ -336,7 +338,10 @@ static void update_attrs(UI *ui, HlAttrs attrs) } data->print_attrs = attrs; - unibi_out(ui, unibi_exit_attribute_mode); + if (!data->default_attr) { + data->default_attr = true; + unibi_out(ui, unibi_exit_attribute_mode); + } UGrid *grid = &data->grid; int fg = attrs.foreground != -1 ? attrs.foreground : grid->fg; @@ -348,6 +353,7 @@ static void update_attrs(UI *ui, HlAttrs attrs) data->params[1].i = (fg >> 8) & 0xff; // green data->params[2].i = fg & 0xff; // blue unibi_out(ui, data->unibi_ext.set_rgb_foreground); + data->default_attr = false; } if (bg != -1) { @@ -355,30 +361,37 @@ static void update_attrs(UI *ui, HlAttrs attrs) data->params[1].i = (bg >> 8) & 0xff; // green data->params[2].i = bg & 0xff; // blue unibi_out(ui, data->unibi_ext.set_rgb_background); + data->default_attr = false; } } else { if (fg != -1) { data->params[0].i = fg; unibi_out(ui, unibi_set_a_foreground); + data->default_attr = false; } if (bg != -1) { data->params[0].i = bg; unibi_out(ui, unibi_set_a_background); + data->default_attr = false; } } if (attrs.bold) { unibi_out(ui, unibi_enter_bold_mode); + data->default_attr = false; } if (attrs.italic) { unibi_out(ui, unibi_enter_italics_mode); + data->default_attr = false; } if (attrs.underline || attrs.undercurl) { unibi_out(ui, unibi_enter_underline_mode); + data->default_attr = false; } if (attrs.reverse) { unibi_out(ui, unibi_enter_reverse_mode); + data->default_attr = false; } } From dbc25f5a87cf3bcfe1caac1eb1ff8b3a6978a415 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Mon, 22 May 2017 21:53:36 +0100 Subject: [PATCH 012/161] tui: Optimize cursor motions Instead of emitting CUP in several places each with their own poor local optimizations, funnel all cursor motion through a central place. This central function performs the same optimization for every place that needs to move the cursor, and implements a better set of optimizations: * Emit CUU/CUD/CUF/CUB instad of CUP when they are likely shorter. * Use BS and LF when they are shorter than CUB and CUD. * Use CR for quick returns to column zero. * If printing the next few characters is shorter than a rightwards motion, then just write out the characters. --- src/nvim/tui/tui.c | 164 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 145 insertions(+), 19 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 84f23062ff..abe0e17d8a 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -199,7 +199,11 @@ static void terminfo_start(UI *ui) uv_loop_init(&data->write_loop); if (data->out_isatty) { uv_tty_init(&data->write_loop, &data->output_handle.tty, data->out_fd, 0); +#ifdef WIN32 uv_tty_set_mode(&data->output_handle.tty, UV_TTY_MODE_RAW); +#else + uv_tty_set_mode(&data->output_handle.tty, UV_TTY_MODE_IO); +#endif } else { uv_pipe_init(&data->write_loop, &data->output_handle.pipe, 0); uv_pipe_open(&data->output_handle.pipe, data->out_fd); @@ -401,10 +405,119 @@ static void print_cell(UI *ui, UCell *ptr) out(ui, ptr->data, strlen(ptr->data)); } +static bool cheap_to_print(UI *ui, int row, int col, int next) +{ + TUIData *data = ui->data; + UGrid *grid = &data->grid; + UCell *cell = grid->cells[row] + col; + while (next) { + --next; + if (attrs_differ(cell->attrs, data->print_attrs)) { + if (data->default_attr) { + return false; + } + } + if (strlen(cell->data) > 1) { + return false; + } + ++cell; + } + return true; +} + +/// This optimizes several cases where it is cheaper to do something other +/// than send a full cursor positioning control sequence. However, there are +/// some further optimizations that may seem obvious but that will not work. +/// +/// We cannot use VT (ASCII 0/11) for moving the cursor up, because VT means +/// move the cursor down on a DEC terminal. Similarly, on a DEC terminal FF +/// (ASCII 0/12) means the same thing and does not mean home. VT, CVT, and +/// TAB also stop at software-defined tabulation stops, not at a fixed set +/// of row/column positions. +static void cursor_goto(UI *ui, int row, int col) +{ + TUIData *data = ui->data; + UGrid *grid = &data->grid; + if (row == grid->row && col == grid->col) + return; + if (0 == row && 0 == col) { + unibi_out(ui, unibi_cursor_home); + ugrid_goto(&data->grid, row, col); + return; + } + if (0 == col && 0 != grid->col) { + unibi_out(ui, unibi_carriage_return); + ugrid_goto(&data->grid, grid->row, col); + } else if (col > grid->col) { + int n = col - grid->col; + if (n <= (row == grid->row ? 4 : 2) && cheap_to_print(ui, grid->row, grid->col, n)) { + UGRID_FOREACH_CELL(grid, grid->row, grid->row, + grid->col, col - 1, { + print_cell(ui, cell); + ++grid->col; + }); + } + } + if (row == grid->row) { + if (col < grid->col) { + int n = grid->col - col; + if (n <= 4) { // This might be just BS, so it is considered really cheap. + while (n--) + unibi_out(ui, unibi_cursor_left); + } else { + data->params[0].i = n; + unibi_out(ui, unibi_parm_left_cursor); + } + ugrid_goto(&data->grid, row, col); + return; + } else if (col > grid->col) { + int n = col - grid->col; + if (n <= 2) { + while (n--) + unibi_out(ui, unibi_cursor_right); + } else { + data->params[0].i = n; + unibi_out(ui, unibi_parm_right_cursor); + } + ugrid_goto(&data->grid, row, col); + return; + } + } + if (col == grid->col) { + if (row > grid->row) { + int n = row - grid->row; + if (n <= 4) { // This might be just LF, so it is considered really cheap. + while (n--) + unibi_out(ui, unibi_cursor_down); + } else { + data->params[0].i = n; + unibi_out(ui, unibi_parm_down_cursor); + } + ugrid_goto(&data->grid, row, col); + return; + } else if (row < grid->row) { + int n = grid->row - row; + if (n <= 2) { + while (n--) + unibi_out(ui, unibi_cursor_up); + } else { + data->params[0].i = n; + unibi_out(ui, unibi_parm_up_cursor); + } + ugrid_goto(&data->grid, row, col); + return; + } + } + unibi_goto(ui, row, col); + ugrid_goto(&data->grid, row, col); +} + static void clear_region(UI *ui, int top, int bot, int left, int right) { TUIData *data = ui->data; UGrid *grid = &data->grid; + int saved_row = grid->row; + int saved_col = grid->col; bool cleared = false; if (grid->bg == -1 && right == ui->width -1) { @@ -419,7 +532,7 @@ static void clear_region(UI *ui, int top, int bot, int left, int right) if (top == 0) { unibi_out(ui, unibi_clear_screen); } else { - unibi_goto(ui, top, 0); + cursor_goto(ui, top, 0); unibi_out(ui, unibi_clr_eos); } cleared = true; @@ -429,7 +542,7 @@ static void clear_region(UI *ui, int top, int bot, int left, int right) if (!cleared) { // iterate through each line and clear with clr_eol for (int row = top; row <= bot; ++row) { - unibi_goto(ui, row, left); + cursor_goto(ui, row, left); unibi_out(ui, unibi_clr_eol); } cleared = true; @@ -438,18 +551,15 @@ static void clear_region(UI *ui, int top, int bot, int left, int right) if (!cleared) { // could not clear using faster terminal codes, refresh the whole region - int currow = -1; UGRID_FOREACH_CELL(grid, top, bot, left, right, { - if (currow != row) { - unibi_goto(ui, row, col); - currow = row; - } + cursor_goto(ui, row, col); print_cell(ui, cell); + ++grid->col; }); } // restore cursor - unibi_goto(ui, grid->row, grid->col); + cursor_goto(ui, saved_row, saved_col); } static bool can_use_scroll(UI * ui) @@ -552,9 +662,7 @@ static void tui_eol_clear(UI *ui) static void tui_cursor_goto(UI *ui, Integer row, Integer col) { - TUIData *data = ui->data; - ugrid_goto(&data->grid, (int)row, (int)col); - unibi_goto(ui, (int)row, (int)col); + cursor_goto(ui, (int)row, (int)col); } CursorShape tui_cursor_decode_shape(const char *shape_str) @@ -728,6 +836,8 @@ static void tui_scroll(UI *ui, Integer count) ugrid_scroll(grid, (int)count, &clear_top, &clear_bot); if (can_use_scroll(ui)) { + int saved_row = grid->row; + int saved_col = grid->col; bool scroll_clears_to_current_colour = unibi_get_bool(data->ut, unibi_back_color_erase); @@ -735,7 +845,7 @@ static void tui_scroll(UI *ui, Integer count) if (!data->scroll_region_is_full_screen) { set_scroll_region(ui); } - unibi_goto(ui, grid->top, grid->left); + cursor_goto(ui, grid->top, grid->left); // also set default color attributes or some terminals can become funny if (scroll_clears_to_current_colour) { HlAttrs clear_attrs = EMPTY_ATTRS; @@ -764,7 +874,7 @@ static void tui_scroll(UI *ui, Integer count) if (!data->scroll_region_is_full_screen) { reset_scroll_region(ui); } - unibi_goto(ui, grid->row, grid->col); + cursor_goto(ui, saved_row, saved_col); if (!scroll_clears_to_current_colour) { // This is required because scrolling will leave wrong background in the @@ -830,19 +940,19 @@ static void tui_flush(UI *ui) tui_busy_stop(ui); // avoid hidden cursor } + int saved_row = grid->row; + int saved_col = grid->col; + while (kv_size(data->invalid_regions)) { Rect r = kv_pop(data->invalid_regions); - int currow = -1; UGRID_FOREACH_CELL(grid, r.top, r.bot, r.left, r.right, { - if (currow != row) { - unibi_goto(ui, row, col); - currow = row; - } + cursor_goto(ui, row, col); print_cell(ui, cell); + ++grid->col; }); } - unibi_goto(ui, grid->row, grid->col); + cursor_goto(ui, saved_row, saved_col); flush_buf(ui, true); } @@ -1190,6 +1300,22 @@ end: data->unibi_ext.set_rgb_background = (int)unibi_add_ext_str(ut, NULL, "\x1b[48;2;%p1%d;%p2%d;%p3%dm"); unibi_set_if_empty(ut, unibi_cursor_address, "\x1b[%i%p1%d;%p2%dH"); + unibi_set_if_empty(ut, unibi_cursor_home, "\x1b[H"); + unibi_set_if_empty(ut, unibi_parm_left_cursor, "\x1b[%p1%dD"); + unibi_set_if_empty(ut, unibi_parm_right_cursor, "\x1b[%p1%dC"); + unibi_set_if_empty(ut, unibi_parm_down_cursor, "\x1b[%p1%dB"); + unibi_set_if_empty(ut, unibi_parm_up_cursor, "\x1b[%p1%dA"); + unibi_set_if_empty(ut, unibi_cursor_left, "\x08"); + unibi_set_if_empty(ut, unibi_cursor_right, "\x1b[C"); +#if defined(WIN32) + unibi_set_if_empty(ut, unibi_cursor_down, "\x1b[B"); +#else + // N.B. This relies upon the terminal really being in cfmakeraw() mode, + // which libuv's RAW mode is in fact not. + unibi_set_if_empty(ut, unibi_cursor_down, "\x0a"); +#endif + unibi_set_if_empty(ut, unibi_cursor_up, "\x1b[A"); + unibi_set_if_empty(ut, unibi_carriage_return, "\x0d"); unibi_set_if_empty(ut, unibi_exit_attribute_mode, "\x1b[0;10m"); unibi_set_if_empty(ut, unibi_set_a_foreground, XTERM_SETAF_16); unibi_set_if_empty(ut, unibi_set_a_background, XTERM_SETAB_16); From 5b07ca1dfde4d44a11e3052b552f48fe61034247 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Mon, 22 May 2017 22:46:56 +0100 Subject: [PATCH 013/161] tui: Use what scrolling PuTTY has. PuTTY does not implement DECLRMM or DECSLRM, but it does implement DECSTBM. So allow using PuTTY terminal scrolling when the scroll rectangle is the full width of the terminal. --- src/nvim/tui/tui.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index abe0e17d8a..23096725be 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -56,6 +56,7 @@ typedef enum TermType { kTermDTTerm, kTermXTerm, kTermTeraTerm, + kTermPuTTY, } TermType; typedef struct { @@ -1172,6 +1173,9 @@ static TermType detect_term(const char *term, const char *colorterm) if (STARTS_WITH(term, "teraterm")) { return kTermTeraTerm; } + if (STARTS_WITH(term, "putty")) { + return kTermPuTTY; + } return kTermUnknown; } @@ -1220,13 +1224,15 @@ static void fix_terminfo(TUIData *data) unibi_set_if_empty(ut, unibi_cursor_invisible, "\x1b[?25l"); unibi_set_if_empty(ut, unibi_flash_screen, "\x1b[?5h$<100/>\x1b[?5l"); unibi_set_if_empty(ut, unibi_exit_attribute_mode, "\x1b(B\x1b[m"); + unibi_set_if_empty(ut, unibi_from_status_line, "\x07"); unibi_set_if_empty(ut, unibi_set_tb_margin, "\x1b[%i%p1%d;%p2%dr"); unibi_set_if_empty(ut, unibi_set_lr_margin, "\x1b[%i%p1%d;%p2%ds"); unibi_set_if_empty(ut, unibi_set_left_margin_parm, "\x1b[%i%p1%ds"); unibi_set_if_empty(ut, unibi_set_right_margin_parm, "\x1b[%i;%p2%ds"); + } + if (data->term == kTermXTerm || data->term == kTermRxvt || data->term == kTermPuTTY) { unibi_set_if_empty(ut, unibi_change_scroll_region, "\x1b[%i%p1%d;%p2%dr"); unibi_set_if_empty(ut, unibi_clear_screen, "\x1b[H\x1b[2J"); - unibi_set_if_empty(ut, unibi_from_status_line, "\x07"); unibi_set_bool(ut, unibi_back_color_erase, true); } @@ -1271,7 +1277,7 @@ static void fix_terminfo(TUIData *data) "\x1b[8;%p1%d;%p2%dt"); } - if (data->term == kTermXTerm || data->term == kTermRxvt) { + if (data->term == kTermXTerm || data->term == kTermRxvt || data->term == kTermPuTTY) { data->unibi_ext.reset_scroll_region = (int)unibi_add_ext_str(ut, NULL, "\x1b[r"); } From e826ec0b0ef36e48d2628b1a64226676e3c49eed Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Tue, 23 May 2017 01:09:17 +0100 Subject: [PATCH 014/161] tui: Optimize more cursor motions A slight improvement on the CR optimization for some edge cases. --- src/nvim/tui/tui.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 23096725be..8f1647803f 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -446,9 +446,14 @@ static void cursor_goto(UI *ui, int row, int col) ugrid_goto(&data->grid, row, col); return; } - if (0 == col && 0 != grid->col) { + if (0 == col ? col != grid->col : + 1 == col ? 2 < grid->col && cheap_to_print(ui, grid->row, 0, col) : + 2 == col ? 5 < grid->col && cheap_to_print(ui, grid->row, 0, col) : + false) { + // Motion to left margin from anywhere else, or CR + printing chars is + // even less expensive than using BSes or CUB. unibi_out(ui, unibi_carriage_return); - ugrid_goto(&data->grid, grid->row, col); + ugrid_goto(&data->grid, grid->row, 0); } else if (col > grid->col) { int n = col - grid->col; if (n <= (row == grid->row ? 4 : 2) && cheap_to_print(ui, grid->row, grid->col, n)) { From d077a161eea19e50ecd4a757004071e2329166e0 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Tue, 23 May 2017 15:38:51 +0100 Subject: [PATCH 015/161] tui: Coding style changes only Per warnings about house style from automated tools. --- src/nvim/tui/tui.c | 60 ++++++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 8f1647803f..0146d7d65d 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -415,7 +415,7 @@ static bool cheap_to_print(UI *ui, int row, int col, int next) --next; if (attrs_differ(cell->attrs, data->print_attrs)) { if (data->default_attr) { - return false; + return false; } } if (strlen(cell->data) > 1) { @@ -439,8 +439,9 @@ static void cursor_goto(UI *ui, int row, int col) { TUIData *data = ui->data; UGrid *grid = &data->grid; - if (row == grid->row && col == grid->col) + if (row == grid->row && col == grid->col) { return; + } if (0 == row && 0 == col) { unibi_out(ui, unibi_cursor_home); ugrid_goto(&data->grid, row, col); @@ -456,34 +457,37 @@ static void cursor_goto(UI *ui, int row, int col) ugrid_goto(&data->grid, grid->row, 0); } else if (col > grid->col) { int n = col - grid->col; - if (n <= (row == grid->row ? 4 : 2) && cheap_to_print(ui, grid->row, grid->col, n)) { - UGRID_FOREACH_CELL(grid, grid->row, grid->row, - grid->col, col - 1, { - print_cell(ui, cell); - ++grid->col; - }); + if (n <= (row == grid->row ? 4 : 2) + && cheap_to_print(ui, grid->row, grid->col, n)) { + UGRID_FOREACH_CELL(grid, grid->row, grid->row, + grid->col, col - 1, { + print_cell(ui, cell); + ++grid->col; + }); } } if (row == grid->row) { if (col < grid->col) { int n = grid->col - col; if (n <= 4) { // This might be just BS, so it is considered really cheap. - while (n--) - unibi_out(ui, unibi_cursor_left); + while (n--) { + unibi_out(ui, unibi_cursor_left); + } } else { - data->params[0].i = n; - unibi_out(ui, unibi_parm_left_cursor); + data->params[0].i = n; + unibi_out(ui, unibi_parm_left_cursor); } ugrid_goto(&data->grid, row, col); return; } else if (col > grid->col) { int n = col - grid->col; if (n <= 2) { - while (n--) - unibi_out(ui, unibi_cursor_right); + while (n--) { + unibi_out(ui, unibi_cursor_right); + } } else { - data->params[0].i = n; - unibi_out(ui, unibi_parm_right_cursor); + data->params[0].i = n; + unibi_out(ui, unibi_parm_right_cursor); } ugrid_goto(&data->grid, row, col); return; @@ -493,22 +497,24 @@ static void cursor_goto(UI *ui, int row, int col) if (row > grid->row) { int n = row - grid->row; if (n <= 4) { // This might be just LF, so it is considered really cheap. - while (n--) - unibi_out(ui, unibi_cursor_down); + while (n--) { + unibi_out(ui, unibi_cursor_down); + } } else { - data->params[0].i = n; - unibi_out(ui, unibi_parm_down_cursor); + data->params[0].i = n; + unibi_out(ui, unibi_parm_down_cursor); } ugrid_goto(&data->grid, row, col); return; } else if (row < grid->row) { int n = grid->row - row; if (n <= 2) { - while (n--) - unibi_out(ui, unibi_cursor_up); + while (n--) { + unibi_out(ui, unibi_cursor_up); + } } else { - data->params[0].i = n; - unibi_out(ui, unibi_parm_up_cursor); + data->params[0].i = n; + unibi_out(ui, unibi_parm_up_cursor); } ugrid_goto(&data->grid, row, col); return; @@ -1235,7 +1241,8 @@ static void fix_terminfo(TUIData *data) unibi_set_if_empty(ut, unibi_set_left_margin_parm, "\x1b[%i%p1%ds"); unibi_set_if_empty(ut, unibi_set_right_margin_parm, "\x1b[%i;%p2%ds"); } - if (data->term == kTermXTerm || data->term == kTermRxvt || data->term == kTermPuTTY) { + if (data->term == kTermXTerm || data->term == kTermRxvt + || data->term == kTermPuTTY) { unibi_set_if_empty(ut, unibi_change_scroll_region, "\x1b[%i%p1%d;%p2%dr"); unibi_set_if_empty(ut, unibi_clear_screen, "\x1b[H\x1b[2J"); unibi_set_bool(ut, unibi_back_color_erase, true); @@ -1282,7 +1289,8 @@ static void fix_terminfo(TUIData *data) "\x1b[8;%p1%d;%p2%dt"); } - if (data->term == kTermXTerm || data->term == kTermRxvt || data->term == kTermPuTTY) { + if (data->term == kTermXTerm || data->term == kTermRxvt + || data->term == kTermPuTTY) { data->unibi_ext.reset_scroll_region = (int)unibi_add_ext_str(ut, NULL, "\x1b[r"); } From ede4d620def191af984befecd0386e8cc92ba740 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Tue, 23 May 2017 16:55:22 +0100 Subject: [PATCH 016/161] tui: Fix cursor motion clear screen bug visible on line #1 in redraws. The clear_screen capability moves the cursor position. This needs to be accounted for. --- src/nvim/tui/tui.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 0146d7d65d..650b1b0fa2 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -543,6 +543,7 @@ static void clear_region(UI *ui, int top, int bot, int left, int right) if (bot == ui->height - 1) { if (top == 0) { unibi_out(ui, unibi_clear_screen); + ugrid_goto(&data->grid, top, left); } else { cursor_goto(ui, top, 0); unibi_out(ui, unibi_clr_eos); From 6be921b71c226fe6310afe8703f800c042848291 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Wed, 24 May 2017 19:56:12 +0100 Subject: [PATCH 017/161] doc: Relegate xterm-8bit to a removed feature. --- runtime/doc/term.txt | 14 -------------- runtime/doc/vim_diff.txt | 8 ++++++++ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index cdff8760fc..bb27873e42 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -69,20 +69,6 @@ them as a cursor key. When you type you normally are not that fast, so they are recognized as individual typed commands, even though Vim receives the same sequence of bytes. - *xterm-8bit* *xterm-8-bit* -Xterm can be run in a mode where it uses 8-bit escape sequences. The CSI code -is used instead of [. The advantage is that an can quickly be -recognized in Insert mode, because it can't be confused with the start of a -special key. -For the builtin termcap entries, Vim checks if the 'term' option contains -"8bit" anywhere. It then uses 8-bit characters for the termcap entries, the -mouse and a few other things. You would normally set $TERM in your shell to -"xterm-8bit" and Vim picks this up and adjusts to the 8-bit setting -automatically. -When Vim receives a response to the "request version" sequence and it -starts with CSI, it assumes that the terminal is in 8-bit mode and will -convert all key sequences to their 8-bit variants. - ============================================================================== Window size *window-size* diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 8851ef2d4b..dabf488465 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -281,6 +281,14 @@ Nvim does not have special `t_XX` options nor keycodes to configure terminal capabilities. Instead Nvim treats the terminal as any other UI. For example, 'guicursor' sets the terminal cursor style if possible. + *xterm-8bit* *xterm-8-bit* +Xterm can be run in a mode where it uses true 8-bit CSI. Supporting this +requires autodetection of whether the terminal is in UTF-8 mode or non-UTF-8 +mode, as the 8-bit CSI character has to be written differently in each case. +Vim issues a "request version" sequence to the terminal at startup and looks +at how the terminal is sending CSI. Nvim does not issue such a sequence and +always uses 7-bit control sequences. + 'ttyfast': ":set ttyfast" is ignored ":set nottyfast" is an error From d65cff9de89936109bc25aec78dc11a16707fe50 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Wed, 24 May 2017 21:09:25 +0100 Subject: [PATCH 018/161] doc: Document some more terminal behaviours. This documents 256-colour and true colour handling, cursor shapes, and scrolling regions. Almost all of these headings are taken from the Vim doco, so that the :help commands that people learn are a transferable skill. --- runtime/doc/syntax.txt | 5 +-- runtime/doc/term.txt | 71 ++++++++++++++++++++++++++++++++++++++-- runtime/doc/vim_diff.txt | 9 +++++ 3 files changed, 78 insertions(+), 7 deletions(-) diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index d711aa6a29..ed2a97cb3b 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -5207,10 +5207,7 @@ To test your color setup, a file has been included in the Vim distribution. To use it, execute this command: > :runtime syntax/colortest.vim -Some versions of xterm (and other terminals, like the Linux console) can -output lighter foreground colors, even though the number of colors is defined -at 8. Therefore Vim sets the "cterm=bold" attribute for light foreground -colors, when 't_Co' is 8. +Nvim uses |256-color| and |true-color| terminal capabilities whereever possible. ============================================================================== 18. When syntax is slow *:syntime* diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index bb27873e42..13b0b5b37d 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -20,9 +20,21 @@ Startup *startup-terminal* When Vim is started a default terminal type is assumed. for MS-DOS this is the pc terminal, for Unix an ansi terminal. - *termcap* *terminfo* *E557* *E558* *E559* -On Unix the terminfo database or termcap file is used. This is referred to as -"termcap" in all the documentation. + *terminfo* *E557* *E558* *E559* +On Unix the terminfo database is used. + + *builtin-terms* *builtin_terms* +If a terminfo database is not available, Nvim will look up the terminal type +in a compiled-in mini-database of terminfo entries for "xterm", "putty", +"screen", "tmux", "rxvt", "iterm", "interix", "linux", and "ansi". + +The lookup matches the initial portion of the terminal type, so (for example) +"putty-256color" and "putty" will both be mapped to the built-in "putty" +entry. The built-in terminfo entries describe the terminal as 256-colour +capable if possible. See |termcap-colors|. + +If no built-in terminfo record matches the terminal type, the built-in "ansi" +terminfo record is used as a final fallback. Settings depending on terminal *term-dependent-settings* @@ -35,6 +47,59 @@ can do this best in your vimrc. Example: > ... vt100, vt102 maps and settings ... endif < + *scroll-region* *xterm-scroll-region* +Where possible, Nvim will use the terminal's ability to set a scroll region in +order to redraw faster when a window is scrolled. If the terminal's terminfo +description describes an ability to set top and bottom scroll margins, that is +used. + +This will not speed up scrolling in a window that is not the full width of the +terminal. Xterm has an extra ability, not described by terminfo, to set left +and right scroll margins as well. If Nvim detects that the terminal is Xterm, +it will make use of this ability to speed up scrolling that is not the full +width of the terminal. + +This ability is only present in genuine Xterm, not in the many terminal +emulators that incorrectly describe themselves as xterm. Nvim's detection of +genuine Xterm will not work over an SSH connection, because the environment +variable, set by genuine Xterm, that it looks for is not automatically +replicated over an SSH login session. + + *256-color* *termcap-colors* +Nvim can make use of 256-colour terminals and tries to do so whereever it can. + +If the |terminfo| description of the terminal says that it supports fewer +colours, Nvim will override this for many terminal types, including "linux" +(whose virtual terminals have had 256-colour support since version 4.8) and +anything (even if falsely) claiming to be "xterm". It will also set 256 +colours when the COLORTERM or TERM environment variables contain the string +"256" somewhere. + +Nvim similarly assumes that any terminal emulator that sets the COLORTERM +environment variable at all, to anything, is capable of at least 16-colour +operation; and it will override |terminfo| saying that it has fewer colours +available. + + *true-color* *xterm-true-color* +Nvim supports using true (24-bit) colours in the terminal. |terminfo| does +not contain flags to say when terminals have true colour support. So Nvim +simply assumes true colour support for (all) "xterm", "rxvt", "linux", +"putty", and "iterm" terminal types, or when Konsole or a terminal emulator +that sets the COLORTERM environment variable to "truecolor" is detected. + + *xterm-resize* +Nvim can resize the terminal display on some terminals that implement an +extension pioneered by the dtterm program. |terminfo| does not have a flag +for this extension. So Nvim simply assumes that (all) "dtterm", "xterm", +"teraterm", "rxvt" terminal types, and Konsole, are capable of this. + + *cursor-shape* *termcap-cursor-shape* +Nvim will adjust the shape of the cursor from a block to a line when in insert +mode, on terminals that support it. If Konsole is detected, it will use the +idiosyncratic Konsole terminal control sequences for this, attempting to do +the right thing if tmux is between Nvim and Konsole. Otherwise, it uses the +conventional DECSCUSR control sequences. + *cs7-problem* Note: If the terminal settings are changed after running Vim, you might have an illegal combination of settings. This has been reported on Solaris 2.5 diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index dabf488465..cc4f441639 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -156,6 +156,10 @@ are always available and may be used simultaneously in separate plugins. The `neovim` pip package must be installed to use Python plugins in Nvim (see |provider-python|). +Because of general |256-color| usage whereever possible, Nvim will even use +256-colour capability on Linux virtual terminals. Vim uses only 8 colours +plus bright foreground on Linux VTs. + |:!| does not support "interactive" commands. Use |:terminal| instead. (GUI Vim has a similar limitation, see ":help gui-pty" in Vim.) @@ -281,6 +285,11 @@ Nvim does not have special `t_XX` options nor keycodes to configure terminal capabilities. Instead Nvim treats the terminal as any other UI. For example, 'guicursor' sets the terminal cursor style if possible. + *termcap* +Nvim never uses the termcap database and only uses |terminfo|. See +|builtin-terms| for what happens on operating systems without a terminfo +database. + *xterm-8bit* *xterm-8-bit* Xterm can be run in a mode where it uses true 8-bit CSI. Supporting this requires autodetection of whether the terminal is in UTF-8 mode or non-UTF-8 From 3d8e0594e495c42dbdf3871ef3c3023e128f748c Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Wed, 24 May 2017 21:36:52 +0100 Subject: [PATCH 019/161] tui: Split fix_terminfo() up and refactor. There are now a few built-in terminfo entries, taken either from unibilium or ncurses terminfo, for falling back upon when there is no terminfo database or when it is missing stuff. In an ideal world, these would be in unibilium itself. The ultimate fallback, for no terminfo database and no built-in terminfo record that matches the terminal type, is now the "ansi" terminal type; so unknown terminal types are now considered to have at minimum the basic ECMA-48 colour, motion, and editing capabilities. The terminfo records are just blobs, raw images of the equivalent terminfo file created with the od command. No longer are incomplete terminfo records built up with code. These blobs are the full, real, records; already built. The post-processing of the terminfo record, once found, is split into the part where we fix known errors and deficiencies in terminfo, and the part where we add extensions that we need that terminfo does not define capabilities for. In an ideal world, the former would be a no-op. No part of the TUI layer apart from these is aware of terminal type or has conditional code based upon checking environment variables at runtime. It is all pre-calculated and written into unibilium (or the TUIData object) at initialization time. This is fairly aggressive about turning on 256-colour and true colour support. This also positively decodes genuine xterm for turning on DECSLRM use, rather than assuming that anything that says that it is xterm is actually xterm, fixing scrolling problems with vertically split windows. --- src/nvim/tui/tui.c | 1122 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 908 insertions(+), 214 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 650b1b0fa2..8f8f388eb8 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -45,19 +45,7 @@ #define TOO_MANY_EVENTS 1000000 #define STARTS_WITH(str, prefix) (!memcmp(str, prefix, sizeof(prefix) - 1)) -#define TMUX_WRAP(seq) (is_tmux ? "\x1bPtmux;\x1b" seq "\x1b\\" : seq) - -typedef enum TermType { - kTermUnknown, - kTermGnome, - kTermiTerm, - kTermKonsole, - kTermRxvt, - kTermDTTerm, - kTermXTerm, - kTermTeraTerm, - kTermPuTTY, -} TermType; +#define TMUX_WRAP(is_tmux,seq) ((is_tmux) ? "\x1bPtmux;\x1b" seq "\x1b\\" : seq) typedef struct { int top, bot, left, right; @@ -93,7 +81,6 @@ typedef struct { HlAttrs print_attrs; bool default_attr; ModeShape showing_mode; - TermType term; struct { int enable_mouse, disable_mouse; int enable_bracketed_paste, disable_bracketed_paste; @@ -103,12 +90,12 @@ typedef struct { int enable_focus_reporting, disable_focus_reporting; int resize_screen; int reset_scroll_region; + int konsole_cursor_shape, dec_cursor_shape; } unibi_ext; } TUIData; static bool volatile got_winch = false; static bool cursor_style_enabled = false; -static bool is_tmux = false; #ifdef INCLUDE_GENERATED_DECLARATIONS # include "tui/tui.c.generated.h" @@ -170,16 +157,25 @@ static void terminfo_start(UI *ui) data->unibi_ext.disable_focus_reporting = -1; data->unibi_ext.resize_screen = -1; data->unibi_ext.reset_scroll_region = -1; + data->unibi_ext.konsole_cursor_shape = -1; + data->unibi_ext.dec_cursor_shape = -1; data->out_fd = 1; data->out_isatty = os_isatty(data->out_fd); // setup unibilium + const char *term = os_getenv("TERM"); data->ut = unibi_from_env(); if (!data->ut) { - // For some reason could not read terminfo file, use a dummy entry that - // will be populated with common values by fix_terminfo below - data->ut = unibi_dummy(); + data->ut = load_builtin_terminfo(term); } - fix_terminfo(data); + const char *colorterm = os_getenv("COLORTERM"); + const char *termprg = os_getenv("TERM_PROGRAM"); + const char *vte_version_env = os_getenv("VTE_VERSION"); + long vte_version = vte_version_env ? strtol(vte_version_env, NULL, 10) : 0; + bool iterm = termprg && strstr(termprg, "iTerm.app"); + bool konsole = os_getenv("KONSOLE_PROFILE_NAME") + || os_getenv("KONSOLE_DBUS_SESSION"); + patch_terminfo_bugs(data->ut, term, colorterm, vte_version, konsole, iterm); + augment_terminfo(data, term, colorterm, vte_version, konsole, iterm); data->can_change_scroll_region = !!unibi_get_str(data->ut, unibi_change_scroll_region); data->can_set_lr_margin = @@ -472,7 +468,7 @@ static void cursor_goto(UI *ui, int row, int col) if (n <= 4) { // This might be just BS, so it is considered really cheap. while (n--) { unibi_out(ui, unibi_cursor_left); - } + } } else { data->params[0].i = n; unibi_out(ui, unibi_parm_left_cursor); @@ -484,7 +480,7 @@ static void cursor_goto(UI *ui, int row, int col) if (n <= 2) { while (n--) { unibi_out(ui, unibi_cursor_right); - } + } } else { data->params[0].i = n; unibi_out(ui, unibi_parm_right_cursor); @@ -499,7 +495,7 @@ static void cursor_goto(UI *ui, int row, int col) if (n <= 4) { // This might be just LF, so it is considered really cheap. while (n--) { unibi_out(ui, unibi_cursor_down); - } + } } else { data->params[0].i = n; unibi_out(ui, unibi_parm_down_cursor); @@ -511,7 +507,7 @@ static void cursor_goto(UI *ui, int row, int col) if (n <= 2) { while (n--) { unibi_out(ui, unibi_cursor_up); - } + } } else { data->params[0].i = n; unibi_out(ui, unibi_parm_up_cursor); @@ -775,10 +771,8 @@ static void tui_set_mode(UI *ui, ModeShape mode) TUIData *data = ui->data; cursorentry_T c = data->cursor_shapes[mode]; int shape = c.shape; - unibi_var_t vars[26 + 26] = { { 0 } }; // Support changing cursor shape on some popular terminals. - const char *vte_version = os_getenv("VTE_VERSION"); if (c.id != 0 && ui->rgb) { int attr = syn_id2attr(c.id); @@ -789,37 +783,24 @@ static void tui_set_mode(UI *ui, ModeShape mode) } } - if (data->term == kTermKonsole) { - // Konsole uses a proprietary escape code to set the cursor shape - // and does not support DECSCUSR. - switch (shape) { - case SHAPE_BLOCK: shape = 0; break; - case SHAPE_VER: shape = 1; break; - case SHAPE_HOR: shape = 2; break; - default: WLOG("Unknown shape value %d", shape); break; - } - data->params[0].i = shape; - data->params[1].i = (c.blinkon != 0); - - unibi_format(vars, vars + 26, - TMUX_WRAP("\x1b]50;CursorShape=%p1%d;BlinkingCursorEnabled=%p2%d\x07"), - data->params, out, ui, NULL, NULL); - } else if (!vte_version || atoi(vte_version) >= 3900) { - // Assume that the terminal supports DECSCUSR unless it is an - // old VTE based terminal. This should not get wrapped for tmux, - // which will handle it via its Ss/Se terminfo extension - usually - // according to its terminal-overrides. - - switch (shape) { - case SHAPE_BLOCK: shape = 1; break; - case SHAPE_HOR: shape = 3; break; - case SHAPE_VER: shape = 5; break; - default: WLOG("Unknown shape value %d", shape); break; - } - data->params[0].i = shape + (int)(c.blinkon == 0); - unibi_format(vars, vars + 26, "\x1b[%p1%d q", - data->params, out, ui, NULL, NULL); + switch (shape) { + case SHAPE_BLOCK: shape = 0; break; + case SHAPE_VER: shape = 1; break; + case SHAPE_HOR: shape = 2; break; + default: WLOG("Unknown shape value %d", shape); break; } + data->params[0].i = shape; + data->params[1].i = (c.blinkon != 0); + unibi_out(ui, data->unibi_ext.konsole_cursor_shape); + + switch (shape) { + case SHAPE_BLOCK: shape = 1; break; + case SHAPE_HOR: shape = 3; break; + case SHAPE_VER: shape = 5; break; + default: WLOG("Unknown shape value %d", shape); break; + } + data->params[0].i = shape + (int)(c.blinkon == 0); + unibi_out(ui, data->unibi_ext.dec_cursor_shape); } /// @param mode editor mode @@ -1161,197 +1142,910 @@ static void unibi_set_if_empty(unibi_term *ut, enum unibi_string str, } } -static TermType detect_term(const char *term, const char *colorterm) +// Taken from unibilium/t/static_xterm.c as of 2015-08-14. +// This is an 8-colour terminfo description that lacks +// DECSTBN/DECSLRM/DECLRMM capabilities that xterm actually has. +static const char xterm_8colour_terminfo[] = { + 26, 1, 48, 0, 38, 0, 15, 0, -99, 1, 108, 5, 120, 116, 101, 114, 109, 124, 120, 116, + 101, 114, 109, 32, 116, 101, 114, 109, 105, 110, 97, 108, 32, 101, 109, 117, 108, 97, 116, 111, + 114, 32, 40, 88, 32, 87, 105, 110, 100, 111, 119, 32, 83, 121, 115, 116, 101, 109, 41, 0, + 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, + 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 8, 0, 64, 0, 0, 0, 4, 0, 6, 0, 8, 0, 25, 0, 30, 0, + 38, 0, 42, 0, 46, 0, -1, -1, 57, 0, 74, 0, 76, 0, 80, 0, 87, 0, -1, -1, + 89, 0, 102, 0, -1, -1, 106, 0, 110, 0, 120, 0, 124, 0, -1, -1, -1, -1, -128, 0, + -124, 0, -119, 0, -114, 0, -1, -1, -1, -1, -105, 0, -100, 0, -1, -1, -95, 0, -90, 0, + -85, 0, -80, 0, -71, 0, -67, 0, -60, 0, -1, -1, -51, 0, -46, 0, -40, 0, -34, 0, + -1, -1, -1, -1, -1, -1, -16, 0, -1, -1, -1, -1, -1, -1, 2, 1, -1, -1, 6, 1, + -1, -1, -1, -1, -1, -1, 8, 1, -1, -1, 13, 1, -1, -1, -1, -1, -1, -1, -1, -1, + 17, 1, 21, 1, 27, 1, 31, 1, 35, 1, 39, 1, 45, 1, 51, 1, 57, 1, 63, 1, + 69, 1, 73, 1, -1, -1, 78, 1, -1, -1, 82, 1, 87, 1, 92, 1, 96, 1, 103, 1, + -1, -1, 110, 1, 114, 1, 122, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -126, 1, -117, 1, -1, -1, -1, -1, -108, 1, + -99, 1, -90, 1, -81, 1, -72, 1, -63, 1, -54, 1, -45, 1, -36, 1, -27, 1, -1, -1, + -1, -1, -1, -1, -18, 1, -14, 1, -9, 1, -1, -1, -4, 1, -1, 1, -1, -1, -1, -1, + 17, 2, 20, 2, 31, 2, 34, 2, 36, 2, 39, 2, 121, 2, -1, -1, 124, 2, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 126, 2, -1, -1, -1, -1, -1, -1, -1, -1, + -126, 2, -1, -1, -73, 2, -1, -1, -1, -1, -69, 2, -63, 2, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -57, 2, -53, 2, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -49, 2, -1, -1, -1, -1, -42, 2, -1, -1, + -1, -1, -1, -1, -1, -1, -35, 2, -28, 2, -21, 2, -1, -1, -1, -1, -14, 2, -1, -1, + -7, 2, -1, -1, -1, -1, -1, -1, 0, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 7, 3, 13, 3, 19, 3, 26, 3, 33, 3, 40, 3, 47, 3, 55, 3, 63, 3, 71, 3, + 79, 3, 87, 3, 95, 3, 103, 3, 111, 3, 118, 3, 125, 3, -124, 3, -117, 3, -109, 3, + -101, 3, -93, 3, -85, 3, -77, 3, -69, 3, -61, 3, -53, 3, -46, 3, -39, 3, -32, 3, + -25, 3, -17, 3, -9, 3, -1, 3, 7, 4, 15, 4, 23, 4, 31, 4, 39, 4, 46, 4, + 53, 4, 60, 4, 67, 4, 75, 4, 83, 4, 91, 4, 99, 4, 107, 4, 115, 4, 123, 4, + -125, 4, -118, 4, -111, 4, -104, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -99, 4, -88, 4, -83, 4, + -75, 4, -71, 4, -1, -1, -1, -1, -1, -1, -1, -1, -62, 4, 8, 5, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, 5, + -1, -1, -1, -1, -1, -1, 82, 5, 92, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 102, 5, 105, 5, 27, 91, 90, 0, 7, 0, + 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, + 91, 51, 103, 0, 27, 91, 72, 27, 91, 50, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, + 27, 91, 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, + 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, + 0, 8, 0, 27, 91, 63, 49, 50, 108, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, + 27, 91, 65, 0, 27, 91, 63, 49, 50, 59, 50, 53, 104, 0, 27, 91, 80, 0, 27, 91, + 77, 0, 27, 40, 48, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 63, 49, + 48, 52, 57, 104, 0, 27, 91, 52, 104, 0, 27, 91, 56, 109, 0, 27, 91, 55, 109, 0, + 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, 37, 112, 49, 37, 100, 88, 0, 27, + 40, 66, 0, 27, 40, 66, 27, 91, 109, 0, 27, 91, 63, 49, 48, 52, 57, 108, 0, 27, + 91, 52, 108, 0, 27, 91, 50, 55, 109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, + 104, 36, 60, 49, 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 27, 91, 33, 112, 27, 91, + 63, 51, 59, 52, 108, 27, 91, 52, 108, 27, 62, 0, 27, 91, 76, 0, 8, 0, 27, 91, + 51, 126, 0, 27, 79, 66, 0, 27, 79, 80, 0, 27, 91, 50, 49, 126, 0, 27, 79, 81, + 0, 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, + 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, + 79, 72, 0, 27, 91, 50, 126, 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, + 126, 0, 27, 79, 67, 0, 27, 91, 49, 59, 50, 66, 0, 27, 91, 49, 59, 50, 65, 0, + 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, 63, 49, 104, 27, 61, 0, + 27, 91, 63, 49, 48, 51, 52, 108, 0, 27, 91, 63, 49, 48, 51, 52, 104, 0, 27, 91, + 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, + 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, + 100, 83, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, + 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 84, 0, 27, + 91, 37, 112, 49, 37, 100, 65, 0, 27, 91, 105, 0, 27, 91, 52, 105, 0, 27, 91, 53, + 105, 0, 27, 99, 0, 27, 91, 33, 112, 27, 91, 63, 51, 59, 52, 108, 27, 91, 52, 108, + 27, 62, 0, 27, 56, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, + 10, 0, 27, 77, 0, 37, 63, 37, 112, 57, 37, 116, 27, 40, 48, 37, 101, 27, 40, 66, + 37, 59, 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, + 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 49, 37, 112, 51, 37, 124, 37, 116, 59, + 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 37, 63, 37, 112, 55, 37, + 116, 59, 56, 37, 59, 109, 0, 27, 72, 0, 9, 0, 27, 79, 69, 0, 96, 96, 97, 97, + 102, 102, 103, 103, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, + 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, + 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 91, 63, 55, 104, 0, 27, + 91, 63, 55, 108, 0, 27, 79, 70, 0, 27, 79, 77, 0, 27, 91, 51, 59, 50, 126, 0, + 27, 91, 49, 59, 50, 70, 0, 27, 91, 49, 59, 50, 72, 0, 27, 91, 50, 59, 50, 126, + 0, 27, 91, 49, 59, 50, 68, 0, 27, 91, 54, 59, 50, 126, 0, 27, 91, 53, 59, 50, + 126, 0, 27, 91, 49, 59, 50, 67, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, + 0, 27, 91, 49, 59, 50, 80, 0, 27, 91, 49, 59, 50, 81, 0, 27, 91, 49, 59, 50, + 82, 0, 27, 91, 49, 59, 50, 83, 0, 27, 91, 49, 53, 59, 50, 126, 0, 27, 91, 49, + 55, 59, 50, 126, 0, 27, 91, 49, 56, 59, 50, 126, 0, 27, 91, 49, 57, 59, 50, 126, + 0, 27, 91, 50, 48, 59, 50, 126, 0, 27, 91, 50, 49, 59, 50, 126, 0, 27, 91, 50, + 51, 59, 50, 126, 0, 27, 91, 50, 52, 59, 50, 126, 0, 27, 91, 49, 59, 53, 80, 0, + 27, 91, 49, 59, 53, 81, 0, 27, 91, 49, 59, 53, 82, 0, 27, 91, 49, 59, 53, 83, + 0, 27, 91, 49, 53, 59, 53, 126, 0, 27, 91, 49, 55, 59, 53, 126, 0, 27, 91, 49, + 56, 59, 53, 126, 0, 27, 91, 49, 57, 59, 53, 126, 0, 27, 91, 50, 48, 59, 53, 126, + 0, 27, 91, 50, 49, 59, 53, 126, 0, 27, 91, 50, 51, 59, 53, 126, 0, 27, 91, 50, + 52, 59, 53, 126, 0, 27, 91, 49, 59, 54, 80, 0, 27, 91, 49, 59, 54, 81, 0, 27, + 91, 49, 59, 54, 82, 0, 27, 91, 49, 59, 54, 83, 0, 27, 91, 49, 53, 59, 54, 126, + 0, 27, 91, 49, 55, 59, 54, 126, 0, 27, 91, 49, 56, 59, 54, 126, 0, 27, 91, 49, + 57, 59, 54, 126, 0, 27, 91, 50, 48, 59, 54, 126, 0, 27, 91, 50, 49, 59, 54, 126, + 0, 27, 91, 50, 51, 59, 54, 126, 0, 27, 91, 50, 52, 59, 54, 126, 0, 27, 91, 49, + 59, 51, 80, 0, 27, 91, 49, 59, 51, 81, 0, 27, 91, 49, 59, 51, 82, 0, 27, 91, + 49, 59, 51, 83, 0, 27, 91, 49, 53, 59, 51, 126, 0, 27, 91, 49, 55, 59, 51, 126, + 0, 27, 91, 49, 56, 59, 51, 126, 0, 27, 91, 49, 57, 59, 51, 126, 0, 27, 91, 50, + 48, 59, 51, 126, 0, 27, 91, 50, 49, 59, 51, 126, 0, 27, 91, 50, 51, 59, 51, 126, + 0, 27, 91, 50, 52, 59, 51, 126, 0, 27, 91, 49, 59, 52, 80, 0, 27, 91, 49, 59, + 52, 81, 0, 27, 91, 49, 59, 52, 82, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, + 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 49, 59, 50, 99, 0, 27, + 91, 99, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 91, 51, 37, 63, 37, 112, 49, + 37, 123, 49, 125, 37, 61, 37, 116, 52, 37, 101, 37, 112, 49, 37, 123, 51, 125, 37, 61, + 37, 116, 54, 37, 101, 37, 112, 49, 37, 123, 52, 125, 37, 61, 37, 116, 49, 37, 101, 37, + 112, 49, 37, 123, 54, 125, 37, 61, 37, 116, 51, 37, 101, 37, 112, 49, 37, 100, 37, 59, + 109, 0, 27, 91, 52, 37, 63, 37, 112, 49, 37, 123, 49, 125, 37, 61, 37, 116, 52, 37, + 101, 37, 112, 49, 37, 123, 51, 125, 37, 61, 37, 116, 54, 37, 101, 37, 112, 49, 37, 123, + 52, 125, 37, 61, 37, 116, 49, 37, 101, 37, 112, 49, 37, 123, 54, 125, 37, 61, 37, 116, + 51, 37, 101, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 77, 0, 27, 91, 51, 37, + 112, 49, 37, 100, 109, 0, 27, 91, 52, 37, 112, 49, 37, 100, 109, 0, 27, 108, 0, 27, + 109, 0, 2, 0, 1, 0, 57, 0, 117, 0, -88, 2, 1, 0, -1, -1, -1, -1, 0, 0, + 7, 0, 14, 0, 21, 0, 28, 0, 35, 0, 42, 0, 49, 0, 56, 0, 63, 0, 70, 0, + 77, 0, 84, 0, 91, 0, 98, 0, 105, 0, 112, 0, 119, 0, 126, 0, -123, 0, -116, 0, + -109, 0, -102, 0, -95, 0, -88, 0, -81, 0, -74, 0, -67, 0, -60, 0, -53, 0, -46, 0, + -39, 0, -32, 0, -25, 0, -18, 0, -11, 0, -4, 0, 3, 1, 10, 1, 17, 1, 24, 1, + 31, 1, 38, 1, 45, 1, 52, 1, 59, 1, 66, 1, 73, 1, 80, 1, 87, 1, 94, 1, + 101, 1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 3, 0, 6, 0, 9, 0, 12, 0, + 17, 0, 22, 0, 27, 0, 32, 0, 37, 0, 41, 0, 46, 0, 51, 0, 56, 0, 61, 0, + 66, 0, 72, 0, 78, 0, 84, 0, 90, 0, 96, 0, 102, 0, 108, 0, 114, 0, 120, 0, + 126, 0, -125, 0, -120, 0, -115, 0, -110, 0, -105, 0, -99, 0, -93, 0, -87, 0, -81, 0, + -75, 0, -69, 0, -63, 0, -57, 0, -51, 0, -45, 0, -39, 0, -33, 0, -27, 0, -21, 0, + -15, 0, -9, 0, -3, 0, 3, 1, 9, 1, 15, 1, 19, 1, 24, 1, 29, 1, 34, 1, + 39, 1, 44, 1, 48, 1, 52, 1, 56, 1, 27, 91, 51, 59, 51, 126, 0, 27, 91, 51, + 59, 52, 126, 0, 27, 91, 51, 59, 53, 126, 0, 27, 91, 51, 59, 54, 126, 0, 27, 91, + 51, 59, 55, 126, 0, 27, 91, 49, 59, 50, 66, 0, 27, 91, 49, 59, 51, 66, 0, 27, + 91, 49, 59, 52, 66, 0, 27, 91, 49, 59, 53, 66, 0, 27, 91, 49, 59, 54, 66, 0, + 27, 91, 49, 59, 55, 66, 0, 27, 91, 49, 59, 51, 70, 0, 27, 91, 49, 59, 52, 70, + 0, 27, 91, 49, 59, 53, 70, 0, 27, 91, 49, 59, 54, 70, 0, 27, 91, 49, 59, 55, + 70, 0, 27, 91, 49, 59, 51, 72, 0, 27, 91, 49, 59, 52, 72, 0, 27, 91, 49, 59, + 53, 72, 0, 27, 91, 49, 59, 54, 72, 0, 27, 91, 49, 59, 55, 72, 0, 27, 91, 50, + 59, 51, 126, 0, 27, 91, 50, 59, 52, 126, 0, 27, 91, 50, 59, 53, 126, 0, 27, 91, + 50, 59, 54, 126, 0, 27, 91, 50, 59, 55, 126, 0, 27, 91, 49, 59, 51, 68, 0, 27, + 91, 49, 59, 52, 68, 0, 27, 91, 49, 59, 53, 68, 0, 27, 91, 49, 59, 54, 68, 0, + 27, 91, 49, 59, 55, 68, 0, 27, 91, 54, 59, 51, 126, 0, 27, 91, 54, 59, 52, 126, + 0, 27, 91, 54, 59, 53, 126, 0, 27, 91, 54, 59, 54, 126, 0, 27, 91, 54, 59, 55, + 126, 0, 27, 91, 53, 59, 51, 126, 0, 27, 91, 53, 59, 52, 126, 0, 27, 91, 53, 59, + 53, 126, 0, 27, 91, 53, 59, 54, 126, 0, 27, 91, 53, 59, 55, 126, 0, 27, 91, 49, + 59, 51, 67, 0, 27, 91, 49, 59, 52, 67, 0, 27, 91, 49, 59, 53, 67, 0, 27, 91, + 49, 59, 54, 67, 0, 27, 91, 49, 59, 55, 67, 0, 27, 91, 49, 59, 50, 65, 0, 27, + 91, 49, 59, 51, 65, 0, 27, 91, 49, 59, 52, 65, 0, 27, 91, 49, 59, 53, 65, 0, + 27, 91, 49, 59, 54, 65, 0, 27, 91, 49, 59, 55, 65, 0, 65, 88, 0, 88, 84, 0, + 85, 56, 0, 88, 77, 0, 107, 68, 67, 51, 0, 107, 68, 67, 52, 0, 107, 68, 67, 53, + 0, 107, 68, 67, 54, 0, 107, 68, 67, 55, 0, 107, 68, 78, 0, 107, 68, 78, 51, 0, + 107, 68, 78, 52, 0, 107, 68, 78, 53, 0, 107, 68, 78, 54, 0, 107, 68, 78, 55, 0, + 107, 69, 78, 68, 51, 0, 107, 69, 78, 68, 52, 0, 107, 69, 78, 68, 53, 0, 107, 69, + 78, 68, 54, 0, 107, 69, 78, 68, 55, 0, 107, 72, 79, 77, 51, 0, 107, 72, 79, 77, + 52, 0, 107, 72, 79, 77, 53, 0, 107, 72, 79, 77, 54, 0, 107, 72, 79, 77, 55, 0, + 107, 73, 67, 51, 0, 107, 73, 67, 52, 0, 107, 73, 67, 53, 0, 107, 73, 67, 54, 0, + 107, 73, 67, 55, 0, 107, 76, 70, 84, 51, 0, 107, 76, 70, 84, 52, 0, 107, 76, 70, + 84, 53, 0, 107, 76, 70, 84, 54, 0, 107, 76, 70, 84, 55, 0, 107, 78, 88, 84, 51, + 0, 107, 78, 88, 84, 52, 0, 107, 78, 88, 84, 53, 0, 107, 78, 88, 84, 54, 0, 107, + 78, 88, 84, 55, 0, 107, 80, 82, 86, 51, 0, 107, 80, 82, 86, 52, 0, 107, 80, 82, + 86, 53, 0, 107, 80, 82, 86, 54, 0, 107, 80, 82, 86, 55, 0, 107, 82, 73, 84, 51, + 0, 107, 82, 73, 84, 52, 0, 107, 82, 73, 84, 53, 0, 107, 82, 73, 84, 54, 0, 107, + 82, 73, 84, 55, 0, 107, 85, 80, 0, 107, 85, 80, 51, 0, 107, 85, 80, 52, 0, 107, + 85, 80, 53, 0, 107, 85, 80, 54, 0, 107, 85, 80, 55, 0, 107, 97, 50, 0, 107, 98, + 49, 0, 107, 98, 51, 0, 107, 99, 50, 0 +}; +// Taken from unibilium/t/static_tmux.c as of 2015-08-14. +// This is an 256-colour terminfo description that lacks +// status line capabilities that tmux actually has. +static const char tmux_256colour_terminfo[] = { + 26, 1, 56, 0, 15, 0, 15, 0, 105, 1, -48, 2, 116, 109, 117, 120, 124, 86, 84, 32, + 49, 48, 48, 47, 65, 78, 83, 73, 32, 88, 51, 46, 54, 52, 32, 118, 105, 114, 116, 117, + 97, 108, 32, 116, 101, 114, 109, 105, 110, 97, 108, 32, 119, 105, 116, 104, 32, 50, 53, 54, + 32, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, + 0, 1, 1, 0, 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, 0, 0, 4, 0, 6, 0, + 8, 0, 25, 0, 30, 0, 37, 0, 41, 0, -1, -1, -1, -1, 45, 0, 62, 0, 64, 0, + 68, 0, 75, 0, -1, -1, 77, 0, 89, 0, -1, -1, 93, 0, 96, 0, 102, 0, 106, 0, + -1, -1, -1, -1, 110, 0, 112, 0, 117, 0, 122, 0, -1, -1, -1, -1, 123, 0, -1, -1, + -1, -1, -128, 0, -123, 0, -118, 0, -1, -1, -113, 0, -111, 0, -106, 0, -1, -1, -105, 0, + -100, 0, -94, 0, -88, 0, -1, -1, -1, -1, -1, -1, -85, 0, -1, -1, -1, -1, -1, -1, + -81, 0, -1, -1, -77, 0, -1, -1, -1, -1, -1, -1, -75, 0, -1, -1, -70, 0, -1, -1, + -1, -1, -1, -1, -1, -1, -66, 0, -62, 0, -56, 0, -52, 0, -48, 0, -44, 0, -38, 0, + -32, 0, -26, 0, -20, 0, -14, 0, -9, 0, -1, -1, -4, 0, -1, -1, 0, 1, 5, 1, + 10, 1, -1, -1, -1, -1, -1, -1, 14, 1, 18, 1, 26, 1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 34, 1, -1, -1, 37, 1, 46, 1, 55, 1, 64, 1, -1, -1, 73, 1, 82, 1, 91, 1, + -1, -1, 100, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 109, 1, -1, -1, -1, -1, 126, 1, -1, -1, -127, 1, -124, 1, -122, 1, -119, 1, -46, 1, + -1, -1, -43, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -41, 1, -1, -1, 24, 2, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 28, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 35, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 40, 2, 46, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, 2, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 57, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 66, 2, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 71, 2, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 77, 2, -1, -1, -1, -1, -1, -1, 81, 2, -112, 2, 27, 91, 90, 0, + 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, + 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, 74, + 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, + 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 51, 52, 104, 27, 91, + 63, 50, 53, 104, 0, 27, 91, 67, 0, 27, 77, 0, 27, 91, 51, 52, 108, 0, 27, 91, + 80, 0, 27, 91, 77, 0, 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 0, 27, + 91, 52, 104, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 15, + 0, 27, 91, 109, 15, 0, 0, 27, 91, 52, 108, 0, 27, 91, 50, 55, 109, 0, 27, 91, + 50, 52, 109, 0, 27, 103, 0, 27, 41, 48, 0, 27, 91, 76, 0, 8, 0, 27, 91, 51, + 126, 0, 27, 79, 66, 0, 27, 79, 80, 0, 27, 91, 50, 49, 126, 0, 27, 79, 81, 0, + 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, + 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 91, + 49, 126, 0, 27, 91, 50, 126, 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, + 126, 0, 27, 79, 67, 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, + 63, 49, 104, 27, 61, 0, 27, 69, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, + 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, + 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, + 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, + 0, 27, 99, 27, 91, 63, 49, 48, 48, 48, 108, 27, 91, 63, 50, 53, 104, 0, 27, 56, + 0, 27, 55, 0, 10, 0, 27, 77, 0, 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, + 49, 37, 59, 37, 63, 37, 112, 49, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 50, 37, + 116, 59, 52, 37, 59, 37, 63, 37, 112, 51, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, + 52, 37, 116, 59, 53, 37, 59, 109, 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, + 59, 0, 27, 72, 0, 9, 0, 43, 43, 44, 44, 45, 45, 46, 46, 48, 48, 96, 96, 97, + 97, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, + 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, + 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 40, 66, 27, + 41, 48, 0, 27, 91, 52, 126, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, + 27, 91, 49, 75, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 91, 51, 109, 0, 27, + 91, 50, 51, 109, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, + 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, + 37, 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, + 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, + 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, + 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, + 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0 +}; +// Taken from unibilium/t/static_screen-256color.c as of 2015-08-14. +// This is an 256-colour terminfo description that lacks +// status line capabilities that screen actually has. +static const char screen_256colour_terminfo[] = { + 26, 1, 43, 0, 43, 0, 15, 0, 105, 1, -43, 2, 115, 99, 114, 101, 101, 110, 45, 50, + 53, 54, 99, 111, 108, 111, 114, 124, 71, 78, 85, 32, 83, 99, 114, 101, 101, 110, 32, 119, + 105, 116, 104, 32, 50, 53, 54, 32, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, + 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 80, 0, + 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 0, 1, -1, 127, 0, 0, 4, 0, 6, 0, 8, 0, 25, 0, 30, 0, + 37, 0, 41, 0, -1, -1, -1, -1, 45, 0, 62, 0, 64, 0, 68, 0, 75, 0, -1, -1, + 77, 0, 89, 0, -1, -1, 93, 0, 96, 0, 102, 0, 106, 0, -1, -1, -1, -1, 110, 0, + 112, 0, 117, 0, 122, 0, -1, -1, -1, -1, -125, 0, -1, -1, -1, -1, -120, 0, -115, 0, + -110, 0, -1, -1, -105, 0, -103, 0, -98, 0, -1, -1, -89, 0, -84, 0, -78, 0, -72, 0, + -1, -1, -1, -1, -1, -1, -69, 0, -1, -1, -1, -1, -1, -1, -65, 0, -1, -1, -61, 0, + -1, -1, -1, -1, -1, -1, -59, 0, -1, -1, -54, 0, -1, -1, -1, -1, -1, -1, -1, -1, + -50, 0, -46, 0, -40, 0, -36, 0, -32, 0, -28, 0, -22, 0, -16, 0, -10, 0, -4, 0, + 2, 1, 7, 1, -1, -1, 12, 1, -1, -1, 16, 1, 21, 1, 26, 1, -1, -1, -1, -1, + -1, -1, 30, 1, 34, 1, 42, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 1, -1, -1, 53, 1, + 62, 1, 71, 1, 80, 1, -1, -1, 89, 1, 98, 1, 107, 1, -1, -1, 116, 1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 125, 1, -1, -1, -1, -1, + -114, 1, -1, -1, -111, 1, -108, 1, -106, 1, -103, 1, -30, 1, -1, -1, -27, 1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -25, 1, -1, -1, 40, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 44, 2, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 2, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 56, 2, 62, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 68, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 73, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, 2, + -1, -1, -1, -1, -1, -1, 86, 2, -107, 2, 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, + 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, + 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, + 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, + 63, 50, 53, 108, 0, 8, 0, 27, 91, 51, 52, 104, 27, 91, 63, 50, 53, 104, 0, 27, + 91, 67, 0, 27, 77, 0, 27, 91, 51, 52, 108, 0, 27, 91, 80, 0, 27, 91, 77, 0, + 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 63, 49, 48, 52, 57, 104, + 0, 27, 91, 52, 104, 0, 27, 91, 55, 109, 0, 27, 91, 51, 109, 0, 27, 91, 52, 109, + 0, 15, 0, 27, 91, 109, 15, 0, 27, 91, 63, 49, 48, 52, 57, 108, 0, 27, 91, 52, + 108, 0, 27, 91, 50, 51, 109, 0, 27, 91, 50, 52, 109, 0, 27, 103, 0, 27, 41, 48, + 0, 27, 91, 76, 0, 8, 0, 27, 91, 51, 126, 0, 27, 79, 66, 0, 27, 79, 80, 0, + 27, 91, 50, 49, 126, 0, 27, 79, 81, 0, 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, + 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, + 126, 0, 27, 91, 50, 48, 126, 0, 27, 91, 49, 126, 0, 27, 91, 50, 126, 0, 27, 79, + 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 79, 67, 0, 27, 79, 65, 0, + 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, 63, 49, 104, 27, 61, 0, 27, 69, 0, 27, + 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, + 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, + 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, + 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 99, 27, 91, 63, 49, 48, 48, 48, + 108, 27, 91, 63, 50, 53, 104, 0, 27, 56, 0, 27, 55, 0, 10, 0, 27, 77, 0, 27, + 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 49, 37, 116, + 59, 51, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 51, + 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 109, 37, 63, + 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, 9, 0, 43, 43, 44, + 44, 45, 45, 46, 46, 48, 48, 96, 96, 97, 97, 102, 102, 103, 103, 104, 104, 105, 105, 106, + 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, + 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, + 126, 0, 27, 91, 90, 0, 27, 40, 66, 27, 41, 48, 0, 27, 91, 52, 126, 0, 27, 91, + 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 49, 75, 0, 27, 91, 51, 57, 59, + 52, 57, 109, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, + 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, + 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, + 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, + 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, + 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, + 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 0, 3, 0, 1, 0, + 24, 0, 52, 0, -112, 0, 1, 1, 0, 0, 1, 0, 0, 0, 4, 0, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 0, 0, 3, 0, 6, 0, 9, 0, 12, 0, 15, 0, 18, 0, 23, 0, 28, 0, 32, 0, + 37, 0, 43, 0, 49, 0, 55, 0, 61, 0, 66, 0, 71, 0, 77, 0, 83, 0, 89, 0, + 95, 0, 101, 0, 107, 0, 111, 0, 116, 0, 120, 0, 124, 0, -128, 0, 27, 40, 66, 0, + 27, 40, 37, 112, 49, 37, 99, 0, 65, 88, 0, 71, 48, 0, 88, 84, 0, 85, 56, 0, + 69, 48, 0, 83, 48, 0, 107, 68, 67, 53, 0, 107, 68, 67, 54, 0, 107, 68, 78, 0, + 107, 68, 78, 53, 0, 107, 69, 78, 68, 53, 0, 107, 69, 78, 68, 54, 0, 107, 72, 79, + 77, 53, 0, 107, 72, 79, 77, 54, 0, 107, 73, 67, 53, 0, 107, 73, 67, 54, 0, 107, + 76, 70, 84, 53, 0, 107, 78, 88, 84, 53, 0, 107, 78, 88, 84, 54, 0, 107, 80, 82, + 86, 53, 0, 107, 80, 82, 86, 54, 0, 107, 82, 73, 84, 53, 0, 107, 85, 80, 0, 107, + 85, 80, 53, 0, 107, 97, 50, 0, 107, 98, 49, 0, 107, 98, 51, 0, 107, 99, 50, 0 +}; +// Taken from Dickey ncurses terminfo.src dated 2017-04-22. +static const char iterm_16colour_terminfo[] = { + 26, 1, 57, 0, 29, 0, 15, 0, 105, 1, 73, 3, 105, 84, 101, 114, 109, 46, 97, 112, 112, 124, 105, 116, 101, 114, 109, 124, 105, 84, 101, 114, +109, 46, 97, 112, 112, 32, 116, 101, 114, 109, 105, 110, 97, 108, 32, 101, 109, 117, 108, 97, 116, 111, 114, 32, 102, 111, 114, 32, 77, 97, 99, 32, + 79, 83, 32, 88, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, + 0, 1, 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, 50, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, + -1, -1, 0, 0, 2, 0, -2, -1, 4, 0, 9, 0, 16, 0, 20, 0, 24, 0, -1, -1, 35, 0, 52, 0, 54, 0, 58, 0, 65, 0, -1, -1, + 67, 0, 74, 0, -1, -1, 78, 0, -1, -1, 82, 0, 86, 0, 90, 0, -1, -1, 96, 0, 98, 0, 103, 0, 108, 0, -1, -1, -2, -1, 117, 0, +122, 0, -1, -1, 127, 0,-124, 0,-119, 0, -1, -1,-114, 0,-112, 0,-107, 0, -1, -1, -94, 0, -89, 0, -85, 0, -81, 0, -1, -1, -63, 0, + -1, -1, -1, -1, -1, -1, -1, -1, -61, 0, -57, 0, -1, -1, -53, 0, -1, -1, -1, -1, -1, -1, -51, 0, -1, -1, -46, 0, -1, -1, -1, -1, + -1, -1, -1, -1, -42, 0, -38, 0, -32, 0, -28, 0, -24, 0, -20, 0, -14, 0, -8, 0, -2, 0, 4, 1, 10, 1, -1, -1, -1, -1, 14, 1, + -1, -1, 18, 1, 23, 1, 28, 1, -1, -1, -1, -1, -1, -1, 32, 1, 36, 1, 44, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, 1, 61, 1, 70, 1, 79, 1, -1, -1, 88, 1, 97, 1, +106, 1, -1, -1, 115, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 124, 1, -1, -1, -1, -1,-104, 1,-101, 1, +-90, 1, -87, 1, -85, 1, -82, 1, -4, 1, -1, -1, -1, 1, 1, 2, -1, -1, -1, -1, -1, -1, 6, 2, 10, 2, 14, 2, 18, 2, 22, 2, + -1, -1, -1, -1, 26, 2, -1, -1, -1, -1, -1, -1, -1, -1, 77, 2, 83, 2, -1, -1, -1, -1, 89, 2, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 96, 2, 100, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 104, 2, 110, 2, 116, 2, 122, 2,-128, 2,-122, 2,-116, 2,-110, 2, +104, 2, -98, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -92, 2, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -87, 2, -76, 2, -71, 2, -63, 2, -59, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -54, 2, 9, 3, 7, 0, 13, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, + 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, +112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, + 27, 91, 65, 0, 27, 91, 80, 0, 27, 91, 77, 0, 27, 93, 50, 59, 7, 0, 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 55, + 27, 91, 63, 52, 55, 104, 0, 27, 91, 52, 104, 0, 27, 91, 56, 109, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, + 15, 0, 27, 91, 109, 15, 0, 27, 91, 50, 74, 27, 91, 63, 52, 55, 108, 27, 56, 0, 27, 91, 52, 108, 0, 27, 91, 109, 0, 27, 91, 109, + 0, 27, 91, 63, 53, 104, 36, 60, 50, 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 7, 0, 27, 91, 64, 0, 27, 91, 76, 0, 127, 0, 27, + 91, 51, 126, 0, 27, 79, 66, 0, 27, 79, 80, 0, 27, 91, 50, 49, 126, 0, 27, 79, 81, 0, 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, + 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 79, 72, 0, + 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 79, 67, 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, + 63, 49, 104, 27, 61, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, + 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, + 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 62, 27, 91, 63, 51, 108, 27, 91, 63, 52, 108, 27, 91, 63, 53, 108, 27, + 91, 63, 55, 104, 27, 91, 63, 56, 104, 0, 27, 56, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, + 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 49, 37, 112, + 51, 37, 124, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 37, 63, 37, 112, 55, 37, 116, 59, 56, 37, 59, 109, + 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, 9, 0, 27, 93, 50, 59, 0, 27, 79, 113, 0, 27, 79, 115, 0, + 27, 79, 114, 0, 27, 79, 112, 0, 27, 79, 110, 0, 96, 96, 97, 97, 102, 102, 103, 103, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, +112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, + 91, 63, 55, 104, 0, 27, 91, 63, 55, 108, 0, 27, 40, 66, 27, 41, 48, 0, 27, 79, 70, 0, 27, 79, 77, 0, 27, 91, 50, 51, 126, 0, + 27, 91, 50, 52, 126, 0, 27, 91, 50, 53, 126, 0, 27, 91, 50, 54, 126, 0, 27, 91, 50, 56, 126, 0, 27, 91, 50, 57, 126, 0, 27, 91, + 51, 49, 126, 0, 27, 91, 50, 50, 126, 0, 27, 91, 51, 51, 126, 0, 27, 91, 51, 52, 126, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, +100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 49, 59, 50, 99, 0, 27, 91, 99, 0, 27, 91, 48, 109, 0, 27, 91, 37, 63, + 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, + 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, +112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, + 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0 +}; +// Taken from Dickey ncurses terminfo.src dated 2017-04-22. +static const char rxvt_256colour_terminfo[] = { + 26, 1, 47, 0, 29, 0, 15, 0, 110, 1, -31, 4, 114, 120, 118, 116, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 114, 120, 118, 116, 32, 50, + 46, 55, 46, 57, 32, 119, 105, 116, 104, 32, 120, 116, 101, 114, 109, 32, 50, 53, 54, 45, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, + 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 80, 0, 8, 0, 24, 0, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, -1, -1, 0, 0, 2, 0, 4, 0, 21, 0, + 26, 0, 34, 0, 38, 0, 42, 0, -1, -1, 53, 0, 70, 0, 72, 0, 76, 0, 83, 0, -1, -1, 85, 0, 92, 0, -1, -1, 96, 0, -1, -1, + -1, -1, 100, 0, -1, -1, -1, -1, 104, 0, 106, 0, 111, 0, 116, 0, -1, -1, -1, -1, 125, 0, -1, -1, -1, -1,-126, 0,-121, 0,-116, 0, + -1, -1,-111, 0,-109, 0,-104, 0, -1, -1, -91, 0, -86, 0, -80, 0, -74, 0, -1, -1, -1, -1, -56, 0, -42, 0, -1, -1, -1, -1, -8, 0, + -4, 0, -1, -1, 0, 1, -1, -1, -1, -1, -1, -1, 2, 1, -1, -1, 7, 1, -1, -1, 11, 1, -1, -1, 16, 1, 22, 1, 28, 1, 34, 1, + 40, 1, 46, 1, 52, 1, 58, 1, 64, 1, 70, 1, 76, 1, 82, 1, 87, 1, -1, -1, 92, 1, -1, -1, 96, 1, 101, 1, 106, 1, 110, 1, +114, 1, -1, -1, 118, 1, 122, 1, 125, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,-128, 1,-119, 1,-110, 1, -1, -1,-101, 1, -92, 1, -83, 1, -1, -1, -74, 1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -65, 1, -32, 1, -1, -1, -1, -1, 18, 2, 21, 2, 32, 2, 35, 2, 37, 2, 40, 2, 107, 2, + -1, -1, 110, 2, -1, -1, -1, -1, -1, -1, -1, -1, 112, 2, 116, 2, 120, 2, 124, 2,-128, 2, -1, -1, -1, -1,-124, 2, -1, -1, -73, 2, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -69, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -62, 2, +-57, 2, -1, -1, -53, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -48, 2, -1, -1, -43, 2, -38, 2, -1, -1, -1, -1, + -1, -1, -1, -1, -33, 2, -28, 2, -23, 2, -1, -1, -1, -1, -19, 2, -1, -1, -14, 2, -1, -1, -1, -1, -1, -1, -9, 2, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -5, 2, 1, 3, 7, 3, 13, 3, 19, 3, 25, 3, 31, 3, 37, 3, 43, 3, 49, 3, 55, 3, 61, 3, 67, 3, + 73, 3, 79, 3, 85, 3, 91, 3, 97, 3, 103, 3, 109, 3, 115, 3, 121, 3, 127, 3,-123, 3,-117, 3,-111, 3,-105, 3, -99, 3, -93, 3, +-87, 3, -81, 3, -75, 3, -69, 3, -63, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -57, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +-52, 3, -41, 3, -36, 3, -28, 3, -24, 3, -15, 3, -8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 86, 4, -1, -1, + -1, -1, -1, -1, 90, 4,-103, 4, -1, -1, -1, -1, -1, -1, -39, 4, -35, 4, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, + 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 50, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, + 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, + 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, 27, 91, 65, 0, 27, 91, 77, 0, 14, 0, 27, 91, 53, 109, + 0, 27, 91, 49, 109, 0, 27, 55, 27, 91, 63, 52, 55, 104, 0, 27, 91, 52, 104, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, + 52, 109, 0, 15, 0, 27, 91, 109, 15, 0, 27, 91, 50, 74, 27, 91, 63, 52, 55, 108, 27, 56, 0, 27, 91, 52, 108, 0, 27, 91, 50, 55, +109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, 104, 36, 60, 49, 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 27, 91, 63, 52, 55, 108, + 27, 61, 27, 91, 63, 49, 108, 0, 27, 91, 114, 27, 91, 109, 27, 91, 50, 74, 27, 91, 72, 27, 91, 63, 55, 104, 27, 91, 63, 49, 59, 51, + 59, 52, 59, 54, 108, 27, 91, 52, 108, 0, 27, 91, 64, 0, 27, 91, 76, 0, 8, 0, 27, 91, 51, 126, 0, 27, 91, 66, 0, 27, 91, 56, + 94, 0, 27, 91, 50, 49, 126, 0, 27, 91, 49, 49, 126, 0, 27, 91, 50, 49, 126, 0, 27, 91, 49, 50, 126, 0, 27, 91, 49, 51, 126, 0, + 27, 91, 49, 52, 126, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, + 50, 48, 126, 0, 27, 91, 55, 126, 0, 27, 91, 50, 126, 0, 27, 91, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 91, 67, 0, + 27, 91, 97, 0, 27, 91, 98, 0, 27, 91, 65, 0, 27, 62, 0, 27, 61, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, + 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, + 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 62, 27, 91, 49, 59, 51, 59, 52, 59, 53, 59, 54, 108, 27, + 91, 63, 55, 104, 27, 91, 109, 27, 91, 114, 27, 91, 50, 74, 27, 91, 72, 0, 27, 91, 114, 27, 91, 109, 27, 91, 50, 74, 27, 91, 72, 27, + 91, 63, 55, 104, 27, 91, 63, 49, 59, 51, 59, 52, 59, 54, 108, 27, 91, 52, 108, 27, 62, 27, 91, 63, 49, 48, 48, 48, 108, 27, 91, 63, + 50, 53, 104, 0, 27, 56, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, 27, 91, 48, 37, 63, 37, +112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 49, 37, 112, 51, 37, 124, 37, 116, 59, + 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 109, 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, + 9, 0, 27, 79, 119, 0, 27, 79, 121, 0, 27, 79, 117, 0, 27, 79, 113, 0, 27, 79, 115, 0, 96, 96, 97, 97, 102, 102, 103, 103, 106, 106, +107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, +123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 40, 66, 27, 41, 48, 0, 27, 91, 56, 126, 0, 27, 79, 77, 0, 27, 91, 49, +126, 0, 27, 91, 51, 36, 0, 27, 91, 52, 126, 0, 27, 91, 56, 36, 0, 27, 91, 55, 36, 0, 27, 91, 50, 36, 0, 27, 91, 100, 0, 27, + 91, 54, 36, 0, 27, 91, 53, 36, 0, 27, 91, 99, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 50, 53, 126, 0, 27, + 91, 50, 54, 126, 0, 27, 91, 50, 56, 126, 0, 27, 91, 50, 57, 126, 0, 27, 91, 51, 49, 126, 0, 27, 91, 51, 50, 126, 0, 27, 91, 51, + 51, 126, 0, 27, 91, 51, 52, 126, 0, 27, 91, 50, 51, 36, 0, 27, 91, 50, 52, 36, 0, 27, 91, 49, 49, 94, 0, 27, 91, 49, 50, 94, + 0, 27, 91, 49, 51, 94, 0, 27, 91, 49, 52, 94, 0, 27, 91, 49, 53, 94, 0, 27, 91, 49, 55, 94, 0, 27, 91, 49, 56, 94, 0, 27, + 91, 49, 57, 94, 0, 27, 91, 50, 48, 94, 0, 27, 91, 50, 49, 94, 0, 27, 91, 50, 51, 94, 0, 27, 91, 50, 52, 94, 0, 27, 91, 50, + 53, 94, 0, 27, 91, 50, 54, 94, 0, 27, 91, 50, 56, 94, 0, 27, 91, 50, 57, 94, 0, 27, 91, 51, 49, 94, 0, 27, 91, 51, 50, 94, + 0, 27, 91, 51, 51, 94, 0, 27, 91, 51, 52, 94, 0, 27, 91, 50, 51, 64, 0, 27, 91, 50, 52, 64, 0, 27, 91, 49, 75, 0, 27, 91, + 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 49, 59, 50, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, 52, + 57, 109, 0, 27, 93, 49, 48, 52, 7, 0, 27, 93, 52, 59, 37, 112, 49, 37, 100, 59, 114, 103, 98, 58, 37, 112, 50, 37, 123, 50, 53, 53, +125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 50, 46, 50, 88, 47, 37, 112, 51, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, + 48, 48, 48, 125, 37, 47, 37, 50, 46, 50, 88, 47, 37, 112, 52, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, + 37, 50, 46, 50, 88, 27, 92, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, +100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, + 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, + 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, + 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 40, 66, 0, 27, 40, 48, 0 +}; +// Taken from Dickey ncurses terminfo.src dated 2017-04-22. +static const char linux_16colour_terminfo[] = { + 26, 1, 43, 0, 29, 0, 16, 0, 125, 1, 125, 3, 108, 105, 110, 117, 120, 45, 49, 54, 99, 111, 108, 111, 114, 124, 108, 105, 110, 117, 120, 32, + 99, 111, 110, 115, 111, 108, 101, 32, 119, 105, 116, 104, 32, 49, 54, 32, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, + 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, -1, -1, 8, 0, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 16, 0, 0, 1, 42, 0, -1, -1, 0, 0, 2, 0, 4, 0, 21, 0, 26, 0, + 33, 0, 37, 0, 41, 0, -1, -1, 52, 0, 69, 0, 71, 0, 75, 0, 87, 0, -1, -1, 89, 0, 101, 0, -1, -1, 105, 0, 109, 0, 121, 0, +125, 0, -1, -1, -1, -1,-127, 0,-125, 0,-120, 0, -1, -1, -1, -1,-115, 0,-110, 0, -1, -1, -1, -1,-105, 0,-100, 0, -95, 0, -90, 0, +-81, 0, -79, 0, -1, -1, -1, -1, -74, 0, -69, 0, -63, 0, -57, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -39, 0, -35, 0, + -1, -1, -31, 0, -1, -1, -1, -1, -1, -1, -29, 0, -1, -1, -24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -20, 0, -15, 0, -9, 0, -4, 0, + 1, 1, 6, 1, 11, 1, 17, 1, 23, 1, 29, 1, 35, 1, 40, 1, -1, -1, 45, 1, -1, -1, 49, 1, 54, 1, 59, 1, -1, -1, -1, -1, + -1, -1, 63, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 67, 1, -1, -1, 70, 1, 79, 1, 88, 1, 97, 1, -1, -1, 106, 1, 115, 1, 124, 1, -1, -1,-123, 1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1,-114, 1, -1, -1, -1, -1, -1, -1,-108, 1,-105, 1, -94, 1, -91, 1, -89, 1, -86, 1, 1, 2, -1, -1, + 4, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, 10, 2, -1, -1, 77, 2, -1, -1, + -1, -1, 81, 2, 87, 2, -1, -1, -1, -1, 93, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 97, 2, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 102, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 104, 2, 110, 2, 116, 2, 122, 2,-128, 2,-122, 2,-116, 2,-110, 2,-104, 2, -98, 2, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -92, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -87, 2, +-76, 2, -71, 2, -65, 2, -61, 2, -52, 2, -48, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, 3, -1, -1, -1, -1, + -1, -1, 37, 3, 75, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 113, 3, 119, 3, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, +100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, + 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 27, + 91, 63, 49, 99, 0, 8, 0, 27, 91, 63, 50, 53, 104, 27, 91, 63, 48, 99, 0, 27, 91, 67, 0, 27, 91, 65, 0, 27, 91, 63, 50, 53, +104, 27, 91, 63, 56, 99, 0, 27, 91, 80, 0, 27, 91, 77, 0, 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 50, 109, 0, + 27, 91, 52, 104, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, 37, 112, 49, 37, 100, 88, 0, 15, 0, 27, + 91, 109, 15, 0, 27, 91, 52, 108, 0, 27, 91, 50, 55, 109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, 104, 36, 60, 50, 48, 48, 47, + 62, 27, 91, 63, 53, 108, 0, 27, 91, 64, 0, 27, 91, 76, 0, 127, 0, 27, 91, 51, 126, 0, 27, 91, 66, 0, 27, 91, 91, 65, 0, 27, + 91, 50, 49, 126, 0, 27, 91, 91, 66, 0, 27, 91, 91, 67, 0, 27, 91, 91, 68, 0, 27, 91, 91, 69, 0, 27, 91, 49, 55, 126, 0, 27, + 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 91, 49, 126, 0, 27, 91, 50, 126, 0, 27, 91, 68, 0, 27, + 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 91, 67, 0, 27, 91, 65, 0, 13, 10, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, +112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 76, + 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 99, 27, 93, + 82, 0, 27, 56, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, 27, 91, 48, 59, 49, 48, 37, 63, + 37, 112, 49, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 51, 37, 116, 59, 55, 37, 59, 37, + 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 37, 63, 37, 112, 53, 37, 116, 59, 50, 37, 59, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, +109, 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, 9, 0, 27, 91, 71, 0, 43, 43, 44, 44, 45, 45, 46, 46, + 48, 48, 95, 95, 96, 96, 97, 97, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, +114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 99, 126, 126, 0, 27, 91, 90, 0, 27, + 91, 63, 55, 104, 0, 27, 91, 63, 55, 108, 0, 27, 41, 48, 0, 27, 91, 52, 126, 0, 26, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, +126, 0, 27, 91, 50, 53, 126, 0, 27, 91, 50, 54, 126, 0, 27, 91, 50, 56, 126, 0, 27, 91, 50, 57, 126, 0, 27, 91, 51, 49, 126, 0, + 27, 91, 51, 50, 126, 0, 27, 91, 51, 51, 126, 0, 27, 91, 51, 52, 126, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, + 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 54, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 93, 82, 0, 27, 93, + 80, 37, 112, 49, 37, 120, 37, 112, 50, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 48, 50, 120, 37, 112, + 51, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 48, 50, 120, 37, 112, 52, 37, 123, 50, 53, 53, 125, 37, + 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 48, 50, 120, 0, 27, 91, 77, 0, 27, 91, 51, 37, 112, 49, 37, 123, 56, 125, 37, 109, 37, +100, 37, 63, 37, 112, 49, 37, 123, 55, 125, 37, 62, 37, 116, 59, 49, 37, 101, 59, 50, 49, 37, 59, 109, 0, 27, 91, 52, 37, 112, 49, 37, +123, 56, 125, 37, 109, 37, 100, 37, 63, 37, 112, 49, 37, 123, 55, 125, 37, 62, 37, 116, 59, 53, 37, 101, 59, 50, 53, 37, 59, 109, 0, 27, + 91, 49, 49, 109, 0, 27, 91, 49, 48, 109, 0 +}; +// Taken from Dickey ncurses terminfo.src dated 2017-04-22. +static const char putty_256colour_terminfo[] = { + 26, 1, 48, 0, 29, 0, 16, 0, 125, 1,-106, 4, 112, 117, 116, 116, 121, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 80, 117, 84, 84, 89, + 32, 48, 46, 53, 56, 32, 119, 105, 116, 104, 32, 120, 116, 101, 114, 109, 32, 50, 53, 54, 45, 99, 111, 108, 111, 114, 115, 0, 1, 1, 0, 0, + 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, -1, 8, 0, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, 22, 0, 0, 0, 4, 0, 6, 0, + 8, 0, 25, 0, 30, 0, 37, 0, 41, 0, 45, 0, -1, -1, 56, 0, 73, 0, 76, 0, 80, 0, 87, 0, -1, -1, 89, 0, 96, 0, -1, -1, + 100, 0, -1, -1, 103, 0, 107, 0, 111, 0, -1, -1, 117, 0, 119, 0, 124, 0,-127, 0, -1, -1, -1, -1,-120, 0, -1, -1, -1, -1,-115, 0, +-110, 0,-105, 0,-100, 0, -91, 0, -89, 0, -84, 0, -1, -1, -73, 0, -68, 0, -62, 0, -56, 0, -1, -1, -38, 0, -1, -1, -36, 0, -1, -1, + -1, -1, -1, -1, -2, 0, -1, -1, 2, 1, -1, -1, -1, -1, -1, -1, 4, 1, -1, -1, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, 13, 1, + 19, 1, 25, 1, 31, 1, 37, 1, 43, 1, 49, 1, 55, 1, 61, 1, 67, 1, 73, 1, 78, 1, -1, -1, 83, 1, -1, -1, 87, 1, 92, 1, + 97, 1, 101, 1, 105, 1, -1, -1, 109, 1, 113, 1, 121, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1,-127, 1, -1, -1,-124, 1,-115, 1,-106, 1, -1, -1, -97, 1, -88, 1, -79, 1, -70, 1, -61, 1, -52, 1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -43, 1, -1, -1, -1, -1, -10, 1, -7, 1, 4, 2, 7, 2, 9, 2, + 12, 2, 84, 2, -1, -1, 87, 2, 89, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 94, 2, -1, -1, -1, -1, -1, -1, -1, -1, 98, 2, + -1, -1,-107, 2, -1, -1, -1, -1,-103, 2, -97, 2, -1, -1, -1, -1, -91, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -84, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -79, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -77, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -73, 2, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -69, 2, -63, 2, -57, 2, -51, 2, -45, 2, -39, 2, -33, 2, -27, 2, -21, 2, -15, 2, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -4, 2, 7, 3, 12, 3, 18, 3, 22, 3, 31, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 35, 3, -1, -1, -1, -1, -1, -1, 39, 3, 102, 3, -1, -1, -1, -1, -1, -1, -90, 3, -84, 3, -78, 3, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -72, 3,-118, 4,-112, 4, 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, 37, 105, + 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, 74, + 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 27, 68, 0, + 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, 27, 77, 0, 27, 91, 80, 0, 27, + 91, 77, 0, 27, 93, 48, 59, 7, 0, 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 63, 52, 55, 104, 0, 27, 91, 52, 104, + 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, 37, 112, 49, 37, 100, 88, 0, 15, 0, 27, 91, 109, 15, 0, + 27, 91, 50, 74, 27, 91, 63, 52, 55, 108, 0, 27, 91, 52, 108, 0, 27, 91, 50, 55, 109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, + 104, 36, 60, 49, 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 7, 0, 27, 55, 27, 91, 114, 27, 91, 109, 27, 91, 63, 55, 104, 27, 91, 63, + 49, 59, 52, 59, 54, 108, 27, 91, 52, 108, 27, 56, 27, 62, 27, 93, 82, 0, 27, 91, 76, 0, 127, 0, 27, 91, 51, 126, 0, 27, 79, 66, + 0, 27, 91, 49, 49, 126, 0, 27, 91, 50, 49, 126, 0, 27, 91, 49, 50, 126, 0, 27, 91, 49, 51, 126, 0, 27, 91, 49, 52, 126, 0, 27, + 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 91, 49, + 126, 0, 27, 91, 50, 126, 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 79, 67, 0, 27, 91, 66, 0, 27, 91, 65, + 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, 63, 49, 104, 27, 61, 0, 13, 10, 0, 27, 91, 37, 112, 49, 37, 100, 80, + 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 83, 0, 27, 91, 37, 112, + 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 84, 0, + 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 60, 27, 91, 34, 112, 27, 91, 53, 48, 59, 54, 34, 112, 27, 99, 27, 91, 63, 51, 108, 27, 93, + 82, 27, 91, 63, 49, 48, 48, 48, 108, 0, 27, 56, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, + 27, 91, 48, 37, 63, 37, 112, 49, 37, 112, 54, 37, 124, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, + 37, 112, 49, 37, 112, 51, 37, 124, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 109, 37, 63, 37, 112, 57, 37, + 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, 9, 0, 27, 93, 48, 59, 0, 27, 91, 71, 0, 96, 96, 97, 97, 102, 102, 103, 103, 106, 106, + 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, + 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 91, 63, 55, 104, 0, 27, 91, 63, 55, 108, 0, 27, 40, 66, 27, 41, 48, 0, + 27, 91, 52, 126, 0, 26, 0, 27, 91, 68, 0, 27, 91, 67, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 50, 53, 126, + 0, 27, 91, 50, 54, 126, 0, 27, 91, 50, 56, 126, 0, 27, 91, 50, 57, 126, 0, 27, 91, 51, 49, 126, 0, 27, 91, 51, 50, 126, 0, 27, + 91, 51, 51, 126, 0, 27, 91, 51, 52, 126, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, + 27, 91, 63, 54, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 93, 82, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, + 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, + 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, + 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, + 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 49, 48, 109, 0, + 27, 91, 49, 49, 109, 0, 27, 91, 49, 50, 109, 0, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30,-105,-104, + 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 123, 49, 48, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30,-105,-103, 27, 37, 37, 64, 37, 101, 37, + 112, 49, 37, 123, 49, 50, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30,-103,-128, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 123, 49, 51, 125, + 37, 61, 37, 116, 27, 37, 37, 71, -30,-103, -86, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 123, 49, 52, 125, 37, 61, 37, 116, 27, 37, 37, + 71, -30,-103, -85, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 123, 49, 53, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30,-104, -68, 27, 37, 37, + 64, 37, 101, 37, 112, 49, 37, 123, 50, 55, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30,-122,-112, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, + 123, 49, 53, 53, 125, 37, 61, 37, 116, 27, 37, 37, 71, -32,-126, -94, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 99, 37, 59, 0, 27, 91, + 49, 49, 109, 0, 27, 91, 49, 48, 109, 0 +}; +// Taken from Dickey ncurses terminfo.src dated 2017-04-22. +static const char interix_8colour_terminfo[] = { + 26, 1, 82, 0, 15, 0, 16, 0, 105, 1, 123, 2, 105, 110, 116, 101, 114, 105, 120, 124, 111, 112, 101, 110, 110, 116, 124, 111, 112, 101, 110, 110, + 116, 45, 50, 53, 124, 110, 116, 99, 111, 110, 115, 111, 108, 101, 124, 110, 116, 99, 111, 110, 115, 111, 108, 101, 45, 50, 53, 124, 79, 112, 101, 110, + 78, 84, 45, 116, 101, 114, 109, 32, 99, 111, 109, 112, 97, 116, 105, 98, 108, 101, 32, 119, 105, 116, 104, 32, 99, 111, 108, 111, 114, 0, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 80, 0, -1, -1, 25, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 8, 0, 64, 0, 3, 0, 0, 0, 4, 0, -1, -1, -1, -1, -1, -1, 6, 0, 11, 0, 15, 0, -1, -1, + -1, -1, 19, 0, 36, 0, 38, 0, -1, -1, 42, 0, -1, -1, -1, -1, 46, 0, 50, 0, 54, 0, -1, -1, -1, -1, 58, 0, -1, -1, -1, -1, + -1, -1, -1, -1, 62, 0, 67, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 75, 0, 80, 0, 85, 0, -1, -1, -1, -1, 90, 0, 95, 0, + -1, -1, -1, -1, 107, 0, 111, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 115, 0, -1, -1, 119, 0, -1, -1, + -1, -1, -1, -1, 121, 0, -1, -1, 125, 0, -1, -1, -1, -1, -1, -1,-127, 0,-123, 0,-119, 0,-115, 0,-111, 0,-107, 0,-103, 0, -99, 0, + -95, 0, -91, 0, -87, 0, -1, -1, -83, 0, -1, -1, -79, 0, -75, 0, -71, 0, -67, 0, -63, 0, -1, -1, -1, -1, -1, -1, -59, 0, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -55, 0, -1, -1, + -1, -1, -52, 0, -43, 0, -1, -1, -34, 0, -25, 0, -16, 0, -7, 0, 2, 1, 11, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 20, 1, -1, -1, -1, -1, -1, -1, 23, 1, -1, -1, 27, 1, 31, 1, 35, 1, -1, -1, -1, -1, -1, -1, 39, 1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, 1, -1, -1, 104, 1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 108, 1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 112, 1, + 116, 1, 120, 1, 124, 1,-128, 1,-124, 1,-120, 1,-116, 1,-112, 1,-108, 1,-104, 1,-100, 1, -96, 1, -92, 1, -88, 1, -84, 1, -80, 1, + -76, 1, -72, 1, -68, 1, -64, 1, -60, 1, -56, 1, -52, 1, -48, 1, -44, 1, -40, 1, -36, 1, -32, 1, -28, 1, -24, 1, -20, 1, -16, 1, + -12, 1, -8, 1, -4, 1, 0, 2, 4, 2, 8, 2, 12, 2, 16, 2, 20, 2, 24, 2, 28, 2, 32, 2, 36, 2, 40, 2, 44, 2, 48, 2, + 52, 2, 56, 2, 60, 2, 64, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 68, 2, -1, -1, -1, -1, -1, -1, -1, -1, 72, 2, 88, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, 2, 113, 2, + 27, 91, 90, 0, 7, 0, 27, 91, 50, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, + 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 68, 0, 27, 91, 67, 0, 27, 91, 85, 0, 27, 91, 65, 0, 27, 91, 77, 0, 27, 91, + 49, 109, 0, 27, 91, 115, 27, 91, 49, 98, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, 48, 109, 0, 27, + 91, 50, 98, 27, 91, 117, 13, 27, 91, 75, 0, 27, 91, 109, 0, 27, 91, 109, 0, 27, 91, 76, 0, 8, 0, 27, 91, 77, 0, 27, 91, 66, + 0, 27, 70, 65, 0, 27, 70, 49, 0, 27, 70, 65, 0, 27, 70, 50, 0, 27, 70, 51, 0, 27, 70, 52, 0, 27, 70, 53, 0, 27, 70, 54, + 0, 27, 70, 55, 0, 27, 70, 56, 0, 27, 70, 57, 0, 27, 91, 76, 0, 27, 91, 68, 0, 27, 91, 85, 0, 27, 91, 84, 0, 27, 91, 83, + 0, 27, 91, 67, 0, 27, 91, 65, 0, 13, 10, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, + 37, 112, 49, 37, 100, 83, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, + 67, 0, 27, 91, 37, 112, 49, 37, 100, 84, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 99, 0, 27, 91, 117, 0, 27, 91, 115, 0, 27, + 91, 83, 0, 27, 91, 84, 0, 9, 0, 43, 16, 44, 17, 45, 24, 46, 25, 48, -37, 96, 4, 97, -79, 102, -8, 103, -15, 104, -80, 106, -39, 107, + -65, 108, -38, 109, -64, 110, -59, 111, 126, 112, -60, 113, -60, 114, -60, 115, 95, 116, -61, 117, -76, 118, -63, 119, -62, 120, -77, 121, -13, 122, -14, 123, + -29, 124, -40, 125,-100, 126, -2, 0, 27, 91, 90, 0, 27, 91, 85, 0, 27, 70, 66, 0, 27, 70, 67, 0, 27, 70, 68, 0, 27, 70, 69, 0, + 27, 70, 70, 0, 27, 70, 71, 0, 27, 70, 72, 0, 27, 70, 73, 0, 27, 70, 74, 0, 27, 70, 75, 0, 27, 70, 76, 0, 27, 70, 77, 0, + 27, 70, 78, 0, 27, 70, 79, 0, 27, 70, 80, 0, 27, 70, 81, 0, 27, 70, 82, 0, 27, 70, 83, 0, 27, 70, 84, 0, 27, 70, 85, 0, + 27, 70, 86, 0, 27, 70, 87, 0, 27, 70, 88, 0, 27, 70, 89, 0, 27, 70, 90, 0, 27, 70, 97, 0, 27, 70, 98, 0, 27, 70, 99, 0, + 27, 70, 100, 0, 27, 70, 101, 0, 27, 70, 102, 0, 27, 70, 103, 0, 27, 70, 104, 0, 27, 70, 105, 0, 27, 70, 106, 0, 27, 70, 107, 0, + 27, 70, 109, 0, 27, 70, 110, 0, 27, 70, 111, 0, 27, 70, 112, 0, 27, 70, 113, 0, 27, 70, 114, 0, 27, 70, 115, 0, 27, 70, 116, 0, + 27, 70, 117, 0, 27, 70, 118, 0, 27, 70, 119, 0, 27, 70, 120, 0, 27, 70, 121, 0, 27, 70, 122, 0, 27, 70, 43, 0, 27, 70, 45, 0, + 27, 70, 12, 0, 27, 91, 109, 0, 27, 91, 37, 112, 49, 37, 123, 51, 48, 125, 37, 43, 37, 100, 109, 0, 27, 91, 37, 112, 49, 37, 39, 40, + 39, 37, 43, 37, 100, 109, 0, 27, 91, 51, 37, 112, 49, 37, 100, 109, 0, 27, 91, 52, 37, 112, 49, 37, 100, 109, 0 +}; +// Taken from Dickey ncurses terminfo.src dated 2017-04-22. +static const char ansi_terminfo[] = { + 26, 1, 40, 0, 23, 0, 16, 0, 125, 1, 68, 2, 97, 110, 115, 105, 124, 97, 110, 115, 105, 47, 112, 99, 45, 116, 101, 114, 109, 32, 99, 111, + 109, 112, 97, 116, 105, 98, 108, 101, 32, 119, 105, 116, 104, 32, 99, 111, 108, 111, 114, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 8, 0, 64, 0, 3, 0, 0, 0, 4, 0, 6, 0, -1, -1, 8, 0, 13, 0, 20, 0, 24, 0, 28, 0, -1, -1, + 39, 0, 56, 0, 60, 0, -1, -1, 64, 0, -1, -1, -1, -1, 68, 0, -1, -1, 72, 0, -1, -1, 76, 0, 80, 0, -1, -1, -1, -1, 84, 0, + 90, 0, 95, 0, -1, -1, -1, -1, -1, -1, -1, -1, 100, 0, -1, -1, 105, 0, 110, 0, 115, 0, 120, 0,-127, 0,-121, 0, -1, -1, -1, -1, + -1, -1,-113, 0,-109, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,-105, 0, -1, -1,-101, 0, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -99, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -95, 0, -91, 0, -1, -1, -87, 0, -1, -1, -1, -1, -1, -1, -83, 0, -1, -1, -1, -1, -1, -1, -79, 0, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -75, 0, -1, -1, -70, 0, + -61, 0, -52, 0, -43, 0, -34, 0, -25, 0, -16, 0, -7, 0, 2, 1, 11, 1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 1, 25, 1, 30, 1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 1, -1, -1, 61, 1, -1, -1, 63, 1,-107, 1, -1, -1,-104, 1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,-100, 1, -1, -1, -37, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -33, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -28, 1, -17, 1, -12, 1, 7, 2, 11, 2, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 2, 30, 2, -1, -1, + -1, -1, -1, -1, 40, 2, 44, 2, 48, 2, 52, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 56, 2, 62, 2, 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, + 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 27, 91, + 66, 0, 27, 91, 72, 0, 27, 91, 68, 0, 27, 91, 67, 0, 27, 91, 65, 0, 27, 91, 80, 0, 27, 91, 77, 0, 27, 91, 49, 49, 109, 0, + 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 56, 109, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, + 37, 112, 49, 37, 100, 88, 0, 27, 91, 49, 48, 109, 0, 27, 91, 48, 59, 49, 48, 109, 0, 27, 91, 109, 0, 27, 91, 109, 0, 27, 91, 76, + 0, 8, 0, 27, 91, 66, 0, 27, 91, 72, 0, 27, 91, 76, 0, 27, 91, 68, 0, 27, 91, 67, 0, 27, 91, 65, 0, 13, 27, 91, 83, 0, + 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, + 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 83, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, + 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 84, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 91, 52, 105, 0, 27, + 91, 53, 105, 0, 37, 112, 49, 37, 99, 27, 91, 37, 112, 50, 37, 123, 49, 125, 37, 45, 37, 100, 98, 0, 27, 91, 37, 105, 37, 112, 49, 37, + 100, 100, 0, 10, 0, 27, 91, 48, 59, 49, 48, 37, 63, 37, 112, 49, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, + 59, 37, 63, 37, 112, 51, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 37, 63, 37, 112, 54, 37, 116, 59, 49, + 37, 59, 37, 63, 37, 112, 55, 37, 116, 59, 56, 37, 59, 37, 63, 37, 112, 57, 37, 116, 59, 49, 49, 37, 59, 109, 0, 27, 72, 0, 27, 91, + 73, 0, 43, 16, 44, 17, 45, 24, 46, 25, 48, -37, 96, 4, 97, -79, 102, -8, 103, -15, 104, -80, 106, -39, 107, -65, 108, -38, 109, -64, 110, -59, + 111, 126, 112, -60, 113, -60, 114, -60, 115, 95, 116, -61, 117, -76, 118, -63, 119, -62, 120, -77, 121, -13, 122, -14, 123, -29, 124, -40, 125,-100, 126, -2, + 0, 27, 91, 90, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 37, 91, 59, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 93, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 91, 51, 37, 112, 49, + 37, 100, 109, 0, 27, 91, 52, 37, 112, 49, 37, 100, 109, 0, 27, 40, 66, 0, 27, 41, 66, 0, 27, 42, 66, 0, 27, 43, 66, 0, 27, 91, + 49, 49, 109, 0, 27, 91, 49, 48, 109, 0 +}; + +/// Load one of the built-in terminfo entries when unibilium has failed to +/// load a terminfo record from an external database, as it does on termcap- +/// -only systems. We do not do any fancy recognition of xterm pretenders +/// here. An external terminfo database would not do that, and we want to +/// behave as much like an external terminfo database as possible. +static unibi_term *load_builtin_terminfo(const char * term) { - if (STARTS_WITH(term, "rxvt")) { - return kTermRxvt; + if (term && STARTS_WITH(term, "xterm")) { + return unibi_from_mem(xterm_8colour_terminfo, sizeof xterm_8colour_terminfo); + } else if (term && STARTS_WITH(term, "screen")) { + return unibi_from_mem(screen_256colour_terminfo, sizeof screen_256colour_terminfo); + } else if (term && STARTS_WITH(term, "tmux")) { + return unibi_from_mem(tmux_256colour_terminfo, sizeof tmux_256colour_terminfo); + } else if (term && STARTS_WITH(term, "rxvt")) { + return unibi_from_mem(rxvt_256colour_terminfo, sizeof rxvt_256colour_terminfo); + } else if (term && STARTS_WITH(term, "putty")) { + return unibi_from_mem(putty_256colour_terminfo, sizeof putty_256colour_terminfo); + } else if (term && STARTS_WITH(term, "linux")) { + return unibi_from_mem(linux_16colour_terminfo, sizeof linux_16colour_terminfo); + } else if (term && STARTS_WITH(term, "interix")) { + return unibi_from_mem(interix_8colour_terminfo, sizeof interix_8colour_terminfo); + } else if (term && (STARTS_WITH(term, "iterm") || STARTS_WITH(term, "iTerm"))) { + return unibi_from_mem(iterm_16colour_terminfo, sizeof iterm_16colour_terminfo); + } else { + return unibi_from_mem(ansi_terminfo, sizeof ansi_terminfo); } - if (os_getenv("KONSOLE_PROFILE_NAME") || os_getenv("KONSOLE_DBUS_SESSION")) { - return kTermKonsole; - } - const char *termprg = os_getenv("TERM_PROGRAM"); - if (termprg && strstr(termprg, "iTerm.app")) { - return kTermiTerm; - } - if (colorterm && strstr(colorterm, "gnome-terminal")) { - return kTermGnome; - } - if (STARTS_WITH(term, "xterm")) { - return kTermXTerm; - } - if (STARTS_WITH(term, "dtterm")) { - return kTermDTTerm; - } - if (STARTS_WITH(term, "teraterm")) { - return kTermTeraTerm; - } - if (STARTS_WITH(term, "putty")) { - return kTermPuTTY; - } - return kTermUnknown; } -/// This has three tasks. -/// 1. On termcap-only systems, it reads $TERM and fills in all of the things -/// that unibilium (which uses terminfo) will not have. -/// 2. It fills in extra capabilities that unibilium and terminfo do not know -/// anything about, such as bracketed paste control. Some of these are -/// (wrongly) assumed to be universal. Others are dependent from $TERM . -/// 3. It fills in capabilities that might have been missing from the termcap -/// entry that we nonetheless need, which are also worked out from $TERM . -static void fix_terminfo(TUIData *data) +/// Several entries in terminfo are known to be deficient or outright wrong, +/// unfortunately; and several terminal emulators falsely announce incorrect +/// terminal types. So patch the terminfo records after loading from an +/// external or a built-in database. In an ideal world, the real terminfo data +/// would be correct and complete, and this function would be almost empty. +static void patch_terminfo_bugs(unibi_term *ut, const char *term, + const char *colorterm, long vte_version, bool konsole, bool iterm) { - unibi_term *ut = data->ut; - is_tmux = os_getenv("TMUX") != NULL; + bool xterm = term && STARTS_WITH(term, "xterm"); + bool mate = colorterm && strstr(colorterm, "mate-terminal"); + bool gnome = colorterm && strstr(colorterm, "gnome-terminal"); + bool linux = term && STARTS_WITH(term, "linux"); + bool rxvt = term && STARTS_WITH(term, "rxvt"); - const char *term = os_getenv("TERM"); - const char *colorterm = os_getenv("COLORTERM"); - if (!term) { - goto end; - } - data->term = detect_term(term, colorterm); - - if (data->term == kTermRxvt) { - unibi_set_if_empty(ut, unibi_flash_screen, "\x1b[?5h$<20/>\x1b[?5l"); - unibi_set_if_empty(ut, unibi_enter_italics_mode, "\x1b[3m"); - unibi_set_if_empty(ut, unibi_to_status_line, "\x1b]2"); - } else if (data->term == kTermXTerm) { - unibi_set_if_empty(ut, unibi_to_status_line, "\x1b]0;"); - } else if (STARTS_WITH(term, "screen") || STARTS_WITH(term, "tmux")) { - unibi_set_if_empty(ut, unibi_to_status_line, "\x1b_"); - unibi_set_if_empty(ut, unibi_from_status_line, "\x1b\\"); - } - - if (data->term == kTermXTerm || data->term == kTermRxvt) { - const char *normal = unibi_get_str(ut, unibi_cursor_normal); - if (!normal) { - unibi_set_str(ut, unibi_cursor_normal, "\x1b[?25h"); - } else if (STARTS_WITH(normal, "\x1b[?12l")) { + const char *fix_normal = unibi_get_str(ut, unibi_cursor_normal); + if (fix_normal) { + if (STARTS_WITH(fix_normal, "\x1b[?12l")) { // terminfo typically includes DECRST 12 as part of setting up the normal // cursor, which interferes with the user's control via // NVIM_TUI_ENABLE_CURSOR_SHAPE. When DECRST 12 is present, skip over // it, but honor the rest of the TI setting. - unibi_set_str(ut, unibi_cursor_normal, normal + strlen("\x1b[?12l")); + fix_normal += strlen("\x1b[?12l"); + unibi_set_str(ut, unibi_cursor_normal, fix_normal); } - unibi_set_if_empty(ut, unibi_cursor_invisible, "\x1b[?25l"); - unibi_set_if_empty(ut, unibi_flash_screen, "\x1b[?5h$<100/>\x1b[?5l"); - unibi_set_if_empty(ut, unibi_exit_attribute_mode, "\x1b(B\x1b[m"); + } + + if (xterm) { + // Termit, LXTerminal, GTKTerm2, GNOME Terminal, MATE Terminal, roxterm, + // and EvilVTE falsely claim to be xterm and do not support important xterm + // control sequences that we use. In an ideal world, these would have + // their own terminal types and terminfo entries, like PuTTY does, and not + // claim to be xterm. Or they would mimic xterm properly enough to be + // treatable as xterm. +#if 0 // We don't need to identify this specifically, for now. + bool roxterm = !!os_getenv("ROXTERM_ID"); +#endif + bool true_xterm = !!os_getenv("XTERM_VERSION"); + unibi_set_if_empty(ut, unibi_to_status_line, "\x1b]0;"); unibi_set_if_empty(ut, unibi_from_status_line, "\x07"); unibi_set_if_empty(ut, unibi_set_tb_margin, "\x1b[%i%p1%d;%p2%dr"); - unibi_set_if_empty(ut, unibi_set_lr_margin, "\x1b[%i%p1%d;%p2%ds"); - unibi_set_if_empty(ut, unibi_set_left_margin_parm, "\x1b[%i%p1%ds"); - unibi_set_if_empty(ut, unibi_set_right_margin_parm, "\x1b[%i;%p2%ds"); + if (true_xterm) { + unibi_set_if_empty(ut, unibi_set_lr_margin, "\x1b[%i%p1%d;%p2%ds"); + unibi_set_if_empty(ut, unibi_set_left_margin_parm, "\x1b[%i%p1%ds"); + unibi_set_if_empty(ut, unibi_set_right_margin_parm, "\x1b[%i;%p2%ds"); + } + } else if (rxvt) { + unibi_set_if_empty(ut, unibi_enter_italics_mode, "\x1b[3m"); + unibi_set_if_empty(ut, unibi_to_status_line, "\x1b]2"); + unibi_set_if_empty(ut, unibi_from_status_line, "\x07"); + unibi_set_if_empty(ut, unibi_set_tb_margin, "\x1b[%i%p1%d;%p2%dr"); + } else if (term && STARTS_WITH(term, "screen")) { + unibi_set_if_empty(ut, unibi_to_status_line, "\x1b_"); + unibi_set_if_empty(ut, unibi_from_status_line, "\x1b\\"); + } else if (term && STARTS_WITH(term, "tmux")) { + unibi_set_if_empty(ut, unibi_to_status_line, "\x1b_"); + unibi_set_if_empty(ut, unibi_from_status_line, "\x1b\\"); + } else if (linux) { + // No deviations from the vanilla terminfo. + } else if (term && STARTS_WITH(term, "putty")) { + // No deviations from the vanilla terminfo. + } else if (term && (STARTS_WITH(term, "iterm") || STARTS_WITH(term, "iTerm"))) { + // No deviations from the vanilla terminfo. } - if (data->term == kTermXTerm || data->term == kTermRxvt - || data->term == kTermPuTTY) { - unibi_set_if_empty(ut, unibi_change_scroll_region, "\x1b[%i%p1%d;%p2%dr"); - unibi_set_if_empty(ut, unibi_clear_screen, "\x1b[H\x1b[2J"); - unibi_set_bool(ut, unibi_back_color_erase, true); - } - - data->unibi_ext.enable_lr_margin = (int)unibi_add_ext_str(ut, NULL, - "\x1b[?69h"); - data->unibi_ext.disable_lr_margin = (int)unibi_add_ext_str(ut, NULL, - "\x1b[?69l"); - - data->unibi_ext.enable_bracketed_paste = (int)unibi_add_ext_str(ut, NULL, - "\x1b[?2004h"); - data->unibi_ext.disable_bracketed_paste = (int)unibi_add_ext_str(ut, NULL, - "\x1b[?2004l"); - - data->unibi_ext.enable_focus_reporting = (int)unibi_add_ext_str(ut, NULL, - "\x1b[?1004h"); - data->unibi_ext.disable_focus_reporting = (int)unibi_add_ext_str(ut, NULL, - "\x1b[?1004l"); #define XTERM_SETAF_256 \ "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m" #define XTERM_SETAB_256 \ "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m" - - if ((colorterm && strstr(colorterm, "256")) - || STARTS_WITH(term, "linux") - || strstr(term, "256") - || strstr(term, "xterm")) { - // Linux 4.8+ supports 256-color SGR, but terminfo has 8-color setaf/setab. - // Assume TERM=~xterm|linux or COLORTERM=~256 supports 256 colors. - unibi_set_num(ut, unibi_max_colors, 256); - unibi_set_str(ut, unibi_set_a_foreground, XTERM_SETAF_256); - unibi_set_str(ut, unibi_set_a_background, XTERM_SETAB_256); - } - - // Only define this capability for terminal types that we know understand it. - if (data->term == kTermDTTerm // originated this extension - || data->term == kTermXTerm // per xterm ctlseqs doco - || data->term == kTermKonsole // per commentary in VT102Emulation.cpp - || data->term == kTermTeraTerm // per TeraTerm "Supported Control Functions" doco - || data->term == kTermRxvt) { // per command.C - data->unibi_ext.resize_screen = (int)unibi_add_ext_str(ut, NULL, - "\x1b[8;%p1%d;%p2%dt"); - } - - if (data->term == kTermXTerm || data->term == kTermRxvt - || data->term == kTermPuTTY) { - data->unibi_ext.reset_scroll_region = (int)unibi_add_ext_str(ut, NULL, - "\x1b[r"); - } - -end: - #define XTERM_SETAF_16 \ "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e39%;m" #define XTERM_SETAB_16 \ "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e39%;m" - // Fill some empty slots with common terminal strings - if (data->term == kTermiTerm) { + // Terminals where there is actually 256-colour SGR support despite what + // the terminfo record may say. + if (unibi_get_num(ut, unibi_max_colors) < 256) { + // See http://fedoraproject.org/wiki/Features/256_Color_Terminals for + // more on this. + if (konsole || mate || xterm || gnome || rxvt + || linux // Linux 4.8+ supports 256-colour SGR. + || (colorterm && strstr(colorterm, "256")) + || (term && strstr(term, "256")) + ) { + unibi_set_num(ut, unibi_max_colors, 256); + unibi_set_str(ut, unibi_set_a_foreground, XTERM_SETAF_256); + unibi_set_str(ut, unibi_set_a_background, XTERM_SETAB_256); + } + } + // Terminals where there is actually 16-colour SGR support despite what + // the terminfo record may say. + if (unibi_get_num(ut, unibi_max_colors) < 16) { + if (colorterm) { + unibi_set_num(ut, unibi_max_colors, 16); + unibi_set_if_empty(ut, unibi_set_a_foreground, XTERM_SETAF_16); + unibi_set_if_empty(ut, unibi_set_a_background, XTERM_SETAB_16); + } + } +} + +/// This adds stuff that is not in standard terminfo as extended unibilium +/// capabilities. +static void augment_terminfo(TUIData *data, const char *term, + const char *colorterm, long vte_version, bool konsole, bool iterm) +{ + unibi_term *ut = data->ut; + bool putty = term && STARTS_WITH(term, "putty"); + bool xterm = term && STARTS_WITH(term, "xterm"); + bool dtterm = term && STARTS_WITH(term, "dtterm"); + bool teraterm = term && STARTS_WITH(term, "teraterm"); + bool rxvt = term && STARTS_WITH(term, "rxvt"); + bool linux = term && STARTS_WITH(term, "linux"); + bool tmux_wrap = !!os_getenv("TMUX"); + bool truecolor = colorterm + && (STRCMP(colorterm, "truecolor") || STRCMP(colorterm, "24bit")); + + // Only define this capability for terminal types that we know understand it. + if (dtterm // originated this extension + || xterm // per xterm ctlseqs doco + || konsole // per commentary in VT102Emulation.cpp + || teraterm // per TeraTerm "Supported Control Functions" doco + || rxvt) { // per command.C + data->unibi_ext.resize_screen = (int)unibi_add_ext_str(ut, NULL, + "\x1b[8;%p1%d;%p2%dt"); + } + if (putty || xterm || rxvt) { + data->unibi_ext.reset_scroll_region = (int)unibi_add_ext_str(ut, NULL, + "\x1b[r"); + } + // See https://gist.github.com/XVilka/8346728 for more about this. + if (putty || xterm || rxvt || linux || konsole || iterm || truecolor) { + data->unibi_ext.set_rgb_foreground = (int)unibi_add_ext_str(ut, NULL, + "\x1b[38;2;%p1%d;%p2%d;%p3%dm"); + data->unibi_ext.set_rgb_background = (int)unibi_add_ext_str(ut, NULL, + "\x1b[48;2;%p1%d;%p2%d;%p3%dm"); + } + if (iterm) { data->unibi_ext.set_cursor_color = (int)unibi_add_ext_str( - ut, NULL, TMUX_WRAP("\033]Pl%p1%06x\033\\")); - } else { + ut, NULL, TMUX_WRAP(tmux_wrap, "\033]Pl%p1%06x\033\\")); + } else if (xterm) { data->unibi_ext.set_cursor_color = (int)unibi_add_ext_str( ut, NULL, "\033]12;#%p1%06x\007"); } + if (konsole) { + // Konsole uses a proprietary escape code to set the cursor shape + // and does not support DECSCUSR. + data->unibi_ext.konsole_cursor_shape = (int)unibi_add_ext_str(ut, NULL, + TMUX_WRAP(tmux_wrap, "\x1b]50;CursorShape=%p1%d;BlinkingCursorEnabled=%p2%d\x07")); + } else if (0 == vte_version || vte_version >= 3900) { + // Assume that the terminal supports DECSCUSR unless it is an + // old VTE based terminal. This should not get wrapped for tmux, + // which will handle it via its Ss/Se terminfo extension - usually + // according to its terminal-overrides. + data->unibi_ext.dec_cursor_shape = (int)unibi_add_ext_str(ut, NULL, + "\x1b[%p1%d q"); + } + + /// Terminals generally ignore private modes that they do not recognize, + /// and there is no known ambiguity with these modes from terminal type to + /// terminal type, so we can afford to just set these unconditionally. + data->unibi_ext.enable_lr_margin = (int)unibi_add_ext_str(ut, NULL, + "\x1b[?69h"); + data->unibi_ext.disable_lr_margin = (int)unibi_add_ext_str(ut, NULL, + "\x1b[?69l"); + data->unibi_ext.enable_bracketed_paste = (int)unibi_add_ext_str(ut, NULL, + "\x1b[?2004h"); + data->unibi_ext.disable_bracketed_paste = (int)unibi_add_ext_str(ut, NULL, + "\x1b[?2004l"); + data->unibi_ext.enable_focus_reporting = (int)unibi_add_ext_str(ut, NULL, + "\x1b[?1004h"); + data->unibi_ext.disable_focus_reporting = (int)unibi_add_ext_str(ut, NULL, + "\x1b[?1004l"); data->unibi_ext.enable_mouse = (int)unibi_add_ext_str(ut, NULL, "\x1b[?1002h\x1b[?1006h"); data->unibi_ext.disable_mouse = (int)unibi_add_ext_str(ut, NULL, "\x1b[?1002l\x1b[?1006l"); - data->unibi_ext.set_rgb_foreground = (int)unibi_add_ext_str(ut, NULL, - "\x1b[38;2;%p1%d;%p2%d;%p3%dm"); - data->unibi_ext.set_rgb_background = (int)unibi_add_ext_str(ut, NULL, - "\x1b[48;2;%p1%d;%p2%d;%p3%dm"); - unibi_set_if_empty(ut, unibi_cursor_address, "\x1b[%i%p1%d;%p2%dH"); - unibi_set_if_empty(ut, unibi_cursor_home, "\x1b[H"); - unibi_set_if_empty(ut, unibi_parm_left_cursor, "\x1b[%p1%dD"); - unibi_set_if_empty(ut, unibi_parm_right_cursor, "\x1b[%p1%dC"); - unibi_set_if_empty(ut, unibi_parm_down_cursor, "\x1b[%p1%dB"); - unibi_set_if_empty(ut, unibi_parm_up_cursor, "\x1b[%p1%dA"); - unibi_set_if_empty(ut, unibi_cursor_left, "\x08"); - unibi_set_if_empty(ut, unibi_cursor_right, "\x1b[C"); -#if defined(WIN32) - unibi_set_if_empty(ut, unibi_cursor_down, "\x1b[B"); -#else - // N.B. This relies upon the terminal really being in cfmakeraw() mode, - // which libuv's RAW mode is in fact not. - unibi_set_if_empty(ut, unibi_cursor_down, "\x0a"); -#endif - unibi_set_if_empty(ut, unibi_cursor_up, "\x1b[A"); - unibi_set_if_empty(ut, unibi_carriage_return, "\x0d"); - unibi_set_if_empty(ut, unibi_exit_attribute_mode, "\x1b[0;10m"); - unibi_set_if_empty(ut, unibi_set_a_foreground, XTERM_SETAF_16); - unibi_set_if_empty(ut, unibi_set_a_background, XTERM_SETAB_16); - unibi_set_if_empty(ut, unibi_enter_bold_mode, "\x1b[1m"); - unibi_set_if_empty(ut, unibi_enter_underline_mode, "\x1b[4m"); - unibi_set_if_empty(ut, unibi_enter_reverse_mode, "\x1b[7m"); - unibi_set_if_empty(ut, unibi_bell, "\x07"); - unibi_set_if_empty(ut, unibi_enter_ca_mode, "\x1b[?1049h"); - unibi_set_if_empty(ut, unibi_exit_ca_mode, "\x1b[?1049l"); - unibi_set_if_empty(ut, unibi_delete_line, "\x1b[M"); - unibi_set_if_empty(ut, unibi_parm_delete_line, "\x1b[%p1%dM"); - unibi_set_if_empty(ut, unibi_insert_line, "\x1b[L"); - unibi_set_if_empty(ut, unibi_parm_insert_line, "\x1b[%p1%dL"); - unibi_set_if_empty(ut, unibi_clear_screen, "\x1b[H\x1b[J"); - unibi_set_if_empty(ut, unibi_clr_eol, "\x1b[K"); - unibi_set_if_empty(ut, unibi_clr_eos, "\x1b[J"); } static void flush_buf(UI *ui, bool toggle_cursor) From 03683c375cb3ded56f7edbcc70619bab1e8dd4f9 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Thu, 25 May 2017 17:39:27 +0100 Subject: [PATCH 020/161] tui: Disable interference in guicursor by higher layers. Ironically, higher layers trying to be "smart" about the terminal type but not actually being very smart at all, makes it more difficult rather than less to correct the TUI layer. Note that this orphans the os_term_is_nice() function and down the road, presuming that we do not have to revert this, that function can be removed. It incorporates knowledge of terminal types and behaviours in the wrong place. --- src/nvim/option.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nvim/option.c b/src/nvim/option.c index 392a2f3908..0c423c900f 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -969,10 +969,12 @@ void set_init_2(bool headless) p_window = Rows - 1; } set_number_default("window", Rows - 1); +#if 0 // This bodges around problems that should properly be fixed in the TUI layer. if (!headless && !os_term_is_nice()) { set_string_option_direct((char_u *)"guicursor", -1, (char_u *)"", OPT_GLOBAL, SID_NONE); } +#endif parse_shape_opt(SHAPE_CURSOR); // set cursor shapes from 'guicursor' (void)parse_printoptions(); // parse 'printoptions' default value } From 76a6509c594df118c76381b821e5259f149bd93e Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Thu, 25 May 2017 19:12:52 +0100 Subject: [PATCH 021/161] tui: More refactoring, and improvements to cursor shape support. The details are in the on-line help under :help cursor-shape . The brief precis is that nvim is following the lead of tmux, and going beyond what tmux does to make cursor shape changes work on a broad range of terminals. This includes on tmux itself, which is no longer bypassed. --- runtime/doc/options.txt | 10 +-- runtime/doc/term.txt | 31 ++++++- src/nvim/tui/tui.c | 181 ++++++++++++++++++++++++++++++---------- 3 files changed, 167 insertions(+), 55 deletions(-) diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 2097cbf32b..225336bae3 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -2756,14 +2756,10 @@ A jump table for the options with a short description can be found at |Q_op|. *'guicursor'* *'gcr'* *E545* *E546* *E548* *E549* 'guicursor' 'gcr' string (default "n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20") global - Configures the cursor style for each mode. Works in the GUI and some - terminals. + Configures the cursor style for each mode. Works in the GUI and many + terminals. See |cursor-shape| for details. - With tmux you might need this in ~/.tmux.conf (see terminal-overrides - in the tmux(1) manual page): > - set -ga terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q' - -< To disable cursor-styling, reset the option: > + To disable cursor-styling, reset the option: > :set guicursor= < To enable mode shapes, "Cursor" highlight, and blinking: > diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index 13b0b5b37d..3425fb93b4 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -95,10 +95,33 @@ for this extension. So Nvim simply assumes that (all) "dtterm", "xterm", *cursor-shape* *termcap-cursor-shape* Nvim will adjust the shape of the cursor from a block to a line when in insert -mode, on terminals that support it. If Konsole is detected, it will use the -idiosyncratic Konsole terminal control sequences for this, attempting to do -the right thing if tmux is between Nvim and Konsole. Otherwise, it uses the -conventional DECSCUSR control sequences. +mode (or as specified by the 'guicursor' option), on terminals that support +it. It uses the same |terminfo| extensions that were pioneered by tmux for +this: "Ss" and "Se". If your terminfo definition specifies these, as some +(such as "xterm+tmux") do, then nothing more is required. + +If your terminfo definition is missing them, then Nvim will on a wide range of +terminals resort to using the conventional DECSUSR control sequence for +adjusting the cursor shape. If Konsole is detected, Nvim will use the +idiosyncratic Konsole terminal control sequences for this. + +Note: tmux itself accepts the conventional DECSUSR control sequence, the same +as many other terminals do. It has to translate this into whatever control +sequence is appropriate for the terminal that it is outputting to. Like Nvim, +it will use the "Ss" and "Se" capabilities from terminfo if they are present. + +Unlike Nvim, if they are not present in terminfo you will have to add them by +setting the tmux "terminal-overrides" setting in $HOME/.tmux.conf . It will +appear that Nvim is not changing the cursor, but in fact it is tmux receiving +instructions from Nvim to change the cursor and not knowing what to do. See +the tmux(1) manual page for the details of how and what to do in the tmux +configuration file. It will look something like: > + set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q' + + set -ga terminal-overrides \ + 'xterm*:\E]50;CursorShape=%?%p1%{3}%<%t%{0}%e%{1}%;%d\007' +unibi_ext.disable_focus_reporting = -1; data->unibi_ext.resize_screen = -1; data->unibi_ext.reset_scroll_region = -1; - data->unibi_ext.konsole_cursor_shape = -1; - data->unibi_ext.dec_cursor_shape = -1; + data->unibi_ext.set_cursor_style = -1; + data->unibi_ext.reset_cursor_style = -1; data->out_fd = 1; data->out_isatty = os_isatty(data->out_fd); // setup unibilium @@ -174,7 +175,7 @@ static void terminfo_start(UI *ui) bool iterm = termprg && strstr(termprg, "iTerm.app"); bool konsole = os_getenv("KONSOLE_PROFILE_NAME") || os_getenv("KONSOLE_DBUS_SESSION"); - patch_terminfo_bugs(data->ut, term, colorterm, vte_version, konsole, iterm); + patch_terminfo_bugs(data, term, colorterm, vte_version, konsole, iterm); augment_terminfo(data, term, colorterm, vte_version, konsole, iterm); data->can_change_scroll_region = !!unibi_get_str(data->ut, unibi_change_scroll_region); @@ -783,16 +784,6 @@ static void tui_set_mode(UI *ui, ModeShape mode) } } - switch (shape) { - case SHAPE_BLOCK: shape = 0; break; - case SHAPE_VER: shape = 1; break; - case SHAPE_HOR: shape = 2; break; - default: WLOG("Unknown shape value %d", shape); break; - } - data->params[0].i = shape; - data->params[1].i = (c.blinkon != 0); - unibi_out(ui, data->unibi_ext.konsole_cursor_shape); - switch (shape) { case SHAPE_BLOCK: shape = 1; break; case SHAPE_HOR: shape = 3; break; @@ -800,7 +791,7 @@ static void tui_set_mode(UI *ui, ModeShape mode) default: WLOG("Unknown shape value %d", shape); break; } data->params[0].i = shape + (int)(c.blinkon == 0); - unibi_out(ui, data->unibi_ext.dec_cursor_shape); + unibi_out(ui, data->unibi_ext.set_cursor_style); } /// @param mode editor mode @@ -1142,6 +1133,22 @@ static void unibi_set_if_empty(unibi_term *ut, enum unibi_string str, } } +static int unibi_find_ext_str(unibi_term *ut, const char *name) +{ + size_t max = unibi_count_ext_bool(ut); + for (size_t i = 0; i < max; ++i) { + const char * n = unibi_get_ext_str_name(ut, i); + if (0 == strcmp(n, name)) { + return (int)i; + } + } + return -1; +} + +// One creates the dumps from terminfo.src by using +// od -t d1 -w +// on the compiled files. + // Taken from unibilium/t/static_xterm.c as of 2015-08-14. // This is an 8-colour terminfo description that lacks // DECSTBN/DECSLRM/DECLRMM capabilities that xterm actually has. @@ -1876,25 +1883,39 @@ static unibi_term *load_builtin_terminfo(const char * term) /// terminal types. So patch the terminfo records after loading from an /// external or a built-in database. In an ideal world, the real terminfo data /// would be correct and complete, and this function would be almost empty. -static void patch_terminfo_bugs(unibi_term *ut, const char *term, +static void patch_terminfo_bugs(TUIData *data, const char *term, const char *colorterm, long vte_version, bool konsole, bool iterm) { + unibi_term *ut = data->ut; + bool true_xterm = !!os_getenv("XTERM_VERSION"); bool xterm = term && STARTS_WITH(term, "xterm"); bool mate = colorterm && strstr(colorterm, "mate-terminal"); bool gnome = colorterm && strstr(colorterm, "gnome-terminal"); bool linux = term && STARTS_WITH(term, "linux"); bool rxvt = term && STARTS_WITH(term, "rxvt"); + bool teraterm = term && STARTS_WITH(term, "teraterm"); + bool putty = term && STARTS_WITH(term, "putty"); + bool screen = term && STARTS_WITH(term, "screen"); + bool tmux_wrap = screen && !!os_getenv("TMUX"); - const char *fix_normal = unibi_get_str(ut, unibi_cursor_normal); + char *fix_normal = (char *)unibi_get_str(ut, unibi_cursor_normal); if (fix_normal) { if (STARTS_WITH(fix_normal, "\x1b[?12l")) { - // terminfo typically includes DECRST 12 as part of setting up the normal - // cursor, which interferes with the user's control via - // NVIM_TUI_ENABLE_CURSOR_SHAPE. When DECRST 12 is present, skip over - // it, but honor the rest of the TI setting. - fix_normal += strlen("\x1b[?12l"); + // terminfo typically includes DECRST 12 as part of setting up the + // normal cursor, which interferes with the user's control via + // set_cursor_style. When DECRST 12 is present, skip over it, but honor + // the rest of the cnorm setting. + fix_normal += sizeof "\x1b[?12l" - 1; unibi_set_str(ut, unibi_cursor_normal, fix_normal); } + if (linux + && (strlen(fix_normal) + 1) >= (sizeof LINUXRESETC - 1) + && !memcmp(strchr(fix_normal,0) - (sizeof LINUXRESETC - 1), LINUXRESETC, sizeof LINUXRESETC - 1)) { + // The Linux terminfo entry similarly includes a Linux-idiosyncractic + // cursor shape reset in cnorm, which similarly interferes with + // set_cursor_style. + fix_normal[strlen(fix_normal) - (sizeof LINUXRESETC - 1)] = 0; + } } if (xterm) { @@ -1904,10 +1925,9 @@ static void patch_terminfo_bugs(unibi_term *ut, const char *term, // their own terminal types and terminfo entries, like PuTTY does, and not // claim to be xterm. Or they would mimic xterm properly enough to be // treatable as xterm. -#if 0 // We don't need to identify this specifically, for now. +#if 0 // We don't need to identify this specifically, for now. bool roxterm = !!os_getenv("ROXTERM_ID"); #endif - bool true_xterm = !!os_getenv("XTERM_VERSION"); unibi_set_if_empty(ut, unibi_to_status_line, "\x1b]0;"); unibi_set_if_empty(ut, unibi_from_status_line, "\x07"); unibi_set_if_empty(ut, unibi_set_tb_margin, "\x1b[%i%p1%d;%p2%dr"); @@ -1921,7 +1941,7 @@ static void patch_terminfo_bugs(unibi_term *ut, const char *term, unibi_set_if_empty(ut, unibi_to_status_line, "\x1b]2"); unibi_set_if_empty(ut, unibi_from_status_line, "\x07"); unibi_set_if_empty(ut, unibi_set_tb_margin, "\x1b[%i%p1%d;%p2%dr"); - } else if (term && STARTS_WITH(term, "screen")) { + } else if (screen) { unibi_set_if_empty(ut, unibi_to_status_line, "\x1b_"); unibi_set_if_empty(ut, unibi_from_status_line, "\x1b\\"); } else if (term && STARTS_WITH(term, "tmux")) { @@ -1968,6 +1988,91 @@ static void patch_terminfo_bugs(unibi_term *ut, const char *term, unibi_set_if_empty(ut, unibi_set_a_background, XTERM_SETAB_16); } } + + // Dickey ncurses terminfo has included the Ss and Se capabilities, pioneered + // by tmux, since 2011-07-14. So adding them to terminal types, that do + // actually have such control sequences but lack the currect definitions in + // terminfo, is a fixup, not an augmentation. + data->unibi_ext.reset_cursor_style = unibi_find_ext_str(ut, "Se"); + data->unibi_ext.set_cursor_style = unibi_find_ext_str(ut, "Ss"); + if (-1 == data->unibi_ext.set_cursor_style) { + // The DECSCUSR sequence to change the cursor shape is widely + // supported by several terminal types and should be in many + // teminfo entries. See + // https://github.com/gnachman/iTerm2/pull/92 for more. + // xterm even has an extended version that has a vertical bar. + if (true_xterm // per xterm ctlseqs doco (since version 282) + // Allows forcing the use of DECSCUSR on linux type terminals, such as + // console-terminal-emulator from the nosh toolset, which does indeed + // implement the xterm extension: + || (linux && (true_xterm || (vte_version > 0) || colorterm))) { + data->unibi_ext.set_cursor_style = (int)unibi_add_ext_str(ut, "Ss", + "\x1b[%p1%d q"); + if (-1 == data->unibi_ext.reset_cursor_style) { + data->unibi_ext.reset_cursor_style = (int)unibi_add_ext_str(ut, "Se", + ""); + } + unibi_set_ext_str(ut, (size_t)data->unibi_ext.reset_cursor_style, "\x1b[ q"); + } else if (putty // per MinTTY 0.4.3-1 release notes from 2009 + || teraterm // per TeraTerm "Supported Control Functions" doco + || (vte_version >= 3900) // VTE-based terminals since this version. + // per tmux manual page and per + // https://lists.gnu.org/archive/html/screen-devel/2013-03/msg00000.html + || screen) { + // Since we use the xterm extension, we have to map it to the unextended + // form. + data->unibi_ext.set_cursor_style = (int)unibi_add_ext_str(ut, "Ss", + "\x1b[%?" + "%p1%{4}%>" "%t%p1%{2}%-" // a bit of a bodge for extension values + "%e%p1" // the conventional codes are just passed through + "%;%d q"); + if (-1 == data->unibi_ext.reset_cursor_style) { + data->unibi_ext.reset_cursor_style = (int)unibi_add_ext_str(ut, "Se", + ""); + } + unibi_set_ext_str(ut, (size_t)data->unibi_ext.reset_cursor_style, "\x1b[ q"); + } else if (linux) { + // Linux uses an idiosyncratic escape code to set the cursor shape and does + // not support DECSCUSR. + data->unibi_ext.set_cursor_style = (int)unibi_add_ext_str(ut, "Ss", + "\x1b[?" + "%?" + // The parameter passed to Ss is the DECSCUSR parameter, so the + // terminal capability has to translate into the Linux idiosyncratic + // parameter. + "%p1%{2}%<" "%t%{8}" // blink block + "%p1%{2}%=" "%t%{24}" // steady block + "%p1%{3}%=" "%t%{1}" // blink underline + "%p1%{4}%=" "%t%{17}" // steady underline + "%p1%{5}%=" "%t%{1}" // blink bar + "%p1%{6}%=" "%t%{17}" // steady bar + "%e%{0}" // anything else + "%;" "%dc"); + if (-1 == data->unibi_ext.reset_cursor_style) { + data->unibi_ext.reset_cursor_style = (int)unibi_add_ext_str(ut, "Se", + ""); + } + unibi_set_ext_str(ut, (size_t)data->unibi_ext.reset_cursor_style, "\x1b[?c"); + } else if (konsole) { + // Konsole uses an idiosyncratic escape code to set the cursor shape and does + // not support DECSCUSR. The tmux wrapping is unused, now. + data->unibi_ext.set_cursor_style = (int)unibi_add_ext_str(ut, "Ss", + TMUX_WRAP(tmux_wrap, "\x1b]50;CursorShape=%?" + "%p1%{3}%<" "%t%{0}" // block + "%e%p1%{4}%<" "%t%{2}" // underline + "%e%{1}" // everything else is bar + "%;%d;BlinkingCursorEnabled=%?" + "%p1%{1}%<" "%t%{1}" // Fortunately if we exclude zero as special, + "%e%p1%{1}%&" // in all other cases we can teeat bit #0 as a flag. + "%;%d\x07")); + if (-1 == data->unibi_ext.reset_cursor_style) { + data->unibi_ext.reset_cursor_style = (int)unibi_add_ext_str(ut, "Se", + ""); + } + unibi_set_ext_str(ut, (size_t)data->unibi_ext.reset_cursor_style, + TMUX_WRAP(tmux_wrap, "\x1b]50;CursorShape=0;BlinkingCursorEnabled=1\x07")); + } + } } /// This adds stuff that is not in standard terminfo as extended unibilium @@ -1976,15 +2081,16 @@ static void augment_terminfo(TUIData *data, const char *term, const char *colorterm, long vte_version, bool konsole, bool iterm) { unibi_term *ut = data->ut; - bool putty = term && STARTS_WITH(term, "putty"); bool xterm = term && STARTS_WITH(term, "xterm"); bool dtterm = term && STARTS_WITH(term, "dtterm"); - bool teraterm = term && STARTS_WITH(term, "teraterm"); - bool rxvt = term && STARTS_WITH(term, "rxvt"); bool linux = term && STARTS_WITH(term, "linux"); - bool tmux_wrap = !!os_getenv("TMUX"); + bool rxvt = term && STARTS_WITH(term, "rxvt"); + bool teraterm = term && STARTS_WITH(term, "teraterm"); + bool putty = term && STARTS_WITH(term, "putty"); + bool screen = term && STARTS_WITH(term, "screen"); + bool tmux_wrap = screen && !!os_getenv("TMUX"); bool truecolor = colorterm - && (STRCMP(colorterm, "truecolor") || STRCMP(colorterm, "24bit")); + && (0 == strcmp(colorterm, "truecolor") || 0 == strcmp(colorterm, "24bit")); // Only define this capability for terminal types that we know understand it. if (dtterm // originated this extension @@ -2013,19 +2119,6 @@ static void augment_terminfo(TUIData *data, const char *term, data->unibi_ext.set_cursor_color = (int)unibi_add_ext_str( ut, NULL, "\033]12;#%p1%06x\007"); } - if (konsole) { - // Konsole uses a proprietary escape code to set the cursor shape - // and does not support DECSCUSR. - data->unibi_ext.konsole_cursor_shape = (int)unibi_add_ext_str(ut, NULL, - TMUX_WRAP(tmux_wrap, "\x1b]50;CursorShape=%p1%d;BlinkingCursorEnabled=%p2%d\x07")); - } else if (0 == vte_version || vte_version >= 3900) { - // Assume that the terminal supports DECSCUSR unless it is an - // old VTE based terminal. This should not get wrapped for tmux, - // which will handle it via its Ss/Se terminfo extension - usually - // according to its terminal-overrides. - data->unibi_ext.dec_cursor_shape = (int)unibi_add_ext_str(ut, NULL, - "\x1b[%p1%d q"); - } /// Terminals generally ignore private modes that they do not recognize, /// and there is no known ambiguity with these modes from terminal type to From 756a17a8480baa0e54110d32853d27460f66b235 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Thu, 25 May 2017 20:43:48 +0100 Subject: [PATCH 022/161] doco: Replace termcap with terminfo where appropriate. Also document better what to do on slow terminals. --- runtime/doc/eval.txt | 9 +++++---- runtime/doc/intro.txt | 4 ++-- runtime/doc/map.txt | 4 ++-- runtime/doc/options.txt | 5 +---- runtime/doc/quickref.txt | 4 ++-- runtime/doc/syntax.txt | 7 +++---- runtime/doc/term.txt | 42 +++++++++++++++++++--------------------- runtime/doc/windows.txt | 2 +- 8 files changed, 36 insertions(+), 41 deletions(-) diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 11b42dd2e5..4d81a124cc 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1845,10 +1845,11 @@ v:t_number Value of Number type. Read-only. See: |type()| v:t_string Value of String type. Read-only. See: |type()| *v:termresponse* *termresponse-variable* -v:termresponse The escape sequence returned by the terminal for the |t_RV| - termcap entry. It is set when Vim receives an escape sequence - that starts with ESC [ or CSI and ends in a 'c', with only - digits, ';' and '.' in between. +v:termresponse The escape sequence returned by the terminal for the DA + (request primary device attributes) control sequence. It is + set when Vim receives an escape sequence that starts with ESC + [ or CSI and ends in a 'c', with only digits, ';' and '.' in + between. When this option is set, the TermResponse autocommand event is fired, so that you can react to the response from the terminal. diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index c745d60ebc..88d04aa76b 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -442,8 +442,8 @@ available on a few terminals. Note: There are two codes for the delete key. 127 is the decimal ASCII value for the delete key, which is always recognized. Some delete keys send another -value, in which case this value is obtained from the termcap entry "kD". Both -values have the same effect. +value, in which case this value is obtained from the |terminfo| entry "key_dc". +Both values have the same effect. Note: The keypad keys are used in the same way as the corresponding "normal" keys. For example, has the same effect as . If a keypad key diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index 16c044a21d..f5b0233e6c 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -443,8 +443,8 @@ There are two ways to map a special key: 1. The Vi-compatible method: Map the key code. Often this is a sequence that starts with . To enter a mapping like this you type ":map " and then you have to type CTRL-V before hitting the function key. Note that when - the key code for the key is in the termcap, it will automatically be - translated into the internal code and become the second way of mapping + the key code for the key is in the |terminfo| entry, it will automatically + be translated into the internal code and become the second way of mapping (unless the 'k' flag is included in 'cpoptions'). 2. The second method is to use the internal code for the function key. To enter such a mapping type CTRL-K and then hit the function key, or use diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 225336bae3..6254a45250 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -24,10 +24,7 @@ achieve special effects. These options come in three forms: :se[t] all Show all but terminal options. -:se[t] termcap Show all terminal options. Note that in the GUI the - key codes are not shown, because they are generated - internally and can't be changed. Changing the terminal - codes in the GUI is not useful either... +:se[t] termcap Do nothing. Nvim uses |terminfo|. *E518* *E519* :se[t] {option}? Show value of {option}. diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index 128c70ee94..bcbf8c365d 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -571,8 +571,8 @@ In Insert or Command-line mode: *Q_op* Options |:set| :se[t] show all modified options -|:set| :se[t] all show all non-termcap options -|:set| :se[t] termcap show all termcap options +|:set| :se[t] all show all options +|:set| :se[t] termcap Do nothing. (|terminfo|) |:set| :se[t] {option} set boolean option (switch it on), show string or number option |:set| :se[t] no{option} reset boolean option (switch it off) diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index ed2a97cb3b..f2db95ce19 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -4696,7 +4696,7 @@ cterm={attr-list} *highlight-cterm* ctermfg={color-nr} *highlight-ctermfg* *E421* ctermbg={color-nr} *highlight-ctermbg* The {color-nr} argument is a color number. Its range is zero to - (not including) the number given by the termcap entry "Co". + (not including) the number of |terminfo-colors| available. The actual color with this number depends on the type of terminal and its settings. Sometimes the color also depends on the settings of "cterm". For example, on some systems "cterm=bold ctermfg=3" gives @@ -4768,9 +4768,8 @@ ctermbg={color-nr} *highlight-ctermbg* delete the "g:colors_name" variable when you don't want this. When you have set "ctermfg" or "ctermbg" for the Normal group, Vim - needs to reset the color when exiting. This is done with the "op" - termcap entry |t_op|. If this doesn't work correctly, try setting the - 't_op' option in your vimrc. + needs to reset the color when exiting. This is done with the + "orig_pair" |terminfo| entry. *E419* *E420* When Vim knows the normal foreground and background colors, "fg" and "bg" can be used as color names. This only works after setting the diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index 3425fb93b4..817b06de2b 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -21,7 +21,8 @@ When Vim is started a default terminal type is assumed. for MS-DOS this is the pc terminal, for Unix an ansi terminal. *terminfo* *E557* *E558* *E559* -On Unix the terminfo database is used. +On Unix the terminfo database is used. There is no access to the terminfo +settings with |:set|. *builtin-terms* *builtin_terms* If a terminfo database is not available, Nvim will look up the terminal type @@ -65,7 +66,7 @@ genuine Xterm will not work over an SSH connection, because the environment variable, set by genuine Xterm, that it looks for is not automatically replicated over an SSH login session. - *256-color* *termcap-colors* + *256-color* *terminfo-colors* *termcap-colors* Nvim can make use of 256-colour terminals and tries to do so whereever it can. If the |terminfo| description of the terminal says that it supports fewer @@ -93,7 +94,7 @@ extension pioneered by the dtterm program. |terminfo| does not have a flag for this extension. So Nvim simply assumes that (all) "dtterm", "xterm", "teraterm", "rxvt" terminal types, and Konsole, are capable of this. - *cursor-shape* *termcap-cursor-shape* + *cursor-shape* *terminfo-cursor-shape* *termcap-cursor-shape* Nvim will adjust the shape of the cursor from a block to a line when in insert mode (or as specified by the 'guicursor' option), on terminals that support it. It uses the same |terminfo| extensions that were pioneered by tmux for @@ -167,7 +168,7 @@ On Unix systems, three methods are tried to get the window size: - an ioctl call (TIOCGSIZE or TIOCGWINSZ, depends on your system) - the environment variables "LINES" and "COLUMNS" -- from the termcap entries "li" and "co" +- from the |terminfo| entries "lines" and "columns" If everything fails a default size of 24 lines and 80 columns is assumed. If a window-resize signal is received the size will be set again. If the window @@ -190,30 +191,27 @@ cursor position is shown in the status line. If you are using horizontal scrolling ('wrap' option off) consider setting 'sidescroll' to a small number. -If you have a slow terminal you may want to reset the 'showcmd' option. -The command characters will not be shown in the status line. If the terminal -scrolls very slowly, set the 'scrolljump' to 5 or so. If the cursor is moved -off the screen (e.g., with "j") Vim will scroll 5 lines at a time. Another -possibility is to reduce the number of lines that Vim uses with the command -"z{height}". +If you have a slow terminal you may want to reset the 'showcmd' and 'ruler' +options. The command characters and cursor poritions will not be shown in the +status line (which involves a lot of cursor motions and attribute changes for +every keypress or movement). If the terminal scrolls very slowly, set the +'scrolljump' to 5 or so. If the cursor is moved off the screen (e.g., with +"j") Vim will scroll 5 lines at a time. Another possibility is to reduce the +number of lines that Vim uses with the command "z{height}". If the characters from the terminal are arriving with more than 1 second between them you might want to set the 'timeout' and/or 'ttimeout' option. See the "Options" chapter |options|. -If you are using a color terminal that is slow, use this command: > +If you are using a color terminal that is slow when displaying lines beyond +the end of a buffer, this is because Nvim is drawing the whitespace twice, in +two sets of colours and attributes. To prevent this, use this command: > hi NonText cterm=NONE ctermfg=NONE -This avoids that spaces are sent when they have different attributes. On most -terminals you can't see this anyway. - -If you are using Vim over a slow serial line, you might want to try running -Vim inside the "screen" program. Screen will optimize the terminal I/O quite -a bit. - -If you are testing termcap options, but you cannot see what is happening, -you might want to set the 'writedelay' option. When non-zero, one character -is sent to the terminal at a time (does not work for MS-DOS). This makes the -screen updating a lot slower, making it possible to see what is happening. +This draws the spaces with the default colours and attributes, which allows the +second pass of drawing to be optimized away. Note: Although in theory the +colours of whitespace are immaterial, in practice they change the colours of +cursors and selections that cross them. This may have a visible, but minor, +effect on some UIs. ============================================================================== Using the mouse *mouse-using* diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index 1941ac0972..93cf1d1b1a 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -117,7 +117,7 @@ check if the 'highlight' option contains "si". In version 3.0, this meant to invert the status line. Now it should be "sr", reverse the status line, as "si" now stands for italic! If italic is not available on your terminal, the status line is inverted anyway; you will only see this problem on terminals -that have termcap codes for italics. +that have |terminfo| capbilities for italics. ============================================================================== 3. Opening and closing a window *opening-window* *E36* From 74472f7b2bf354dbffcaca3738dacba5dfaefd6d Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Thu, 25 May 2017 22:25:42 +0100 Subject: [PATCH 023/161] tui: Fix conflict with predefined "linux" macro. --- src/nvim/tui/tui.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index cdb68f0ec4..5a0381c072 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1891,7 +1891,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, bool xterm = term && STARTS_WITH(term, "xterm"); bool mate = colorterm && strstr(colorterm, "mate-terminal"); bool gnome = colorterm && strstr(colorterm, "gnome-terminal"); - bool linux = term && STARTS_WITH(term, "linux"); + bool linuxvt = term && STARTS_WITH(term, "linux"); bool rxvt = term && STARTS_WITH(term, "rxvt"); bool teraterm = term && STARTS_WITH(term, "teraterm"); bool putty = term && STARTS_WITH(term, "putty"); @@ -1908,7 +1908,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, fix_normal += sizeof "\x1b[?12l" - 1; unibi_set_str(ut, unibi_cursor_normal, fix_normal); } - if (linux + if (linuxvt && (strlen(fix_normal) + 1) >= (sizeof LINUXRESETC - 1) && !memcmp(strchr(fix_normal,0) - (sizeof LINUXRESETC - 1), LINUXRESETC, sizeof LINUXRESETC - 1)) { // The Linux terminfo entry similarly includes a Linux-idiosyncractic @@ -1947,7 +1947,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, } else if (term && STARTS_WITH(term, "tmux")) { unibi_set_if_empty(ut, unibi_to_status_line, "\x1b_"); unibi_set_if_empty(ut, unibi_from_status_line, "\x1b\\"); - } else if (linux) { + } else if (linuxvt) { // No deviations from the vanilla terminfo. } else if (term && STARTS_WITH(term, "putty")) { // No deviations from the vanilla terminfo. @@ -1970,7 +1970,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, // See http://fedoraproject.org/wiki/Features/256_Color_Terminals for // more on this. if (konsole || mate || xterm || gnome || rxvt - || linux // Linux 4.8+ supports 256-colour SGR. + || linuxvt // Linux 4.8+ supports 256-colour SGR. || (colorterm && strstr(colorterm, "256")) || (term && strstr(term, "256")) ) { @@ -2005,7 +2005,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, // Allows forcing the use of DECSCUSR on linux type terminals, such as // console-terminal-emulator from the nosh toolset, which does indeed // implement the xterm extension: - || (linux && (true_xterm || (vte_version > 0) || colorterm))) { + || (linuxvt && (true_xterm || (vte_version > 0) || colorterm))) { data->unibi_ext.set_cursor_style = (int)unibi_add_ext_str(ut, "Ss", "\x1b[%p1%d q"); if (-1 == data->unibi_ext.reset_cursor_style) { @@ -2031,7 +2031,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, ""); } unibi_set_ext_str(ut, (size_t)data->unibi_ext.reset_cursor_style, "\x1b[ q"); - } else if (linux) { + } else if (linuxvt) { // Linux uses an idiosyncratic escape code to set the cursor shape and does // not support DECSCUSR. data->unibi_ext.set_cursor_style = (int)unibi_add_ext_str(ut, "Ss", @@ -2083,7 +2083,7 @@ static void augment_terminfo(TUIData *data, const char *term, unibi_term *ut = data->ut; bool xterm = term && STARTS_WITH(term, "xterm"); bool dtterm = term && STARTS_WITH(term, "dtterm"); - bool linux = term && STARTS_WITH(term, "linux"); + bool linuxvt = term && STARTS_WITH(term, "linux"); bool rxvt = term && STARTS_WITH(term, "rxvt"); bool teraterm = term && STARTS_WITH(term, "teraterm"); bool putty = term && STARTS_WITH(term, "putty"); @@ -2106,7 +2106,7 @@ static void augment_terminfo(TUIData *data, const char *term, "\x1b[r"); } // See https://gist.github.com/XVilka/8346728 for more about this. - if (putty || xterm || rxvt || linux || konsole || iterm || truecolor) { + if (putty || xterm || rxvt || linuxvt || konsole || iterm || truecolor) { data->unibi_ext.set_rgb_foreground = (int)unibi_add_ext_str(ut, NULL, "\x1b[38;2;%p1%d;%p2%d;%p3%dm"); data->unibi_ext.set_rgb_background = (int)unibi_add_ext_str(ut, NULL, From 503a5c458bf8b8458c18d45f1d1558987b15fc2d Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Fri, 26 May 2017 00:18:24 +0100 Subject: [PATCH 024/161] tui: Spelling corrections in doco and commentary --- runtime/doc/term.txt | 2 +- runtime/doc/windows.txt | 2 +- src/nvim/tui/tui.c | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index 817b06de2b..c4eefe4e53 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -192,7 +192,7 @@ scrolling ('wrap' option off) consider setting 'sidescroll' to a small number. If you have a slow terminal you may want to reset the 'showcmd' and 'ruler' -options. The command characters and cursor poritions will not be shown in the +options. The command characters and cursor positions will not be shown in the status line (which involves a lot of cursor motions and attribute changes for every keypress or movement). If the terminal scrolls very slowly, set the 'scrolljump' to 5 or so. If the cursor is moved off the screen (e.g., with diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index 93cf1d1b1a..651d617a76 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -117,7 +117,7 @@ check if the 'highlight' option contains "si". In version 3.0, this meant to invert the status line. Now it should be "sr", reverse the status line, as "si" now stands for italic! If italic is not available on your terminal, the status line is inverted anyway; you will only see this problem on terminals -that have |terminfo| capbilities for italics. +that have |terminfo| capabilities for italics. ============================================================================== 3. Opening and closing a window *opening-window* *E36* diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 5a0381c072..994c15d960 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -773,8 +773,6 @@ static void tui_set_mode(UI *ui, ModeShape mode) cursorentry_T c = data->cursor_shapes[mode]; int shape = c.shape; - // Support changing cursor shape on some popular terminals. - if (c.id != 0 && ui->rgb) { int attr = syn_id2attr(c.id); if (attr > 0) { @@ -2063,7 +2061,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, "%e%{1}" // everything else is bar "%;%d;BlinkingCursorEnabled=%?" "%p1%{1}%<" "%t%{1}" // Fortunately if we exclude zero as special, - "%e%p1%{1}%&" // in all other cases we can teeat bit #0 as a flag. + "%e%p1%{1}%&" // in all other cases we can treat bit #0 as a flag. "%;%d\x07")); if (-1 == data->unibi_ext.reset_cursor_style) { data->unibi_ext.reset_cursor_style = (int)unibi_add_ext_str(ut, "Se", From 9e9ffeb5eb811ff225d7b6bb7cc7ee51f7a9b7d4 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sat, 27 May 2017 10:32:46 +0100 Subject: [PATCH 025/161] tui: Update fallback terminfo records. Replace the 8-color xterm from unibilium with the 256-colour one from terminfo. Add a fallback record for suckless terminal. --- src/nvim/tui/tui.c | 464 +++++++++++++++++++++++++++++---------------- 1 file changed, 296 insertions(+), 168 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 994c15d960..0f3b046dc6 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1147,174 +1147,156 @@ static int unibi_find_ext_str(unibi_term *ut, const char *name) // od -t d1 -w // on the compiled files. -// Taken from unibilium/t/static_xterm.c as of 2015-08-14. -// This is an 8-colour terminfo description that lacks +// Taken from Dickey ncurses terminfo.src dated 2017-04-22. +// This is a 256-colour terminfo description that lacks // DECSTBN/DECSLRM/DECLRMM capabilities that xterm actually has. -static const char xterm_8colour_terminfo[] = { - 26, 1, 48, 0, 38, 0, 15, 0, -99, 1, 108, 5, 120, 116, 101, 114, 109, 124, 120, 116, - 101, 114, 109, 32, 116, 101, 114, 109, 105, 110, 97, 108, 32, 101, 109, 117, 108, 97, 116, 111, - 114, 32, 40, 88, 32, 87, 105, 110, 100, 111, 119, 32, 83, 121, 115, 116, 101, 109, 41, 0, - 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, - 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 8, 0, 64, 0, 0, 0, 4, 0, 6, 0, 8, 0, 25, 0, 30, 0, - 38, 0, 42, 0, 46, 0, -1, -1, 57, 0, 74, 0, 76, 0, 80, 0, 87, 0, -1, -1, - 89, 0, 102, 0, -1, -1, 106, 0, 110, 0, 120, 0, 124, 0, -1, -1, -1, -1, -128, 0, - -124, 0, -119, 0, -114, 0, -1, -1, -1, -1, -105, 0, -100, 0, -1, -1, -95, 0, -90, 0, - -85, 0, -80, 0, -71, 0, -67, 0, -60, 0, -1, -1, -51, 0, -46, 0, -40, 0, -34, 0, - -1, -1, -1, -1, -1, -1, -16, 0, -1, -1, -1, -1, -1, -1, 2, 1, -1, -1, 6, 1, - -1, -1, -1, -1, -1, -1, 8, 1, -1, -1, 13, 1, -1, -1, -1, -1, -1, -1, -1, -1, - 17, 1, 21, 1, 27, 1, 31, 1, 35, 1, 39, 1, 45, 1, 51, 1, 57, 1, 63, 1, - 69, 1, 73, 1, -1, -1, 78, 1, -1, -1, 82, 1, 87, 1, 92, 1, 96, 1, 103, 1, - -1, -1, 110, 1, 114, 1, 122, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -126, 1, -117, 1, -1, -1, -1, -1, -108, 1, - -99, 1, -90, 1, -81, 1, -72, 1, -63, 1, -54, 1, -45, 1, -36, 1, -27, 1, -1, -1, - -1, -1, -1, -1, -18, 1, -14, 1, -9, 1, -1, -1, -4, 1, -1, 1, -1, -1, -1, -1, - 17, 2, 20, 2, 31, 2, 34, 2, 36, 2, 39, 2, 121, 2, -1, -1, 124, 2, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 126, 2, -1, -1, -1, -1, -1, -1, -1, -1, - -126, 2, -1, -1, -73, 2, -1, -1, -1, -1, -69, 2, -63, 2, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -57, 2, -53, 2, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -49, 2, -1, -1, -1, -1, -42, 2, -1, -1, - -1, -1, -1, -1, -1, -1, -35, 2, -28, 2, -21, 2, -1, -1, -1, -1, -14, 2, -1, -1, - -7, 2, -1, -1, -1, -1, -1, -1, 0, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 7, 3, 13, 3, 19, 3, 26, 3, 33, 3, 40, 3, 47, 3, 55, 3, 63, 3, 71, 3, - 79, 3, 87, 3, 95, 3, 103, 3, 111, 3, 118, 3, 125, 3, -124, 3, -117, 3, -109, 3, - -101, 3, -93, 3, -85, 3, -77, 3, -69, 3, -61, 3, -53, 3, -46, 3, -39, 3, -32, 3, - -25, 3, -17, 3, -9, 3, -1, 3, 7, 4, 15, 4, 23, 4, 31, 4, 39, 4, 46, 4, - 53, 4, 60, 4, 67, 4, 75, 4, 83, 4, 91, 4, 99, 4, 107, 4, 115, 4, 123, 4, - -125, 4, -118, 4, -111, 4, -104, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -99, 4, -88, 4, -83, 4, - -75, 4, -71, 4, -1, -1, -1, -1, -1, -1, -1, -1, -62, 4, 8, 5, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, 5, - -1, -1, -1, -1, -1, -1, 82, 5, 92, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 102, 5, 105, 5, 27, 91, 90, 0, 7, 0, - 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, - 91, 51, 103, 0, 27, 91, 72, 27, 91, 50, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, - 27, 91, 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, - 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, - 0, 8, 0, 27, 91, 63, 49, 50, 108, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, - 27, 91, 65, 0, 27, 91, 63, 49, 50, 59, 50, 53, 104, 0, 27, 91, 80, 0, 27, 91, - 77, 0, 27, 40, 48, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 63, 49, - 48, 52, 57, 104, 0, 27, 91, 52, 104, 0, 27, 91, 56, 109, 0, 27, 91, 55, 109, 0, - 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, 37, 112, 49, 37, 100, 88, 0, 27, - 40, 66, 0, 27, 40, 66, 27, 91, 109, 0, 27, 91, 63, 49, 48, 52, 57, 108, 0, 27, - 91, 52, 108, 0, 27, 91, 50, 55, 109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, - 104, 36, 60, 49, 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 27, 91, 33, 112, 27, 91, - 63, 51, 59, 52, 108, 27, 91, 52, 108, 27, 62, 0, 27, 91, 76, 0, 8, 0, 27, 91, - 51, 126, 0, 27, 79, 66, 0, 27, 79, 80, 0, 27, 91, 50, 49, 126, 0, 27, 79, 81, - 0, 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, - 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, - 79, 72, 0, 27, 91, 50, 126, 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, - 126, 0, 27, 79, 67, 0, 27, 91, 49, 59, 50, 66, 0, 27, 91, 49, 59, 50, 65, 0, - 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, 63, 49, 104, 27, 61, 0, - 27, 91, 63, 49, 48, 51, 52, 108, 0, 27, 91, 63, 49, 48, 51, 52, 104, 0, 27, 91, - 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, - 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, - 100, 83, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, - 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 84, 0, 27, - 91, 37, 112, 49, 37, 100, 65, 0, 27, 91, 105, 0, 27, 91, 52, 105, 0, 27, 91, 53, - 105, 0, 27, 99, 0, 27, 91, 33, 112, 27, 91, 63, 51, 59, 52, 108, 27, 91, 52, 108, - 27, 62, 0, 27, 56, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, - 10, 0, 27, 77, 0, 37, 63, 37, 112, 57, 37, 116, 27, 40, 48, 37, 101, 27, 40, 66, - 37, 59, 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, - 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 49, 37, 112, 51, 37, 124, 37, 116, 59, - 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 37, 63, 37, 112, 55, 37, - 116, 59, 56, 37, 59, 109, 0, 27, 72, 0, 9, 0, 27, 79, 69, 0, 96, 96, 97, 97, - 102, 102, 103, 103, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, - 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, - 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 91, 63, 55, 104, 0, 27, - 91, 63, 55, 108, 0, 27, 79, 70, 0, 27, 79, 77, 0, 27, 91, 51, 59, 50, 126, 0, - 27, 91, 49, 59, 50, 70, 0, 27, 91, 49, 59, 50, 72, 0, 27, 91, 50, 59, 50, 126, - 0, 27, 91, 49, 59, 50, 68, 0, 27, 91, 54, 59, 50, 126, 0, 27, 91, 53, 59, 50, - 126, 0, 27, 91, 49, 59, 50, 67, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, - 0, 27, 91, 49, 59, 50, 80, 0, 27, 91, 49, 59, 50, 81, 0, 27, 91, 49, 59, 50, - 82, 0, 27, 91, 49, 59, 50, 83, 0, 27, 91, 49, 53, 59, 50, 126, 0, 27, 91, 49, - 55, 59, 50, 126, 0, 27, 91, 49, 56, 59, 50, 126, 0, 27, 91, 49, 57, 59, 50, 126, - 0, 27, 91, 50, 48, 59, 50, 126, 0, 27, 91, 50, 49, 59, 50, 126, 0, 27, 91, 50, - 51, 59, 50, 126, 0, 27, 91, 50, 52, 59, 50, 126, 0, 27, 91, 49, 59, 53, 80, 0, - 27, 91, 49, 59, 53, 81, 0, 27, 91, 49, 59, 53, 82, 0, 27, 91, 49, 59, 53, 83, - 0, 27, 91, 49, 53, 59, 53, 126, 0, 27, 91, 49, 55, 59, 53, 126, 0, 27, 91, 49, - 56, 59, 53, 126, 0, 27, 91, 49, 57, 59, 53, 126, 0, 27, 91, 50, 48, 59, 53, 126, - 0, 27, 91, 50, 49, 59, 53, 126, 0, 27, 91, 50, 51, 59, 53, 126, 0, 27, 91, 50, - 52, 59, 53, 126, 0, 27, 91, 49, 59, 54, 80, 0, 27, 91, 49, 59, 54, 81, 0, 27, - 91, 49, 59, 54, 82, 0, 27, 91, 49, 59, 54, 83, 0, 27, 91, 49, 53, 59, 54, 126, - 0, 27, 91, 49, 55, 59, 54, 126, 0, 27, 91, 49, 56, 59, 54, 126, 0, 27, 91, 49, - 57, 59, 54, 126, 0, 27, 91, 50, 48, 59, 54, 126, 0, 27, 91, 50, 49, 59, 54, 126, - 0, 27, 91, 50, 51, 59, 54, 126, 0, 27, 91, 50, 52, 59, 54, 126, 0, 27, 91, 49, - 59, 51, 80, 0, 27, 91, 49, 59, 51, 81, 0, 27, 91, 49, 59, 51, 82, 0, 27, 91, - 49, 59, 51, 83, 0, 27, 91, 49, 53, 59, 51, 126, 0, 27, 91, 49, 55, 59, 51, 126, - 0, 27, 91, 49, 56, 59, 51, 126, 0, 27, 91, 49, 57, 59, 51, 126, 0, 27, 91, 50, - 48, 59, 51, 126, 0, 27, 91, 50, 49, 59, 51, 126, 0, 27, 91, 50, 51, 59, 51, 126, - 0, 27, 91, 50, 52, 59, 51, 126, 0, 27, 91, 49, 59, 52, 80, 0, 27, 91, 49, 59, - 52, 81, 0, 27, 91, 49, 59, 52, 82, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, - 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 49, 59, 50, 99, 0, 27, - 91, 99, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 91, 51, 37, 63, 37, 112, 49, - 37, 123, 49, 125, 37, 61, 37, 116, 52, 37, 101, 37, 112, 49, 37, 123, 51, 125, 37, 61, - 37, 116, 54, 37, 101, 37, 112, 49, 37, 123, 52, 125, 37, 61, 37, 116, 49, 37, 101, 37, - 112, 49, 37, 123, 54, 125, 37, 61, 37, 116, 51, 37, 101, 37, 112, 49, 37, 100, 37, 59, - 109, 0, 27, 91, 52, 37, 63, 37, 112, 49, 37, 123, 49, 125, 37, 61, 37, 116, 52, 37, - 101, 37, 112, 49, 37, 123, 51, 125, 37, 61, 37, 116, 54, 37, 101, 37, 112, 49, 37, 123, - 52, 125, 37, 61, 37, 116, 49, 37, 101, 37, 112, 49, 37, 123, 54, 125, 37, 61, 37, 116, - 51, 37, 101, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 77, 0, 27, 91, 51, 37, - 112, 49, 37, 100, 109, 0, 27, 91, 52, 37, 112, 49, 37, 100, 109, 0, 27, 108, 0, 27, - 109, 0, 2, 0, 1, 0, 57, 0, 117, 0, -88, 2, 1, 0, -1, -1, -1, -1, 0, 0, - 7, 0, 14, 0, 21, 0, 28, 0, 35, 0, 42, 0, 49, 0, 56, 0, 63, 0, 70, 0, - 77, 0, 84, 0, 91, 0, 98, 0, 105, 0, 112, 0, 119, 0, 126, 0, -123, 0, -116, 0, - -109, 0, -102, 0, -95, 0, -88, 0, -81, 0, -74, 0, -67, 0, -60, 0, -53, 0, -46, 0, - -39, 0, -32, 0, -25, 0, -18, 0, -11, 0, -4, 0, 3, 1, 10, 1, 17, 1, 24, 1, - 31, 1, 38, 1, 45, 1, 52, 1, 59, 1, 66, 1, 73, 1, 80, 1, 87, 1, 94, 1, - 101, 1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 3, 0, 6, 0, 9, 0, 12, 0, - 17, 0, 22, 0, 27, 0, 32, 0, 37, 0, 41, 0, 46, 0, 51, 0, 56, 0, 61, 0, - 66, 0, 72, 0, 78, 0, 84, 0, 90, 0, 96, 0, 102, 0, 108, 0, 114, 0, 120, 0, - 126, 0, -125, 0, -120, 0, -115, 0, -110, 0, -105, 0, -99, 0, -93, 0, -87, 0, -81, 0, - -75, 0, -69, 0, -63, 0, -57, 0, -51, 0, -45, 0, -39, 0, -33, 0, -27, 0, -21, 0, - -15, 0, -9, 0, -3, 0, 3, 1, 9, 1, 15, 1, 19, 1, 24, 1, 29, 1, 34, 1, - 39, 1, 44, 1, 48, 1, 52, 1, 56, 1, 27, 91, 51, 59, 51, 126, 0, 27, 91, 51, - 59, 52, 126, 0, 27, 91, 51, 59, 53, 126, 0, 27, 91, 51, 59, 54, 126, 0, 27, 91, - 51, 59, 55, 126, 0, 27, 91, 49, 59, 50, 66, 0, 27, 91, 49, 59, 51, 66, 0, 27, - 91, 49, 59, 52, 66, 0, 27, 91, 49, 59, 53, 66, 0, 27, 91, 49, 59, 54, 66, 0, - 27, 91, 49, 59, 55, 66, 0, 27, 91, 49, 59, 51, 70, 0, 27, 91, 49, 59, 52, 70, - 0, 27, 91, 49, 59, 53, 70, 0, 27, 91, 49, 59, 54, 70, 0, 27, 91, 49, 59, 55, - 70, 0, 27, 91, 49, 59, 51, 72, 0, 27, 91, 49, 59, 52, 72, 0, 27, 91, 49, 59, - 53, 72, 0, 27, 91, 49, 59, 54, 72, 0, 27, 91, 49, 59, 55, 72, 0, 27, 91, 50, - 59, 51, 126, 0, 27, 91, 50, 59, 52, 126, 0, 27, 91, 50, 59, 53, 126, 0, 27, 91, - 50, 59, 54, 126, 0, 27, 91, 50, 59, 55, 126, 0, 27, 91, 49, 59, 51, 68, 0, 27, - 91, 49, 59, 52, 68, 0, 27, 91, 49, 59, 53, 68, 0, 27, 91, 49, 59, 54, 68, 0, - 27, 91, 49, 59, 55, 68, 0, 27, 91, 54, 59, 51, 126, 0, 27, 91, 54, 59, 52, 126, - 0, 27, 91, 54, 59, 53, 126, 0, 27, 91, 54, 59, 54, 126, 0, 27, 91, 54, 59, 55, - 126, 0, 27, 91, 53, 59, 51, 126, 0, 27, 91, 53, 59, 52, 126, 0, 27, 91, 53, 59, - 53, 126, 0, 27, 91, 53, 59, 54, 126, 0, 27, 91, 53, 59, 55, 126, 0, 27, 91, 49, - 59, 51, 67, 0, 27, 91, 49, 59, 52, 67, 0, 27, 91, 49, 59, 53, 67, 0, 27, 91, - 49, 59, 54, 67, 0, 27, 91, 49, 59, 55, 67, 0, 27, 91, 49, 59, 50, 65, 0, 27, - 91, 49, 59, 51, 65, 0, 27, 91, 49, 59, 52, 65, 0, 27, 91, 49, 59, 53, 65, 0, - 27, 91, 49, 59, 54, 65, 0, 27, 91, 49, 59, 55, 65, 0, 65, 88, 0, 88, 84, 0, - 85, 56, 0, 88, 77, 0, 107, 68, 67, 51, 0, 107, 68, 67, 52, 0, 107, 68, 67, 53, - 0, 107, 68, 67, 54, 0, 107, 68, 67, 55, 0, 107, 68, 78, 0, 107, 68, 78, 51, 0, - 107, 68, 78, 52, 0, 107, 68, 78, 53, 0, 107, 68, 78, 54, 0, 107, 68, 78, 55, 0, - 107, 69, 78, 68, 51, 0, 107, 69, 78, 68, 52, 0, 107, 69, 78, 68, 53, 0, 107, 69, - 78, 68, 54, 0, 107, 69, 78, 68, 55, 0, 107, 72, 79, 77, 51, 0, 107, 72, 79, 77, - 52, 0, 107, 72, 79, 77, 53, 0, 107, 72, 79, 77, 54, 0, 107, 72, 79, 77, 55, 0, - 107, 73, 67, 51, 0, 107, 73, 67, 52, 0, 107, 73, 67, 53, 0, 107, 73, 67, 54, 0, - 107, 73, 67, 55, 0, 107, 76, 70, 84, 51, 0, 107, 76, 70, 84, 52, 0, 107, 76, 70, - 84, 53, 0, 107, 76, 70, 84, 54, 0, 107, 76, 70, 84, 55, 0, 107, 78, 88, 84, 51, - 0, 107, 78, 88, 84, 52, 0, 107, 78, 88, 84, 53, 0, 107, 78, 88, 84, 54, 0, 107, - 78, 88, 84, 55, 0, 107, 80, 82, 86, 51, 0, 107, 80, 82, 86, 52, 0, 107, 80, 82, - 86, 53, 0, 107, 80, 82, 86, 54, 0, 107, 80, 82, 86, 55, 0, 107, 82, 73, 84, 51, - 0, 107, 82, 73, 84, 52, 0, 107, 82, 73, 84, 53, 0, 107, 82, 73, 84, 54, 0, 107, - 82, 73, 84, 55, 0, 107, 85, 80, 0, 107, 85, 80, 51, 0, 107, 85, 80, 52, 0, 107, - 85, 80, 53, 0, 107, 85, 80, 54, 0, 107, 85, 80, 55, 0, 107, 97, 50, 0, 107, 98, - 49, 0, 107, 98, 51, 0, 107, 99, 50, 0 +static const char xterm_256colour_terminfo[] = { + 26, 1, 37, 0, 29, 0, 15, 0, 105, 1, -42, 5, 120, 116, 101, 114, + 109, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 120, 116, 101, 114, 109, + 32, 119, 105, 116, 104, 32, 50, 53, 54, 32, 99, 111, 108, 111, 114, 115, + 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 80, 0, + 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, 0, 0, 4, 0, + 6, 0, 8, 0, 25, 0, 30, 0, 38, 0, 42, 0, 46, 0, -1, -1, + 57, 0, 74, 0, 76, 0, 80, 0, 87, 0, -1, -1, 89, 0, 102, 0, + -1, -1, 106, 0, 110, 0, 120, 0, 124, 0, -1, -1, -1, -1,-128, 0, +-124, 0,-119, 0,-114, 0, -1, -1,-105, 0,-100, 0, -95, 0, -1, -1, + -90, 0, -85, 0, -80, 0, -75, 0, -66, 0, -62, 0, -55, 0, -1, -1, + -46, 0, -41, 0, -35, 0, -29, 0, -1, -1, -1, -1, -1, -1, -11, 0, + -1, -1, -1, -1, -1, -1, 7, 1, -1, -1, 11, 1, -1, -1, -1, -1, + -1, -1, 13, 1, -1, -1, 18, 1, -1, -1, -1, -1, -1, -1, -1, -1, + 22, 1, 26, 1, 32, 1, 36, 1, 40, 1, 44, 1, 50, 1, 56, 1, + 62, 1, 68, 1, 74, 1, 78, 1, -1, -1, 83, 1, -1, -1, 87, 1, + 92, 1, 97, 1, 101, 1, 108, 1, -1, -1, 115, 1, 119, 1, 127, 1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1,-121, 1,-112, 1, -1, -1, -1, -1,-103, 1, + -94, 1, -85, 1, -76, 1, -67, 1, -58, 1, -49, 1, -40, 1, -31, 1, + -22, 1, -1, -1, -1, -1, -1, -1, -13, 1, -9, 1, -4, 1, -1, -1, + 1, 2, 10, 2, -1, -1, -1, -1, 28, 2, 31, 2, 42, 2, 45, 2, + 47, 2, 50, 2,-113, 2, -1, -1,-110, 2, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1,-108, 2, -1, -1, -1, -1, -1, -1, -1, -1, +-104, 2, -1, -1, -51, 2, -1, -1, -1, -1, -47, 2, -41, 2, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -35, 2, -31, 2, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -27, 2, -1, -1, -1, -1, + -20, 2, -1, -1, -1, -1, -1, -1, -1, -1, -13, 2, -6, 2, 1, 3, + -1, -1, -1, -1, 8, 3, -1, -1, 15, 3, -1, -1, -1, -1, -1, -1, + 22, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 29, 3, 35, 3, + 41, 3, 48, 3, 55, 3, 62, 3, 69, 3, 77, 3, 85, 3, 93, 3, + 101, 3, 109, 3, 117, 3, 125, 3,-123, 3,-116, 3,-109, 3,-102, 3, + -95, 3, -87, 3, -79, 3, -71, 3, -63, 3, -55, 3, -47, 3, -39, 3, + -31, 3, -24, 3, -17, 3, -10, 3, -3, 3, 5, 4, 13, 4, 21, 4, + 29, 4, 37, 4, 45, 4, 53, 4, 61, 4, 68, 4, 75, 4, 82, 4, + 89, 4, 97, 4, 105, 4, 113, 4, 121, 4,-127, 4,-119, 4,-111, 4, +-103, 4, -96, 4, -89, 4, -82, 4, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -77, 4, -66, 4, -61, 4, -42, 4, -38, 4, + -29, 4, -22, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 72, 5, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 77, 5, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 83, 5, -1, -1, -1, -1, -1, -1, 87, 5,-106, 5, 27, 91, + 90, 0, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, + 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, + 91, 50, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, + 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, + 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, + 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, 49, 50, 108, 27, 91, 63, + 50, 53, 104, 0, 27, 91, 67, 0, 27, 91, 65, 0, 27, 91, 63, 49, + 50, 59, 50, 53, 104, 0, 27, 91, 80, 0, 27, 91, 77, 0, 27, 40, + 48, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 63, 49, + 48, 52, 57, 104, 0, 27, 91, 50, 109, 0, 27, 91, 52, 104, 0, 27, + 91, 56, 109, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, + 52, 109, 0, 27, 91, 37, 112, 49, 37, 100, 88, 0, 27, 40, 66, 0, + 27, 40, 66, 27, 91, 109, 0, 27, 91, 63, 49, 48, 52, 57, 108, 0, + 27, 91, 52, 108, 0, 27, 91, 50, 55, 109, 0, 27, 91, 50, 52, 109, + 0, 27, 91, 63, 53, 104, 36, 60, 49, 48, 48, 47, 62, 27, 91, 63, + 53, 108, 0, 27, 91, 33, 112, 27, 91, 63, 51, 59, 52, 108, 27, 91, + 52, 108, 27, 62, 0, 27, 91, 76, 0, 8, 0, 27, 91, 51, 126, 0, + 27, 79, 66, 0, 27, 79, 80, 0, 27, 91, 50, 49, 126, 0, 27, 79, + 81, 0, 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, 49, 53, 126, 0, + 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, + 126, 0, 27, 91, 50, 48, 126, 0, 27, 79, 72, 0, 27, 91, 50, 126, + 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, + 79, 67, 0, 27, 91, 49, 59, 50, 66, 0, 27, 91, 49, 59, 50, 65, + 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, 63, + 49, 104, 27, 61, 0, 27, 91, 63, 49, 48, 51, 52, 108, 0, 27, 91, + 63, 49, 48, 51, 52, 104, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, + 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, + 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, + 37, 100, 83, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, + 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, + 91, 37, 112, 49, 37, 100, 84, 0, 27, 91, 37, 112, 49, 37, 100, 65, + 0, 27, 91, 105, 0, 27, 91, 52, 105, 0, 27, 91, 53, 105, 0, 27, + 99, 27, 93, 49, 48, 52, 7, 0, 27, 91, 33, 112, 27, 91, 63, 51, + 59, 52, 108, 27, 91, 52, 108, 27, 62, 0, 27, 56, 0, 27, 91, 37, + 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, + 37, 63, 37, 112, 57, 37, 116, 27, 40, 48, 37, 101, 27, 40, 66, 37, + 59, 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, + 63, 37, 112, 53, 37, 116, 59, 50, 37, 59, 37, 63, 37, 112, 50, 37, + 116, 59, 52, 37, 59, 37, 63, 37, 112, 49, 37, 112, 51, 37, 124, 37, + 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, + 37, 63, 37, 112, 55, 37, 116, 59, 56, 37, 59, 109, 0, 27, 72, 0, + 9, 0, 27, 79, 69, 0, 96, 96, 97, 97, 102, 102, 103, 103, 105, 105, + 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, + 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, + 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, + 91, 63, 55, 104, 0, 27, 91, 63, 55, 108, 0, 27, 79, 70, 0, 27, + 79, 77, 0, 27, 91, 51, 59, 50, 126, 0, 27, 91, 49, 59, 50, 70, + 0, 27, 91, 49, 59, 50, 72, 0, 27, 91, 50, 59, 50, 126, 0, 27, + 91, 49, 59, 50, 68, 0, 27, 91, 54, 59, 50, 126, 0, 27, 91, 53, + 59, 50, 126, 0, 27, 91, 49, 59, 50, 67, 0, 27, 91, 50, 51, 126, + 0, 27, 91, 50, 52, 126, 0, 27, 91, 49, 59, 50, 80, 0, 27, 91, + 49, 59, 50, 81, 0, 27, 91, 49, 59, 50, 82, 0, 27, 91, 49, 59, + 50, 83, 0, 27, 91, 49, 53, 59, 50, 126, 0, 27, 91, 49, 55, 59, + 50, 126, 0, 27, 91, 49, 56, 59, 50, 126, 0, 27, 91, 49, 57, 59, + 50, 126, 0, 27, 91, 50, 48, 59, 50, 126, 0, 27, 91, 50, 49, 59, + 50, 126, 0, 27, 91, 50, 51, 59, 50, 126, 0, 27, 91, 50, 52, 59, + 50, 126, 0, 27, 91, 49, 59, 53, 80, 0, 27, 91, 49, 59, 53, 81, + 0, 27, 91, 49, 59, 53, 82, 0, 27, 91, 49, 59, 53, 83, 0, 27, + 91, 49, 53, 59, 53, 126, 0, 27, 91, 49, 55, 59, 53, 126, 0, 27, + 91, 49, 56, 59, 53, 126, 0, 27, 91, 49, 57, 59, 53, 126, 0, 27, + 91, 50, 48, 59, 53, 126, 0, 27, 91, 50, 49, 59, 53, 126, 0, 27, + 91, 50, 51, 59, 53, 126, 0, 27, 91, 50, 52, 59, 53, 126, 0, 27, + 91, 49, 59, 54, 80, 0, 27, 91, 49, 59, 54, 81, 0, 27, 91, 49, + 59, 54, 82, 0, 27, 91, 49, 59, 54, 83, 0, 27, 91, 49, 53, 59, + 54, 126, 0, 27, 91, 49, 55, 59, 54, 126, 0, 27, 91, 49, 56, 59, + 54, 126, 0, 27, 91, 49, 57, 59, 54, 126, 0, 27, 91, 50, 48, 59, + 54, 126, 0, 27, 91, 50, 49, 59, 54, 126, 0, 27, 91, 50, 51, 59, + 54, 126, 0, 27, 91, 50, 52, 59, 54, 126, 0, 27, 91, 49, 59, 51, + 80, 0, 27, 91, 49, 59, 51, 81, 0, 27, 91, 49, 59, 51, 82, 0, + 27, 91, 49, 59, 51, 83, 0, 27, 91, 49, 53, 59, 51, 126, 0, 27, + 91, 49, 55, 59, 51, 126, 0, 27, 91, 49, 56, 59, 51, 126, 0, 27, + 91, 49, 57, 59, 51, 126, 0, 27, 91, 50, 48, 59, 51, 126, 0, 27, + 91, 50, 49, 59, 51, 126, 0, 27, 91, 50, 51, 59, 51, 126, 0, 27, + 91, 50, 52, 59, 51, 126, 0, 27, 91, 49, 59, 52, 80, 0, 27, 91, + 49, 59, 52, 81, 0, 27, 91, 49, 59, 52, 82, 0, 27, 91, 49, 75, + 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, + 0, 27, 91, 63, 37, 91, 59, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 93, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, 52, 57, 109, + 0, 27, 93, 49, 48, 52, 7, 0, 27, 93, 52, 59, 37, 112, 49, 37, + 100, 59, 114, 103, 98, 58, 37, 112, 50, 37, 123, 50, 53, 53, 125, 37, + 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 50, 46, 50, 88, 47, + 37, 112, 51, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, + 48, 125, 37, 47, 37, 50, 46, 50, 88, 47, 37, 112, 52, 37, 123, 50, + 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 50, + 46, 50, 88, 27, 92, 0, 27, 91, 51, 109, 0, 27, 91, 50, 51, 109, + 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, + 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, + 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, 125, + 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, 49, 37, 100, + 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, + 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, + 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, 125, + 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, + 37, 59, 109, 0 }; // Taken from unibilium/t/static_tmux.c as of 2015-08-14. // This is an 256-colour terminfo description that lacks @@ -1799,6 +1781,150 @@ static const char interix_8colour_terminfo[] = { 39, 37, 43, 37, 100, 109, 0, 27, 91, 51, 37, 112, 49, 37, 100, 109, 0, 27, 91, 52, 37, 112, 49, 37, 100, 109, 0 }; // Taken from Dickey ncurses terminfo.src dated 2017-04-22. +static const char st_256colour_terminfo[] = { + 26, 1, 55, 0, 29, 0, 15, 0, 105, 1, 117, 5, 115, 116, 45, 50, + 53, 54, 99, 111, 108, 111, 114, 124, 115, 116, 116, 101, 114, 109, 45, 50, + 53, 54, 99, 111, 108, 111, 114, 124, 115, 105, 109, 112, 108, 101, 116, 101, + 114, 109, 32, 119, 105, 116, 104, 32, 50, 53, 54, 32, 99, 111, 108, 111, + 114, 115, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, + 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, 0, 0, + 4, 0, 6, 0, 8, 0, 25, 0, 30, 0, 38, 0, 42, 0, 46, 0, + -1, -1, 57, 0, 74, 0, 76, 0, 80, 0, 87, 0, -1, -1, 89, 0, + 102, 0, -1, -1, 106, 0, 110, 0, 117, 0, 121, 0, -1, -1, -1, -1, + 125, 0,-127, 0,-122, 0,-117, 0, -1, -1, -1, -1,-108, 0,-103, 0, + -1, -1, -98, 0, -93, 0, -88, 0, -83, 0, -74, 0, -70, 0, -65, 0, + -1, -1, -56, 0, -51, 0, -45, 0, -39, 0, -1, -1, -21, 0, -1, -1, + -19, 0, -1, -1, -1, -1, -1, -1, -4, 0, -1, -1, 0, 1, -1, -1, + 2, 1, -1, -1, 9, 1, 14, 1, 21, 1, 25, 1, 32, 1, 39, 1, + -1, -1, 46, 1, 50, 1, 56, 1, 60, 1, 64, 1, 68, 1, 74, 1, + 80, 1, 86, 1, 92, 1, 98, 1, 103, 1, 108, 1, 115, 1, -1, -1, + 119, 1, 124, 1,-127, 1,-123, 1,-116, 1, -1, -1,-109, 1,-105, 1, + -97, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -89, 1, -80, 1, -71, 1, -62, 1, -53, 1, -44, 1, -35, 1, -26, 1, + -1, -1, -17, 1, -1, -1, -1, -1, -1, -1, -8, 1, -4, 1, 1, 2, + -1, -1, 6, 2, 9, 2, -1, -1, -1, -1, 24, 2, 27, 2, 38, 2, + 41, 2, 43, 2, 46, 2,-128, 2, -1, -1,-125, 2,-123, 2, -1, -1, + -1, -1, -1, -1,-118, 2,-113, 2,-108, 2,-104, 2, -99, 2, -1, -1, + -1, -1, -94, 2, -1, -1, -29, 2, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -25, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -21, 2, -16, 2, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -12, 2, -1, -1, + -1, -1, -5, 2, -1, -1, -1, -1, -1, -1, -1, -1, 2, 3, 9, 3, + 16, 3, -1, -1, -1, -1, 23, 3, -1, -1, 30, 3, -1, -1, -1, -1, + -1, -1, 37, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 44, 3, + 50, 3, 56, 3, 63, 3, 70, 3, 77, 3, 84, 3, 92, 3, 100, 3, + 108, 3, 116, 3, 124, 3,-124, 3,-116, 3,-108, 3,-101, 3, -94, 3, + -87, 3, -80, 3, -72, 3, -64, 3, -56, 3, -48, 3, -40, 3, -32, 3, + -24, 3, -16, 3, -9, 3, -2, 3, 5, 4, 12, 4, 20, 4, 28, 4, + 36, 4, 44, 4, 52, 4, 60, 4, 68, 4, 76, 4, 83, 4, 90, 4, + 97, 4, 104, 4, 112, 4, 120, 4,-128, 4,-120, 4,-112, 4,-104, 4, + -96, 4, -88, 4, -81, 4, -74, 4, -67, 4, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -62, 4, -51, 4, -46, 4, -38, 4, + -34, 4, -2, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -25, 4, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -20, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -14, 4, -1, -1, -1, -1, -1, -1, -10, 4, 53, 5, + 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, + 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, + 72, 27, 91, 50, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, + 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, + 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, + 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, 49, 50, 108, 27, + 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, 27, 91, 65, 0, 27, 91, + 63, 50, 53, 104, 0, 27, 91, 80, 0, 27, 91, 77, 0, 27, 40, 48, + 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 63, 49, 48, + 52, 57, 104, 0, 27, 91, 52, 104, 0, 27, 91, 56, 109, 0, 27, 91, + 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, 37, + 112, 49, 37, 100, 88, 0, 27, 40, 66, 0, 27, 91, 48, 109, 0, 27, + 91, 63, 49, 48, 52, 57, 108, 0, 27, 91, 52, 108, 0, 27, 91, 50, + 55, 109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, 104, 36, 60, + 49, 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 7, 0, 27, 91, 52, + 108, 27, 62, 27, 91, 63, 49, 48, 51, 52, 108, 0, 27, 91, 76, 0, + 127, 0, 27, 91, 51, 59, 53, 126, 0, 27, 91, 51, 126, 0, 27, 91, + 51, 59, 50, 126, 0, 27, 79, 66, 0, 27, 91, 50, 59, 50, 126, 0, + 27, 91, 49, 59, 50, 70, 0, 27, 91, 49, 59, 53, 70, 0, 27, 79, + 80, 0, 27, 91, 50, 49, 126, 0, 27, 79, 81, 0, 27, 79, 82, 0, + 27, 79, 83, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, + 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, + 126, 0, 27, 91, 49, 126, 0, 27, 91, 50, 126, 0, 27, 91, 50, 59, + 53, 126, 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, + 0, 27, 79, 67, 0, 27, 91, 49, 59, 50, 66, 0, 27, 91, 49, 59, + 50, 65, 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, + 91, 63, 49, 104, 27, 61, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, + 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, + 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, + 37, 100, 83, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, + 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, + 91, 37, 112, 49, 37, 100, 65, 0, 27, 91, 105, 0, 27, 91, 52, 105, + 0, 27, 91, 53, 105, 0, 27, 99, 0, 27, 91, 52, 108, 27, 62, 27, + 91, 63, 49, 48, 51, 52, 108, 0, 27, 56, 0, 27, 91, 37, 105, 37, + 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, 37, 63, + 37, 112, 57, 37, 116, 27, 40, 48, 37, 101, 27, 40, 66, 37, 59, 27, + 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, + 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 49, 37, 112, 51, + 37, 124, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, + 53, 37, 59, 37, 63, 37, 112, 55, 37, 116, 59, 56, 37, 59, 109, 0, + 27, 72, 0, 9, 0, 27, 93, 48, 59, 0, 27, 91, 49, 126, 0, 27, + 91, 53, 126, 0, 27, 79, 117, 0, 27, 91, 52, 126, 0, 27, 91, 54, + 126, 0, 43, 67, 44, 68, 45, 65, 46, 66, 48, 69, 96, 96, 97, 97, + 102, 102, 103, 103, 104, 70, 105, 71, 106, 106, 107, 107, 108, 108, 109, 109, + 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, + 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, + 126, 126, 0, 27, 91, 90, 0, 27, 41, 48, 0, 27, 91, 52, 126, 0, + 27, 79, 77, 0, 27, 91, 51, 59, 50, 126, 0, 27, 91, 49, 59, 50, + 70, 0, 27, 91, 49, 59, 50, 72, 0, 27, 91, 50, 59, 50, 126, 0, + 27, 91, 49, 59, 50, 68, 0, 27, 91, 54, 59, 50, 126, 0, 27, 91, + 53, 59, 50, 126, 0, 27, 91, 49, 59, 50, 67, 0, 27, 91, 50, 51, + 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 49, 59, 50, 80, 0, 27, + 91, 49, 59, 50, 81, 0, 27, 91, 49, 59, 50, 82, 0, 27, 91, 49, + 59, 50, 83, 0, 27, 91, 49, 53, 59, 50, 126, 0, 27, 91, 49, 55, + 59, 50, 126, 0, 27, 91, 49, 56, 59, 50, 126, 0, 27, 91, 49, 57, + 59, 50, 126, 0, 27, 91, 50, 48, 59, 50, 126, 0, 27, 91, 50, 49, + 59, 50, 126, 0, 27, 91, 50, 51, 59, 50, 126, 0, 27, 91, 50, 52, + 59, 50, 126, 0, 27, 91, 49, 59, 53, 80, 0, 27, 91, 49, 59, 53, + 81, 0, 27, 91, 49, 59, 53, 82, 0, 27, 91, 49, 59, 53, 83, 0, + 27, 91, 49, 53, 59, 53, 126, 0, 27, 91, 49, 55, 59, 53, 126, 0, + 27, 91, 49, 56, 59, 53, 126, 0, 27, 91, 49, 57, 59, 53, 126, 0, + 27, 91, 50, 48, 59, 53, 126, 0, 27, 91, 50, 49, 59, 53, 126, 0, + 27, 91, 50, 51, 59, 53, 126, 0, 27, 91, 50, 52, 59, 53, 126, 0, + 27, 91, 49, 59, 54, 80, 0, 27, 91, 49, 59, 54, 81, 0, 27, 91, + 49, 59, 54, 82, 0, 27, 91, 49, 59, 54, 83, 0, 27, 91, 49, 53, + 59, 54, 126, 0, 27, 91, 49, 55, 59, 54, 126, 0, 27, 91, 49, 56, + 59, 54, 126, 0, 27, 91, 49, 57, 59, 54, 126, 0, 27, 91, 50, 48, + 59, 54, 126, 0, 27, 91, 50, 49, 59, 54, 126, 0, 27, 91, 50, 51, + 59, 54, 126, 0, 27, 91, 50, 52, 59, 54, 126, 0, 27, 91, 49, 59, + 51, 80, 0, 27, 91, 49, 59, 51, 81, 0, 27, 91, 49, 59, 51, 82, + 0, 27, 91, 49, 59, 51, 83, 0, 27, 91, 49, 53, 59, 51, 126, 0, + 27, 91, 49, 55, 59, 51, 126, 0, 27, 91, 49, 56, 59, 51, 126, 0, + 27, 91, 49, 57, 59, 51, 126, 0, 27, 91, 50, 48, 59, 51, 126, 0, + 27, 91, 50, 49, 59, 51, 126, 0, 27, 91, 50, 51, 59, 51, 126, 0, + 27, 91, 50, 52, 59, 51, 126, 0, 27, 91, 49, 59, 52, 80, 0, 27, + 91, 49, 59, 52, 81, 0, 27, 91, 49, 59, 52, 82, 0, 27, 91, 49, + 75, 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, + 110, 0, 27, 91, 63, 49, 59, 50, 99, 0, 27, 91, 99, 0, 27, 91, + 51, 57, 59, 52, 57, 109, 0, 27, 91, 51, 109, 0, 27, 91, 50, 51, + 109, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, + 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, + 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, + 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, 49, 37, + 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, + 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, + 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, + 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, + 100, 37, 59, 109, 0 +}; +// Taken from Dickey ncurses terminfo.src dated 2017-04-22. static const char ansi_terminfo[] = { 26, 1, 40, 0, 23, 0, 16, 0, 125, 1, 68, 2, 97, 110, 115, 105, 124, 97, 110, 115, 105, 47, 112, 99, 45, 116, 101, 114, 109, 32, 99, 111, 109, 112, 97, 116, 105, 98, 108, 101, 32, 119, 105, 116, 104, 32, 99, 111, 108, 111, 114, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1856,7 +1982,7 @@ static const char ansi_terminfo[] = { static unibi_term *load_builtin_terminfo(const char * term) { if (term && STARTS_WITH(term, "xterm")) { - return unibi_from_mem(xterm_8colour_terminfo, sizeof xterm_8colour_terminfo); + return unibi_from_mem(xterm_256colour_terminfo, sizeof xterm_256colour_terminfo); } else if (term && STARTS_WITH(term, "screen")) { return unibi_from_mem(screen_256colour_terminfo, sizeof screen_256colour_terminfo); } else if (term && STARTS_WITH(term, "tmux")) { @@ -1871,6 +1997,8 @@ static unibi_term *load_builtin_terminfo(const char * term) return unibi_from_mem(interix_8colour_terminfo, sizeof interix_8colour_terminfo); } else if (term && (STARTS_WITH(term, "iterm") || STARTS_WITH(term, "iTerm"))) { return unibi_from_mem(iterm_16colour_terminfo, sizeof iterm_16colour_terminfo); + } else if (term && STARTS_WITH(term, "st")) { + return unibi_from_mem(st_256colour_terminfo, sizeof st_256colour_terminfo); } else { return unibi_from_mem(ansi_terminfo, sizeof ansi_terminfo); } From 67e2120459268494c589cc5be6a20b05fdd9ca84 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sat, 27 May 2017 10:36:20 +0100 Subject: [PATCH 026/161] tui: Refactor built-in teminfo records. No change to their contents, but make the Big Blocks Of Numbers half as wide but twice as deep, in order to accomodate house style. --- src/nvim/tui/tui.c | 992 ++++++++++++++++++++++++++++++--------------- 1 file changed, 661 insertions(+), 331 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 0f3b046dc6..58c9e75de8 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1480,305 +1480,590 @@ static const char screen_256colour_terminfo[] = { }; // Taken from Dickey ncurses terminfo.src dated 2017-04-22. static const char iterm_16colour_terminfo[] = { - 26, 1, 57, 0, 29, 0, 15, 0, 105, 1, 73, 3, 105, 84, 101, 114, 109, 46, 97, 112, 112, 124, 105, 116, 101, 114, 109, 124, 105, 84, 101, 114, -109, 46, 97, 112, 112, 32, 116, 101, 114, 109, 105, 110, 97, 108, 32, 101, 109, 117, 108, 97, 116, 111, 114, 32, 102, 111, 114, 32, 77, 97, 99, 32, - 79, 83, 32, 88, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, 50, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, - -1, -1, 0, 0, 2, 0, -2, -1, 4, 0, 9, 0, 16, 0, 20, 0, 24, 0, -1, -1, 35, 0, 52, 0, 54, 0, 58, 0, 65, 0, -1, -1, - 67, 0, 74, 0, -1, -1, 78, 0, -1, -1, 82, 0, 86, 0, 90, 0, -1, -1, 96, 0, 98, 0, 103, 0, 108, 0, -1, -1, -2, -1, 117, 0, -122, 0, -1, -1, 127, 0,-124, 0,-119, 0, -1, -1,-114, 0,-112, 0,-107, 0, -1, -1, -94, 0, -89, 0, -85, 0, -81, 0, -1, -1, -63, 0, - -1, -1, -1, -1, -1, -1, -1, -1, -61, 0, -57, 0, -1, -1, -53, 0, -1, -1, -1, -1, -1, -1, -51, 0, -1, -1, -46, 0, -1, -1, -1, -1, - -1, -1, -1, -1, -42, 0, -38, 0, -32, 0, -28, 0, -24, 0, -20, 0, -14, 0, -8, 0, -2, 0, 4, 1, 10, 1, -1, -1, -1, -1, 14, 1, - -1, -1, 18, 1, 23, 1, 28, 1, -1, -1, -1, -1, -1, -1, 32, 1, 36, 1, 44, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, 1, 61, 1, 70, 1, 79, 1, -1, -1, 88, 1, 97, 1, -106, 1, -1, -1, 115, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 124, 1, -1, -1, -1, -1,-104, 1,-101, 1, --90, 1, -87, 1, -85, 1, -82, 1, -4, 1, -1, -1, -1, 1, 1, 2, -1, -1, -1, -1, -1, -1, 6, 2, 10, 2, 14, 2, 18, 2, 22, 2, - -1, -1, -1, -1, 26, 2, -1, -1, -1, -1, -1, -1, -1, -1, 77, 2, 83, 2, -1, -1, -1, -1, 89, 2, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 96, 2, 100, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 104, 2, 110, 2, 116, 2, 122, 2,-128, 2,-122, 2,-116, 2,-110, 2, -104, 2, -98, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -92, 2, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -87, 2, -76, 2, -71, 2, -63, 2, -59, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -54, 2, 9, 3, 7, 0, 13, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, - 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, -112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, - 27, 91, 65, 0, 27, 91, 80, 0, 27, 91, 77, 0, 27, 93, 50, 59, 7, 0, 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 55, - 27, 91, 63, 52, 55, 104, 0, 27, 91, 52, 104, 0, 27, 91, 56, 109, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, - 15, 0, 27, 91, 109, 15, 0, 27, 91, 50, 74, 27, 91, 63, 52, 55, 108, 27, 56, 0, 27, 91, 52, 108, 0, 27, 91, 109, 0, 27, 91, 109, - 0, 27, 91, 63, 53, 104, 36, 60, 50, 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 7, 0, 27, 91, 64, 0, 27, 91, 76, 0, 127, 0, 27, - 91, 51, 126, 0, 27, 79, 66, 0, 27, 79, 80, 0, 27, 91, 50, 49, 126, 0, 27, 79, 81, 0, 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, - 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 79, 72, 0, - 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 79, 67, 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, - 63, 49, 104, 27, 61, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, - 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, - 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 62, 27, 91, 63, 51, 108, 27, 91, 63, 52, 108, 27, 91, 63, 53, 108, 27, - 91, 63, 55, 104, 27, 91, 63, 56, 104, 0, 27, 56, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, - 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 49, 37, 112, - 51, 37, 124, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 37, 63, 37, 112, 55, 37, 116, 59, 56, 37, 59, 109, - 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, 9, 0, 27, 93, 50, 59, 0, 27, 79, 113, 0, 27, 79, 115, 0, - 27, 79, 114, 0, 27, 79, 112, 0, 27, 79, 110, 0, 96, 96, 97, 97, 102, 102, 103, 103, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, -112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, - 91, 63, 55, 104, 0, 27, 91, 63, 55, 108, 0, 27, 40, 66, 27, 41, 48, 0, 27, 79, 70, 0, 27, 79, 77, 0, 27, 91, 50, 51, 126, 0, - 27, 91, 50, 52, 126, 0, 27, 91, 50, 53, 126, 0, 27, 91, 50, 54, 126, 0, 27, 91, 50, 56, 126, 0, 27, 91, 50, 57, 126, 0, 27, 91, - 51, 49, 126, 0, 27, 91, 50, 50, 126, 0, 27, 91, 51, 51, 126, 0, 27, 91, 51, 52, 126, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, -100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 49, 59, 50, 99, 0, 27, 91, 99, 0, 27, 91, 48, 109, 0, 27, 91, 37, 63, - 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, - 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, -112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, - 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0 + 26, 1, 57, 0, 29, 0, 15, 0, 105, 1, 73, 3, 105, 84, 101, 114, + 109, 46, 97, 112, 112, 124, 105, 116, 101, 114, 109, 124, 105, 84, 101, 114, + 109, 46, 97, 112, 112, 32, 116, 101, 114, 109, 105, 110, 97, 108, 32, 101, + 109, 117, 108, 97, 116, 111, 114, 32, 102, 111, 114, 32, 77, 97, 99, 32, + 79, 83, 32, 88, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, + 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, + 0, 1, 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, + 50, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, + -1, -1, 0, 0, 2, 0, -2, -1, 4, 0, 9, 0, 16, 0, 20, 0, + 24, 0, -1, -1, 35, 0, 52, 0, 54, 0, 58, 0, 65, 0, -1, -1, + 67, 0, 74, 0, -1, -1, 78, 0, -1, -1, 82, 0, 86, 0, 90, 0, + -1, -1, 96, 0, 98, 0, 103, 0, 108, 0, -1, -1, -2, -1, 117, 0, + 122, 0, -1, -1, 127, 0,-124, 0,-119, 0, -1, -1,-114, 0,-112, 0, +-107, 0, -1, -1, -94, 0, -89, 0, -85, 0, -81, 0, -1, -1, -63, 0, + -1, -1, -1, -1, -1, -1, -1, -1, -61, 0, -57, 0, -1, -1, -53, 0, + -1, -1, -1, -1, -1, -1, -51, 0, -1, -1, -46, 0, -1, -1, -1, -1, + -1, -1, -1, -1, -42, 0, -38, 0, -32, 0, -28, 0, -24, 0, -20, 0, + -14, 0, -8, 0, -2, 0, 4, 1, 10, 1, -1, -1, -1, -1, 14, 1, + -1, -1, 18, 1, 23, 1, 28, 1, -1, -1, -1, -1, -1, -1, 32, 1, + 36, 1, 44, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 52, 1, 61, 1, 70, 1, 79, 1, -1, -1, 88, 1, 97, 1, + 106, 1, -1, -1, 115, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 124, 1, -1, -1, -1, -1,-104, 1,-101, 1, + -90, 1, -87, 1, -85, 1, -82, 1, -4, 1, -1, -1, -1, 1, 1, 2, + -1, -1, -1, -1, -1, -1, 6, 2, 10, 2, 14, 2, 18, 2, 22, 2, + -1, -1, -1, -1, 26, 2, -1, -1, -1, -1, -1, -1, -1, -1, 77, 2, + 83, 2, -1, -1, -1, -1, 89, 2, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 96, 2, 100, 2, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 104, 2, 110, 2, 116, 2, 122, 2,-128, 2,-122, 2,-116, 2,-110, 2, + 104, 2, -98, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -92, 2, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -87, 2, -76, 2, -71, 2, + -63, 2, -59, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -54, 2, + 9, 3, 7, 0, 13, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, + 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, + 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, + 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, + 53, 108, 0, 8, 0, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, + 27, 91, 65, 0, 27, 91, 80, 0, 27, 91, 77, 0, 27, 93, 50, 59, + 7, 0, 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 55, + 27, 91, 63, 52, 55, 104, 0, 27, 91, 52, 104, 0, 27, 91, 56, 109, + 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, + 15, 0, 27, 91, 109, 15, 0, 27, 91, 50, 74, 27, 91, 63, 52, 55, + 108, 27, 56, 0, 27, 91, 52, 108, 0, 27, 91, 109, 0, 27, 91, 109, + 0, 27, 91, 63, 53, 104, 36, 60, 50, 48, 48, 47, 62, 27, 91, 63, + 53, 108, 0, 7, 0, 27, 91, 64, 0, 27, 91, 76, 0, 127, 0, 27, + 91, 51, 126, 0, 27, 79, 66, 0, 27, 79, 80, 0, 27, 91, 50, 49, + 126, 0, 27, 79, 81, 0, 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, + 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, + 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 79, 72, 0, + 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 79, + 67, 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, + 63, 49, 104, 27, 61, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, + 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, + 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, + 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, + 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 62, + 27, 91, 63, 51, 108, 27, 91, 63, 52, 108, 27, 91, 63, 53, 108, 27, + 91, 63, 55, 104, 27, 91, 63, 56, 104, 0, 27, 56, 0, 27, 91, 37, + 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, + 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, + 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 49, 37, 112, + 51, 37, 124, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, + 59, 53, 37, 59, 37, 63, 37, 112, 55, 37, 116, 59, 56, 37, 59, 109, + 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, + 0, 9, 0, 27, 93, 50, 59, 0, 27, 79, 113, 0, 27, 79, 115, 0, + 27, 79, 114, 0, 27, 79, 112, 0, 27, 79, 110, 0, 96, 96, 97, 97, + 102, 102, 103, 103, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, + 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, + 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, + 91, 63, 55, 104, 0, 27, 91, 63, 55, 108, 0, 27, 40, 66, 27, 41, + 48, 0, 27, 79, 70, 0, 27, 79, 77, 0, 27, 91, 50, 51, 126, 0, + 27, 91, 50, 52, 126, 0, 27, 91, 50, 53, 126, 0, 27, 91, 50, 54, + 126, 0, 27, 91, 50, 56, 126, 0, 27, 91, 50, 57, 126, 0, 27, 91, + 51, 49, 126, 0, 27, 91, 50, 50, 126, 0, 27, 91, 51, 51, 126, 0, + 27, 91, 51, 52, 126, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, + 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 49, 59, + 50, 99, 0, 27, 91, 99, 0, 27, 91, 48, 109, 0, 27, 91, 37, 63, + 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, + 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, + 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, + 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, + 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, + 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, + 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, + 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0 }; // Taken from Dickey ncurses terminfo.src dated 2017-04-22. static const char rxvt_256colour_terminfo[] = { - 26, 1, 47, 0, 29, 0, 15, 0, 110, 1, -31, 4, 114, 120, 118, 116, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 114, 120, 118, 116, 32, 50, - 46, 55, 46, 57, 32, 119, 105, 116, 104, 32, 120, 116, 101, 114, 109, 32, 50, 53, 54, 45, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, - 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 80, 0, 8, 0, 24, 0, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, -1, -1, 0, 0, 2, 0, 4, 0, 21, 0, - 26, 0, 34, 0, 38, 0, 42, 0, -1, -1, 53, 0, 70, 0, 72, 0, 76, 0, 83, 0, -1, -1, 85, 0, 92, 0, -1, -1, 96, 0, -1, -1, - -1, -1, 100, 0, -1, -1, -1, -1, 104, 0, 106, 0, 111, 0, 116, 0, -1, -1, -1, -1, 125, 0, -1, -1, -1, -1,-126, 0,-121, 0,-116, 0, - -1, -1,-111, 0,-109, 0,-104, 0, -1, -1, -91, 0, -86, 0, -80, 0, -74, 0, -1, -1, -1, -1, -56, 0, -42, 0, -1, -1, -1, -1, -8, 0, - -4, 0, -1, -1, 0, 1, -1, -1, -1, -1, -1, -1, 2, 1, -1, -1, 7, 1, -1, -1, 11, 1, -1, -1, 16, 1, 22, 1, 28, 1, 34, 1, - 40, 1, 46, 1, 52, 1, 58, 1, 64, 1, 70, 1, 76, 1, 82, 1, 87, 1, -1, -1, 92, 1, -1, -1, 96, 1, 101, 1, 106, 1, 110, 1, -114, 1, -1, -1, 118, 1, 122, 1, 125, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,-128, 1,-119, 1,-110, 1, -1, -1,-101, 1, -92, 1, -83, 1, -1, -1, -74, 1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -65, 1, -32, 1, -1, -1, -1, -1, 18, 2, 21, 2, 32, 2, 35, 2, 37, 2, 40, 2, 107, 2, - -1, -1, 110, 2, -1, -1, -1, -1, -1, -1, -1, -1, 112, 2, 116, 2, 120, 2, 124, 2,-128, 2, -1, -1, -1, -1,-124, 2, -1, -1, -73, 2, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -69, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -62, 2, --57, 2, -1, -1, -53, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -48, 2, -1, -1, -43, 2, -38, 2, -1, -1, -1, -1, - -1, -1, -1, -1, -33, 2, -28, 2, -23, 2, -1, -1, -1, -1, -19, 2, -1, -1, -14, 2, -1, -1, -1, -1, -1, -1, -9, 2, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -5, 2, 1, 3, 7, 3, 13, 3, 19, 3, 25, 3, 31, 3, 37, 3, 43, 3, 49, 3, 55, 3, 61, 3, 67, 3, - 73, 3, 79, 3, 85, 3, 91, 3, 97, 3, 103, 3, 109, 3, 115, 3, 121, 3, 127, 3,-123, 3,-117, 3,-111, 3,-105, 3, -99, 3, -93, 3, --87, 3, -81, 3, -75, 3, -69, 3, -63, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -57, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, --52, 3, -41, 3, -36, 3, -28, 3, -24, 3, -15, 3, -8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 86, 4, -1, -1, - -1, -1, -1, -1, 90, 4,-103, 4, -1, -1, -1, -1, -1, -1, -39, 4, -35, 4, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, - 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 50, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, - 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, - 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, 27, 91, 65, 0, 27, 91, 77, 0, 14, 0, 27, 91, 53, 109, - 0, 27, 91, 49, 109, 0, 27, 55, 27, 91, 63, 52, 55, 104, 0, 27, 91, 52, 104, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, - 52, 109, 0, 15, 0, 27, 91, 109, 15, 0, 27, 91, 50, 74, 27, 91, 63, 52, 55, 108, 27, 56, 0, 27, 91, 52, 108, 0, 27, 91, 50, 55, -109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, 104, 36, 60, 49, 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 27, 91, 63, 52, 55, 108, - 27, 61, 27, 91, 63, 49, 108, 0, 27, 91, 114, 27, 91, 109, 27, 91, 50, 74, 27, 91, 72, 27, 91, 63, 55, 104, 27, 91, 63, 49, 59, 51, - 59, 52, 59, 54, 108, 27, 91, 52, 108, 0, 27, 91, 64, 0, 27, 91, 76, 0, 8, 0, 27, 91, 51, 126, 0, 27, 91, 66, 0, 27, 91, 56, - 94, 0, 27, 91, 50, 49, 126, 0, 27, 91, 49, 49, 126, 0, 27, 91, 50, 49, 126, 0, 27, 91, 49, 50, 126, 0, 27, 91, 49, 51, 126, 0, - 27, 91, 49, 52, 126, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, - 50, 48, 126, 0, 27, 91, 55, 126, 0, 27, 91, 50, 126, 0, 27, 91, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 91, 67, 0, - 27, 91, 97, 0, 27, 91, 98, 0, 27, 91, 65, 0, 27, 62, 0, 27, 61, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, - 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, - 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 62, 27, 91, 49, 59, 51, 59, 52, 59, 53, 59, 54, 108, 27, - 91, 63, 55, 104, 27, 91, 109, 27, 91, 114, 27, 91, 50, 74, 27, 91, 72, 0, 27, 91, 114, 27, 91, 109, 27, 91, 50, 74, 27, 91, 72, 27, - 91, 63, 55, 104, 27, 91, 63, 49, 59, 51, 59, 52, 59, 54, 108, 27, 91, 52, 108, 27, 62, 27, 91, 63, 49, 48, 48, 48, 108, 27, 91, 63, - 50, 53, 104, 0, 27, 56, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, 27, 91, 48, 37, 63, 37, -112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 49, 37, 112, 51, 37, 124, 37, 116, 59, - 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 109, 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, - 9, 0, 27, 79, 119, 0, 27, 79, 121, 0, 27, 79, 117, 0, 27, 79, 113, 0, 27, 79, 115, 0, 96, 96, 97, 97, 102, 102, 103, 103, 106, 106, -107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, -123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 40, 66, 27, 41, 48, 0, 27, 91, 56, 126, 0, 27, 79, 77, 0, 27, 91, 49, -126, 0, 27, 91, 51, 36, 0, 27, 91, 52, 126, 0, 27, 91, 56, 36, 0, 27, 91, 55, 36, 0, 27, 91, 50, 36, 0, 27, 91, 100, 0, 27, - 91, 54, 36, 0, 27, 91, 53, 36, 0, 27, 91, 99, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 50, 53, 126, 0, 27, - 91, 50, 54, 126, 0, 27, 91, 50, 56, 126, 0, 27, 91, 50, 57, 126, 0, 27, 91, 51, 49, 126, 0, 27, 91, 51, 50, 126, 0, 27, 91, 51, - 51, 126, 0, 27, 91, 51, 52, 126, 0, 27, 91, 50, 51, 36, 0, 27, 91, 50, 52, 36, 0, 27, 91, 49, 49, 94, 0, 27, 91, 49, 50, 94, - 0, 27, 91, 49, 51, 94, 0, 27, 91, 49, 52, 94, 0, 27, 91, 49, 53, 94, 0, 27, 91, 49, 55, 94, 0, 27, 91, 49, 56, 94, 0, 27, - 91, 49, 57, 94, 0, 27, 91, 50, 48, 94, 0, 27, 91, 50, 49, 94, 0, 27, 91, 50, 51, 94, 0, 27, 91, 50, 52, 94, 0, 27, 91, 50, - 53, 94, 0, 27, 91, 50, 54, 94, 0, 27, 91, 50, 56, 94, 0, 27, 91, 50, 57, 94, 0, 27, 91, 51, 49, 94, 0, 27, 91, 51, 50, 94, - 0, 27, 91, 51, 51, 94, 0, 27, 91, 51, 52, 94, 0, 27, 91, 50, 51, 64, 0, 27, 91, 50, 52, 64, 0, 27, 91, 49, 75, 0, 27, 91, - 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 49, 59, 50, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, 52, - 57, 109, 0, 27, 93, 49, 48, 52, 7, 0, 27, 93, 52, 59, 37, 112, 49, 37, 100, 59, 114, 103, 98, 58, 37, 112, 50, 37, 123, 50, 53, 53, -125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 50, 46, 50, 88, 47, 37, 112, 51, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, - 48, 48, 48, 125, 37, 47, 37, 50, 46, 50, 88, 47, 37, 112, 52, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, - 37, 50, 46, 50, 88, 27, 92, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, -100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, - 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, - 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, - 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 40, 66, 0, 27, 40, 48, 0 + 26, 1, 47, 0, 29, 0, 15, 0, 110, 1, -31, 4, 114, 120, 118, 116, + 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 114, 120, 118, 116, 32, 50, + 46, 55, 46, 57, 32, 119, 105, 116, 104, 32, 120, 116, 101, 114, 109, 32, + 50, 53, 54, 45, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, + 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, + 0, 0, 0, 0, 0, 0, 1, 1, 80, 0, 8, 0, 24, 0, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 0, 1, -1, 127, -1, -1, 0, 0, 2, 0, 4, 0, 21, 0, + 26, 0, 34, 0, 38, 0, 42, 0, -1, -1, 53, 0, 70, 0, 72, 0, + 76, 0, 83, 0, -1, -1, 85, 0, 92, 0, -1, -1, 96, 0, -1, -1, + -1, -1, 100, 0, -1, -1, -1, -1, 104, 0, 106, 0, 111, 0, 116, 0, + -1, -1, -1, -1, 125, 0, -1, -1, -1, -1,-126, 0,-121, 0,-116, 0, + -1, -1,-111, 0,-109, 0,-104, 0, -1, -1, -91, 0, -86, 0, -80, 0, + -74, 0, -1, -1, -1, -1, -56, 0, -42, 0, -1, -1, -1, -1, -8, 0, + -4, 0, -1, -1, 0, 1, -1, -1, -1, -1, -1, -1, 2, 1, -1, -1, + 7, 1, -1, -1, 11, 1, -1, -1, 16, 1, 22, 1, 28, 1, 34, 1, + 40, 1, 46, 1, 52, 1, 58, 1, 64, 1, 70, 1, 76, 1, 82, 1, + 87, 1, -1, -1, 92, 1, -1, -1, 96, 1, 101, 1, 106, 1, 110, 1, + 114, 1, -1, -1, 118, 1, 122, 1, 125, 1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,-128, 1,-119, 1,-110, 1, + -1, -1,-101, 1, -92, 1, -83, 1, -1, -1, -74, 1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -65, 1, -32, 1, -1, -1, + -1, -1, 18, 2, 21, 2, 32, 2, 35, 2, 37, 2, 40, 2, 107, 2, + -1, -1, 110, 2, -1, -1, -1, -1, -1, -1, -1, -1, 112, 2, 116, 2, + 120, 2, 124, 2,-128, 2, -1, -1, -1, -1,-124, 2, -1, -1, -73, 2, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -69, 2, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -62, 2, + -57, 2, -1, -1, -53, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -48, 2, -1, -1, -43, 2, -38, 2, -1, -1, -1, -1, + -1, -1, -1, -1, -33, 2, -28, 2, -23, 2, -1, -1, -1, -1, -19, 2, + -1, -1, -14, 2, -1, -1, -1, -1, -1, -1, -9, 2, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -5, 2, 1, 3, 7, 3, 13, 3, 19, 3, + 25, 3, 31, 3, 37, 3, 43, 3, 49, 3, 55, 3, 61, 3, 67, 3, + 73, 3, 79, 3, 85, 3, 91, 3, 97, 3, 103, 3, 109, 3, 115, 3, + 121, 3, 127, 3,-123, 3,-117, 3,-111, 3,-105, 3, -99, 3, -93, 3, + -87, 3, -81, 3, -75, 3, -69, 3, -63, 3, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -57, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -52, 3, -41, 3, -36, 3, -28, 3, -24, 3, -15, 3, -8, 3, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 86, 4, -1, -1, + -1, -1, -1, -1, 90, 4,-103, 4, -1, -1, -1, -1, -1, -1, -39, 4, + -35, 4, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, + 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, + 91, 50, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, + 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, + 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, + 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, 50, 53, 104, 0, 27, 91, + 67, 0, 27, 91, 65, 0, 27, 91, 77, 0, 14, 0, 27, 91, 53, 109, + 0, 27, 91, 49, 109, 0, 27, 55, 27, 91, 63, 52, 55, 104, 0, 27, + 91, 52, 104, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, + 52, 109, 0, 15, 0, 27, 91, 109, 15, 0, 27, 91, 50, 74, 27, 91, + 63, 52, 55, 108, 27, 56, 0, 27, 91, 52, 108, 0, 27, 91, 50, 55, + 109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, 104, 36, 60, 49, + 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 27, 91, 63, 52, 55, 108, + 27, 61, 27, 91, 63, 49, 108, 0, 27, 91, 114, 27, 91, 109, 27, 91, + 50, 74, 27, 91, 72, 27, 91, 63, 55, 104, 27, 91, 63, 49, 59, 51, + 59, 52, 59, 54, 108, 27, 91, 52, 108, 0, 27, 91, 64, 0, 27, 91, + 76, 0, 8, 0, 27, 91, 51, 126, 0, 27, 91, 66, 0, 27, 91, 56, + 94, 0, 27, 91, 50, 49, 126, 0, 27, 91, 49, 49, 126, 0, 27, 91, + 50, 49, 126, 0, 27, 91, 49, 50, 126, 0, 27, 91, 49, 51, 126, 0, + 27, 91, 49, 52, 126, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, + 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, + 50, 48, 126, 0, 27, 91, 55, 126, 0, 27, 91, 50, 126, 0, 27, 91, + 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 91, 67, 0, + 27, 91, 97, 0, 27, 91, 98, 0, 27, 91, 65, 0, 27, 62, 0, 27, + 61, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, + 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, + 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, + 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, + 0, 27, 62, 27, 91, 49, 59, 51, 59, 52, 59, 53, 59, 54, 108, 27, + 91, 63, 55, 104, 27, 91, 109, 27, 91, 114, 27, 91, 50, 74, 27, 91, + 72, 0, 27, 91, 114, 27, 91, 109, 27, 91, 50, 74, 27, 91, 72, 27, + 91, 63, 55, 104, 27, 91, 63, 49, 59, 51, 59, 52, 59, 54, 108, 27, + 91, 52, 108, 27, 62, 27, 91, 63, 49, 48, 48, 48, 108, 27, 91, 63, + 50, 53, 104, 0, 27, 56, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, + 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, 27, 91, 48, 37, 63, 37, + 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, + 52, 37, 59, 37, 63, 37, 112, 49, 37, 112, 51, 37, 124, 37, 116, 59, + 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 109, 37, + 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, + 9, 0, 27, 79, 119, 0, 27, 79, 121, 0, 27, 79, 117, 0, 27, 79, + 113, 0, 27, 79, 115, 0, 96, 96, 97, 97, 102, 102, 103, 103, 106, 106, + 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, + 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, + 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 40, 66, + 27, 41, 48, 0, 27, 91, 56, 126, 0, 27, 79, 77, 0, 27, 91, 49, + 126, 0, 27, 91, 51, 36, 0, 27, 91, 52, 126, 0, 27, 91, 56, 36, + 0, 27, 91, 55, 36, 0, 27, 91, 50, 36, 0, 27, 91, 100, 0, 27, + 91, 54, 36, 0, 27, 91, 53, 36, 0, 27, 91, 99, 0, 27, 91, 50, + 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 50, 53, 126, 0, 27, + 91, 50, 54, 126, 0, 27, 91, 50, 56, 126, 0, 27, 91, 50, 57, 126, + 0, 27, 91, 51, 49, 126, 0, 27, 91, 51, 50, 126, 0, 27, 91, 51, + 51, 126, 0, 27, 91, 51, 52, 126, 0, 27, 91, 50, 51, 36, 0, 27, + 91, 50, 52, 36, 0, 27, 91, 49, 49, 94, 0, 27, 91, 49, 50, 94, + 0, 27, 91, 49, 51, 94, 0, 27, 91, 49, 52, 94, 0, 27, 91, 49, + 53, 94, 0, 27, 91, 49, 55, 94, 0, 27, 91, 49, 56, 94, 0, 27, + 91, 49, 57, 94, 0, 27, 91, 50, 48, 94, 0, 27, 91, 50, 49, 94, + 0, 27, 91, 50, 51, 94, 0, 27, 91, 50, 52, 94, 0, 27, 91, 50, + 53, 94, 0, 27, 91, 50, 54, 94, 0, 27, 91, 50, 56, 94, 0, 27, + 91, 50, 57, 94, 0, 27, 91, 51, 49, 94, 0, 27, 91, 51, 50, 94, + 0, 27, 91, 51, 51, 94, 0, 27, 91, 51, 52, 94, 0, 27, 91, 50, + 51, 64, 0, 27, 91, 50, 52, 64, 0, 27, 91, 49, 75, 0, 27, 91, + 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, + 63, 49, 59, 50, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, 52, + 57, 109, 0, 27, 93, 49, 48, 52, 7, 0, 27, 93, 52, 59, 37, 112, + 49, 37, 100, 59, 114, 103, 98, 58, 37, 112, 50, 37, 123, 50, 53, 53, + 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 50, 46, 50, + 88, 47, 37, 112, 51, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, + 48, 48, 48, 125, 37, 47, 37, 50, 46, 50, 88, 47, 37, 112, 52, 37, + 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, + 37, 50, 46, 50, 88, 27, 92, 0, 27, 91, 77, 0, 27, 91, 37, 63, + 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, + 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, + 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, + 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, + 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, + 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, + 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, + 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 40, 66, 0, 27, + 40, 48, 0 }; // Taken from Dickey ncurses terminfo.src dated 2017-04-22. static const char linux_16colour_terminfo[] = { - 26, 1, 43, 0, 29, 0, 16, 0, 125, 1, 125, 3, 108, 105, 110, 117, 120, 45, 49, 54, 99, 111, 108, 111, 114, 124, 108, 105, 110, 117, 120, 32, - 99, 111, 110, 115, 111, 108, 101, 32, 119, 105, 116, 104, 32, 49, 54, 32, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, -1, -1, 8, 0, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 16, 0, 0, 1, 42, 0, -1, -1, 0, 0, 2, 0, 4, 0, 21, 0, 26, 0, - 33, 0, 37, 0, 41, 0, -1, -1, 52, 0, 69, 0, 71, 0, 75, 0, 87, 0, -1, -1, 89, 0, 101, 0, -1, -1, 105, 0, 109, 0, 121, 0, -125, 0, -1, -1, -1, -1,-127, 0,-125, 0,-120, 0, -1, -1, -1, -1,-115, 0,-110, 0, -1, -1, -1, -1,-105, 0,-100, 0, -95, 0, -90, 0, --81, 0, -79, 0, -1, -1, -1, -1, -74, 0, -69, 0, -63, 0, -57, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -39, 0, -35, 0, - -1, -1, -31, 0, -1, -1, -1, -1, -1, -1, -29, 0, -1, -1, -24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -20, 0, -15, 0, -9, 0, -4, 0, - 1, 1, 6, 1, 11, 1, 17, 1, 23, 1, 29, 1, 35, 1, 40, 1, -1, -1, 45, 1, -1, -1, 49, 1, 54, 1, 59, 1, -1, -1, -1, -1, - -1, -1, 63, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 67, 1, -1, -1, 70, 1, 79, 1, 88, 1, 97, 1, -1, -1, 106, 1, 115, 1, 124, 1, -1, -1,-123, 1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1,-114, 1, -1, -1, -1, -1, -1, -1,-108, 1,-105, 1, -94, 1, -91, 1, -89, 1, -86, 1, 1, 2, -1, -1, - 4, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, 10, 2, -1, -1, 77, 2, -1, -1, - -1, -1, 81, 2, 87, 2, -1, -1, -1, -1, 93, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 97, 2, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 102, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 104, 2, 110, 2, 116, 2, 122, 2,-128, 2,-122, 2,-116, 2,-110, 2,-104, 2, -98, 2, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -92, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -87, 2, --76, 2, -71, 2, -65, 2, -61, 2, -52, 2, -48, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, 3, -1, -1, -1, -1, - -1, -1, 37, 3, 75, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 113, 3, 119, 3, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, -100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, - 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 27, - 91, 63, 49, 99, 0, 8, 0, 27, 91, 63, 50, 53, 104, 27, 91, 63, 48, 99, 0, 27, 91, 67, 0, 27, 91, 65, 0, 27, 91, 63, 50, 53, -104, 27, 91, 63, 56, 99, 0, 27, 91, 80, 0, 27, 91, 77, 0, 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 50, 109, 0, - 27, 91, 52, 104, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, 37, 112, 49, 37, 100, 88, 0, 15, 0, 27, - 91, 109, 15, 0, 27, 91, 52, 108, 0, 27, 91, 50, 55, 109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, 104, 36, 60, 50, 48, 48, 47, - 62, 27, 91, 63, 53, 108, 0, 27, 91, 64, 0, 27, 91, 76, 0, 127, 0, 27, 91, 51, 126, 0, 27, 91, 66, 0, 27, 91, 91, 65, 0, 27, - 91, 50, 49, 126, 0, 27, 91, 91, 66, 0, 27, 91, 91, 67, 0, 27, 91, 91, 68, 0, 27, 91, 91, 69, 0, 27, 91, 49, 55, 126, 0, 27, - 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 91, 49, 126, 0, 27, 91, 50, 126, 0, 27, 91, 68, 0, 27, - 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 91, 67, 0, 27, 91, 65, 0, 13, 10, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, -112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 76, - 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 99, 27, 93, - 82, 0, 27, 56, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, 27, 91, 48, 59, 49, 48, 37, 63, - 37, 112, 49, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 51, 37, 116, 59, 55, 37, 59, 37, - 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 37, 63, 37, 112, 53, 37, 116, 59, 50, 37, 59, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, -109, 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, 9, 0, 27, 91, 71, 0, 43, 43, 44, 44, 45, 45, 46, 46, - 48, 48, 95, 95, 96, 96, 97, 97, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, -114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 99, 126, 126, 0, 27, 91, 90, 0, 27, - 91, 63, 55, 104, 0, 27, 91, 63, 55, 108, 0, 27, 41, 48, 0, 27, 91, 52, 126, 0, 26, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, -126, 0, 27, 91, 50, 53, 126, 0, 27, 91, 50, 54, 126, 0, 27, 91, 50, 56, 126, 0, 27, 91, 50, 57, 126, 0, 27, 91, 51, 49, 126, 0, - 27, 91, 51, 50, 126, 0, 27, 91, 51, 51, 126, 0, 27, 91, 51, 52, 126, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, - 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 54, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 93, 82, 0, 27, 93, - 80, 37, 112, 49, 37, 120, 37, 112, 50, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 48, 50, 120, 37, 112, - 51, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 48, 50, 120, 37, 112, 52, 37, 123, 50, 53, 53, 125, 37, - 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 48, 50, 120, 0, 27, 91, 77, 0, 27, 91, 51, 37, 112, 49, 37, 123, 56, 125, 37, 109, 37, -100, 37, 63, 37, 112, 49, 37, 123, 55, 125, 37, 62, 37, 116, 59, 49, 37, 101, 59, 50, 49, 37, 59, 109, 0, 27, 91, 52, 37, 112, 49, 37, -123, 56, 125, 37, 109, 37, 100, 37, 63, 37, 112, 49, 37, 123, 55, 125, 37, 62, 37, 116, 59, 53, 37, 101, 59, 50, 53, 37, 59, 109, 0, 27, - 91, 49, 49, 109, 0, 27, 91, 49, 48, 109, 0 + 26, 1, 43, 0, 29, 0, 16, 0, 125, 1, 125, 3, 108, 105, 110, 117, + 120, 45, 49, 54, 99, 111, 108, 111, 114, 124, 108, 105, 110, 117, 120, 32, + 99, 111, 110, 115, 111, 108, 101, 32, 119, 105, 116, 104, 32, 49, 54, 32, + 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, + 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 1, 1, -1, -1, 8, 0, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 16, 0, + 0, 1, 42, 0, -1, -1, 0, 0, 2, 0, 4, 0, 21, 0, 26, 0, + 33, 0, 37, 0, 41, 0, -1, -1, 52, 0, 69, 0, 71, 0, 75, 0, + 87, 0, -1, -1, 89, 0, 101, 0, -1, -1, 105, 0, 109, 0, 121, 0, + 125, 0, -1, -1, -1, -1,-127, 0,-125, 0,-120, 0, -1, -1, -1, -1, +-115, 0,-110, 0, -1, -1, -1, -1,-105, 0,-100, 0, -95, 0, -90, 0, + -81, 0, -79, 0, -1, -1, -1, -1, -74, 0, -69, 0, -63, 0, -57, 0, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -39, 0, -35, 0, + -1, -1, -31, 0, -1, -1, -1, -1, -1, -1, -29, 0, -1, -1, -24, 0, + -1, -1, -1, -1, -1, -1, -1, -1, -20, 0, -15, 0, -9, 0, -4, 0, + 1, 1, 6, 1, 11, 1, 17, 1, 23, 1, 29, 1, 35, 1, 40, 1, + -1, -1, 45, 1, -1, -1, 49, 1, 54, 1, 59, 1, -1, -1, -1, -1, + -1, -1, 63, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 67, 1, -1, -1, 70, 1, 79, 1, 88, 1, 97, 1, -1, -1, + 106, 1, 115, 1, 124, 1, -1, -1,-123, 1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1,-114, 1, -1, -1, -1, -1, -1, -1, +-108, 1,-105, 1, -94, 1, -91, 1, -89, 1, -86, 1, 1, 2, -1, -1, + 4, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6, 2, + -1, -1, -1, -1, -1, -1, -1, -1, 10, 2, -1, -1, 77, 2, -1, -1, + -1, -1, 81, 2, 87, 2, -1, -1, -1, -1, 93, 2, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 97, 2, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 102, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 104, 2, 110, 2, 116, 2, 122, 2,-128, 2,-122, 2, +-116, 2,-110, 2,-104, 2, -98, 2, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -92, 2, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -87, 2, + -76, 2, -71, 2, -65, 2, -61, 2, -52, 2, -48, 2, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, 3, -1, -1, -1, -1, + -1, -1, 37, 3, 75, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 113, 3, 119, 3, 7, 0, + 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, + 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, + 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, + 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, + 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 27, + 91, 63, 49, 99, 0, 8, 0, 27, 91, 63, 50, 53, 104, 27, 91, 63, + 48, 99, 0, 27, 91, 67, 0, 27, 91, 65, 0, 27, 91, 63, 50, 53, + 104, 27, 91, 63, 56, 99, 0, 27, 91, 80, 0, 27, 91, 77, 0, 14, + 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 50, 109, 0, + 27, 91, 52, 104, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, + 91, 52, 109, 0, 27, 91, 37, 112, 49, 37, 100, 88, 0, 15, 0, 27, + 91, 109, 15, 0, 27, 91, 52, 108, 0, 27, 91, 50, 55, 109, 0, 27, + 91, 50, 52, 109, 0, 27, 91, 63, 53, 104, 36, 60, 50, 48, 48, 47, + 62, 27, 91, 63, 53, 108, 0, 27, 91, 64, 0, 27, 91, 76, 0, 127, + 0, 27, 91, 51, 126, 0, 27, 91, 66, 0, 27, 91, 91, 65, 0, 27, + 91, 50, 49, 126, 0, 27, 91, 91, 66, 0, 27, 91, 91, 67, 0, 27, + 91, 91, 68, 0, 27, 91, 91, 69, 0, 27, 91, 49, 55, 126, 0, 27, + 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, + 0, 27, 91, 49, 126, 0, 27, 91, 50, 126, 0, 27, 91, 68, 0, 27, + 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 91, 67, 0, 27, 91, 65, + 0, 13, 10, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, + 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, + 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 76, + 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, + 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 99, 27, 93, + 82, 0, 27, 56, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, + 27, 55, 0, 10, 0, 27, 77, 0, 27, 91, 48, 59, 49, 48, 37, 63, + 37, 112, 49, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 50, 37, 116, + 59, 52, 37, 59, 37, 63, 37, 112, 51, 37, 116, 59, 55, 37, 59, 37, + 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 37, 63, 37, 112, 53, 37, + 116, 59, 50, 37, 59, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, + 109, 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, + 72, 0, 9, 0, 27, 91, 71, 0, 43, 43, 44, 44, 45, 45, 46, 46, + 48, 48, 95, 95, 96, 96, 97, 97, 102, 102, 103, 103, 104, 104, 105, 105, + 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, + 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, + 122, 122, 123, 123, 124, 124, 125, 99, 126, 126, 0, 27, 91, 90, 0, 27, + 91, 63, 55, 104, 0, 27, 91, 63, 55, 108, 0, 27, 41, 48, 0, 27, + 91, 52, 126, 0, 26, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, + 126, 0, 27, 91, 50, 53, 126, 0, 27, 91, 50, 54, 126, 0, 27, 91, + 50, 56, 126, 0, 27, 91, 50, 57, 126, 0, 27, 91, 51, 49, 126, 0, + 27, 91, 51, 50, 126, 0, 27, 91, 51, 51, 126, 0, 27, 91, 51, 52, + 126, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, + 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 54, 99, 0, 27, 91, 99, + 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 93, 82, 0, 27, 93, + 80, 37, 112, 49, 37, 120, 37, 112, 50, 37, 123, 50, 53, 53, 125, 37, + 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 48, 50, 120, 37, 112, + 51, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, + 37, 47, 37, 48, 50, 120, 37, 112, 52, 37, 123, 50, 53, 53, 125, 37, + 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 48, 50, 120, 0, 27, + 91, 77, 0, 27, 91, 51, 37, 112, 49, 37, 123, 56, 125, 37, 109, 37, + 100, 37, 63, 37, 112, 49, 37, 123, 55, 125, 37, 62, 37, 116, 59, 49, + 37, 101, 59, 50, 49, 37, 59, 109, 0, 27, 91, 52, 37, 112, 49, 37, + 123, 56, 125, 37, 109, 37, 100, 37, 63, 37, 112, 49, 37, 123, 55, 125, + 37, 62, 37, 116, 59, 53, 37, 101, 59, 50, 53, 37, 59, 109, 0, 27, + 91, 49, 49, 109, 0, 27, 91, 49, 48, 109, 0 }; // Taken from Dickey ncurses terminfo.src dated 2017-04-22. static const char putty_256colour_terminfo[] = { - 26, 1, 48, 0, 29, 0, 16, 0, 125, 1,-106, 4, 112, 117, 116, 116, 121, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 80, 117, 84, 84, 89, - 32, 48, 46, 53, 56, 32, 119, 105, 116, 104, 32, 120, 116, 101, 114, 109, 32, 50, 53, 54, 45, 99, 111, 108, 111, 114, 115, 0, 1, 1, 0, 0, - 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, -1, 8, 0, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, 22, 0, 0, 0, 4, 0, 6, 0, - 8, 0, 25, 0, 30, 0, 37, 0, 41, 0, 45, 0, -1, -1, 56, 0, 73, 0, 76, 0, 80, 0, 87, 0, -1, -1, 89, 0, 96, 0, -1, -1, - 100, 0, -1, -1, 103, 0, 107, 0, 111, 0, -1, -1, 117, 0, 119, 0, 124, 0,-127, 0, -1, -1, -1, -1,-120, 0, -1, -1, -1, -1,-115, 0, --110, 0,-105, 0,-100, 0, -91, 0, -89, 0, -84, 0, -1, -1, -73, 0, -68, 0, -62, 0, -56, 0, -1, -1, -38, 0, -1, -1, -36, 0, -1, -1, - -1, -1, -1, -1, -2, 0, -1, -1, 2, 1, -1, -1, -1, -1, -1, -1, 4, 1, -1, -1, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, 13, 1, - 19, 1, 25, 1, 31, 1, 37, 1, 43, 1, 49, 1, 55, 1, 61, 1, 67, 1, 73, 1, 78, 1, -1, -1, 83, 1, -1, -1, 87, 1, 92, 1, - 97, 1, 101, 1, 105, 1, -1, -1, 109, 1, 113, 1, 121, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1,-127, 1, -1, -1,-124, 1,-115, 1,-106, 1, -1, -1, -97, 1, -88, 1, -79, 1, -70, 1, -61, 1, -52, 1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -43, 1, -1, -1, -1, -1, -10, 1, -7, 1, 4, 2, 7, 2, 9, 2, - 12, 2, 84, 2, -1, -1, 87, 2, 89, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 94, 2, -1, -1, -1, -1, -1, -1, -1, -1, 98, 2, - -1, -1,-107, 2, -1, -1, -1, -1,-103, 2, -97, 2, -1, -1, -1, -1, -91, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -84, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -79, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -77, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -73, 2, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -69, 2, -63, 2, -57, 2, -51, 2, -45, 2, -39, 2, -33, 2, -27, 2, -21, 2, -15, 2, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -4, 2, 7, 3, 12, 3, 18, 3, 22, 3, 31, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 35, 3, -1, -1, -1, -1, -1, -1, 39, 3, 102, 3, -1, -1, -1, -1, -1, -1, -90, 3, -84, 3, -78, 3, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -72, 3,-118, 4,-112, 4, 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, 37, 105, - 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, 74, - 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 27, 68, 0, - 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, 27, 77, 0, 27, 91, 80, 0, 27, - 91, 77, 0, 27, 93, 48, 59, 7, 0, 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 63, 52, 55, 104, 0, 27, 91, 52, 104, - 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, 37, 112, 49, 37, 100, 88, 0, 15, 0, 27, 91, 109, 15, 0, - 27, 91, 50, 74, 27, 91, 63, 52, 55, 108, 0, 27, 91, 52, 108, 0, 27, 91, 50, 55, 109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, - 104, 36, 60, 49, 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 7, 0, 27, 55, 27, 91, 114, 27, 91, 109, 27, 91, 63, 55, 104, 27, 91, 63, - 49, 59, 52, 59, 54, 108, 27, 91, 52, 108, 27, 56, 27, 62, 27, 93, 82, 0, 27, 91, 76, 0, 127, 0, 27, 91, 51, 126, 0, 27, 79, 66, - 0, 27, 91, 49, 49, 126, 0, 27, 91, 50, 49, 126, 0, 27, 91, 49, 50, 126, 0, 27, 91, 49, 51, 126, 0, 27, 91, 49, 52, 126, 0, 27, - 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 91, 49, - 126, 0, 27, 91, 50, 126, 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 79, 67, 0, 27, 91, 66, 0, 27, 91, 65, - 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, 63, 49, 104, 27, 61, 0, 13, 10, 0, 27, 91, 37, 112, 49, 37, 100, 80, - 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 83, 0, 27, 91, 37, 112, - 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 84, 0, - 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 60, 27, 91, 34, 112, 27, 91, 53, 48, 59, 54, 34, 112, 27, 99, 27, 91, 63, 51, 108, 27, 93, - 82, 27, 91, 63, 49, 48, 48, 48, 108, 0, 27, 56, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, - 27, 91, 48, 37, 63, 37, 112, 49, 37, 112, 54, 37, 124, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, - 37, 112, 49, 37, 112, 51, 37, 124, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 109, 37, 63, 37, 112, 57, 37, - 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, 9, 0, 27, 93, 48, 59, 0, 27, 91, 71, 0, 96, 96, 97, 97, 102, 102, 103, 103, 106, 106, - 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, - 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 91, 63, 55, 104, 0, 27, 91, 63, 55, 108, 0, 27, 40, 66, 27, 41, 48, 0, - 27, 91, 52, 126, 0, 26, 0, 27, 91, 68, 0, 27, 91, 67, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 50, 53, 126, - 0, 27, 91, 50, 54, 126, 0, 27, 91, 50, 56, 126, 0, 27, 91, 50, 57, 126, 0, 27, 91, 51, 49, 126, 0, 27, 91, 51, 50, 126, 0, 27, - 91, 51, 51, 126, 0, 27, 91, 51, 52, 126, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, - 27, 91, 63, 54, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 93, 82, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, - 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, - 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, - 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, - 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 49, 48, 109, 0, - 27, 91, 49, 49, 109, 0, 27, 91, 49, 50, 109, 0, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30,-105,-104, - 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 123, 49, 48, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30,-105,-103, 27, 37, 37, 64, 37, 101, 37, - 112, 49, 37, 123, 49, 50, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30,-103,-128, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 123, 49, 51, 125, - 37, 61, 37, 116, 27, 37, 37, 71, -30,-103, -86, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 123, 49, 52, 125, 37, 61, 37, 116, 27, 37, 37, - 71, -30,-103, -85, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 123, 49, 53, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30,-104, -68, 27, 37, 37, - 64, 37, 101, 37, 112, 49, 37, 123, 50, 55, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30,-122,-112, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, - 123, 49, 53, 53, 125, 37, 61, 37, 116, 27, 37, 37, 71, -32,-126, -94, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 99, 37, 59, 0, 27, 91, + 26, 1, 48, 0, 29, 0, 16, 0, 125, 1,-106, 4, 112, 117, 116, 116, + 121, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 80, 117, 84, 84, 89, + 32, 48, 46, 53, 56, 32, 119, 105, 116, 104, 32, 120, 116, 101, 114, 109, + 32, 50, 53, 54, 45, 99, 111, 108, 111, 114, 115, 0, 1, 1, 0, 0, + 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, -1, 8, 0, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 0, 1, -1, 127, 22, 0, 0, 0, 4, 0, 6, 0, + 8, 0, 25, 0, 30, 0, 37, 0, 41, 0, 45, 0, -1, -1, 56, 0, + 73, 0, 76, 0, 80, 0, 87, 0, -1, -1, 89, 0, 96, 0, -1, -1, + 100, 0, -1, -1, 103, 0, 107, 0, 111, 0, -1, -1, 117, 0, 119, 0, + 124, 0,-127, 0, -1, -1, -1, -1,-120, 0, -1, -1, -1, -1,-115, 0, +-110, 0,-105, 0,-100, 0, -91, 0, -89, 0, -84, 0, -1, -1, -73, 0, + -68, 0, -62, 0, -56, 0, -1, -1, -38, 0, -1, -1, -36, 0, -1, -1, + -1, -1, -1, -1, -2, 0, -1, -1, 2, 1, -1, -1, -1, -1, -1, -1, + 4, 1, -1, -1, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, 13, 1, + 19, 1, 25, 1, 31, 1, 37, 1, 43, 1, 49, 1, 55, 1, 61, 1, + 67, 1, 73, 1, 78, 1, -1, -1, 83, 1, -1, -1, 87, 1, 92, 1, + 97, 1, 101, 1, 105, 1, -1, -1, 109, 1, 113, 1, 121, 1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1,-127, 1, -1, -1,-124, 1,-115, 1, +-106, 1, -1, -1, -97, 1, -88, 1, -79, 1, -70, 1, -61, 1, -52, 1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -43, 1, -1, -1, -1, -1, -10, 1, -7, 1, 4, 2, 7, 2, 9, 2, + 12, 2, 84, 2, -1, -1, 87, 2, 89, 2, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 94, 2, -1, -1, -1, -1, -1, -1, -1, -1, 98, 2, + -1, -1,-107, 2, -1, -1, -1, -1,-103, 2, -97, 2, -1, -1, -1, -1, + -91, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -84, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -79, 2, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -77, 2, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -73, 2, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -69, 2, -63, 2, -57, 2, + -51, 2, -45, 2, -39, 2, -33, 2, -27, 2, -21, 2, -15, 2, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -4, 2, 7, 3, 12, 3, 18, 3, 22, 3, 31, 3, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 35, 3, -1, -1, -1, -1, -1, -1, 39, 3, 102, 3, -1, -1, -1, -1, + -1, -1, -90, 3, -84, 3, -78, 3, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -72, 3, +-118, 4,-112, 4, 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, 37, 105, + 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, + 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, 74, + 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, + 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 27, 68, 0, + 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, + 50, 53, 104, 0, 27, 91, 67, 0, 27, 77, 0, 27, 91, 80, 0, 27, + 91, 77, 0, 27, 93, 48, 59, 7, 0, 14, 0, 27, 91, 53, 109, 0, + 27, 91, 49, 109, 0, 27, 91, 63, 52, 55, 104, 0, 27, 91, 52, 104, + 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, + 27, 91, 37, 112, 49, 37, 100, 88, 0, 15, 0, 27, 91, 109, 15, 0, + 27, 91, 50, 74, 27, 91, 63, 52, 55, 108, 0, 27, 91, 52, 108, 0, + 27, 91, 50, 55, 109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, + 104, 36, 60, 49, 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 7, 0, + 27, 55, 27, 91, 114, 27, 91, 109, 27, 91, 63, 55, 104, 27, 91, 63, + 49, 59, 52, 59, 54, 108, 27, 91, 52, 108, 27, 56, 27, 62, 27, 93, + 82, 0, 27, 91, 76, 0, 127, 0, 27, 91, 51, 126, 0, 27, 79, 66, + 0, 27, 91, 49, 49, 126, 0, 27, 91, 50, 49, 126, 0, 27, 91, 49, + 50, 126, 0, 27, 91, 49, 51, 126, 0, 27, 91, 49, 52, 126, 0, 27, + 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, + 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 91, 49, + 126, 0, 27, 91, 50, 126, 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, + 27, 91, 53, 126, 0, 27, 79, 67, 0, 27, 91, 66, 0, 27, 91, 65, + 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, 63, + 49, 104, 27, 61, 0, 13, 10, 0, 27, 91, 37, 112, 49, 37, 100, 80, + 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, + 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 83, 0, 27, 91, 37, 112, + 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, + 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 84, 0, + 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 60, 27, 91, 34, 112, 27, + 91, 53, 48, 59, 54, 34, 112, 27, 99, 27, 91, 63, 51, 108, 27, 93, + 82, 27, 91, 63, 49, 48, 48, 48, 108, 0, 27, 56, 0, 27, 91, 37, + 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, + 27, 91, 48, 37, 63, 37, 112, 49, 37, 112, 54, 37, 124, 37, 116, 59, + 49, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, + 37, 112, 49, 37, 112, 51, 37, 124, 37, 116, 59, 55, 37, 59, 37, 63, + 37, 112, 52, 37, 116, 59, 53, 37, 59, 109, 37, 63, 37, 112, 57, 37, + 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, 9, 0, 27, 93, 48, + 59, 0, 27, 91, 71, 0, 96, 96, 97, 97, 102, 102, 103, 103, 106, 106, + 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, + 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, + 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 91, 63, + 55, 104, 0, 27, 91, 63, 55, 108, 0, 27, 40, 66, 27, 41, 48, 0, + 27, 91, 52, 126, 0, 26, 0, 27, 91, 68, 0, 27, 91, 67, 0, 27, + 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 50, 53, 126, + 0, 27, 91, 50, 54, 126, 0, 27, 91, 50, 56, 126, 0, 27, 91, 50, + 57, 126, 0, 27, 91, 51, 49, 126, 0, 27, 91, 51, 50, 126, 0, 27, + 91, 51, 51, 126, 0, 27, 91, 51, 52, 126, 0, 27, 91, 49, 75, 0, + 27, 91, 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, + 27, 91, 63, 54, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, 52, + 57, 109, 0, 27, 93, 82, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, + 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, + 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, + 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, + 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, + 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, + 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, + 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, + 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 49, 48, 109, 0, + 27, 91, 49, 49, 109, 0, 27, 91, 49, 50, 109, 0, 37, 63, 37, 112, + 49, 37, 123, 56, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30,-105,-104, + 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 123, 49, 48, 125, 37, 61, + 37, 116, 27, 37, 37, 71, -30,-105,-103, 27, 37, 37, 64, 37, 101, 37, + 112, 49, 37, 123, 49, 50, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30, +-103,-128, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 123, 49, 51, 125, + 37, 61, 37, 116, 27, 37, 37, 71, -30,-103, -86, 27, 37, 37, 64, 37, + 101, 37, 112, 49, 37, 123, 49, 52, 125, 37, 61, 37, 116, 27, 37, 37, + 71, -30,-103, -85, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 123, 49, + 53, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30,-104, -68, 27, 37, 37, + 64, 37, 101, 37, 112, 49, 37, 123, 50, 55, 125, 37, 61, 37, 116, 27, + 37, 37, 71, -30,-122,-112, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, + 123, 49, 53, 53, 125, 37, 61, 37, 116, 27, 37, 37, 71, -32,-126, -94, + 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 99, 37, 59, 0, 27, 91, 49, 49, 109, 0, 27, 91, 49, 48, 109, 0 }; // Taken from Dickey ncurses terminfo.src dated 2017-04-22. static const char interix_8colour_terminfo[] = { - 26, 1, 82, 0, 15, 0, 16, 0, 105, 1, 123, 2, 105, 110, 116, 101, 114, 105, 120, 124, 111, 112, 101, 110, 110, 116, 124, 111, 112, 101, 110, 110, - 116, 45, 50, 53, 124, 110, 116, 99, 111, 110, 115, 111, 108, 101, 124, 110, 116, 99, 111, 110, 115, 111, 108, 101, 45, 50, 53, 124, 79, 112, 101, 110, - 78, 84, 45, 116, 101, 114, 109, 32, 99, 111, 109, 112, 97, 116, 105, 98, 108, 101, 32, 119, 105, 116, 104, 32, 99, 111, 108, 111, 114, 0, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 80, 0, -1, -1, 25, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 8, 0, 64, 0, 3, 0, 0, 0, 4, 0, -1, -1, -1, -1, -1, -1, 6, 0, 11, 0, 15, 0, -1, -1, - -1, -1, 19, 0, 36, 0, 38, 0, -1, -1, 42, 0, -1, -1, -1, -1, 46, 0, 50, 0, 54, 0, -1, -1, -1, -1, 58, 0, -1, -1, -1, -1, - -1, -1, -1, -1, 62, 0, 67, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 75, 0, 80, 0, 85, 0, -1, -1, -1, -1, 90, 0, 95, 0, - -1, -1, -1, -1, 107, 0, 111, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 115, 0, -1, -1, 119, 0, -1, -1, - -1, -1, -1, -1, 121, 0, -1, -1, 125, 0, -1, -1, -1, -1, -1, -1,-127, 0,-123, 0,-119, 0,-115, 0,-111, 0,-107, 0,-103, 0, -99, 0, - -95, 0, -91, 0, -87, 0, -1, -1, -83, 0, -1, -1, -79, 0, -75, 0, -71, 0, -67, 0, -63, 0, -1, -1, -1, -1, -1, -1, -59, 0, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -55, 0, -1, -1, - -1, -1, -52, 0, -43, 0, -1, -1, -34, 0, -25, 0, -16, 0, -7, 0, 2, 1, 11, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 20, 1, -1, -1, -1, -1, -1, -1, 23, 1, -1, -1, 27, 1, 31, 1, 35, 1, -1, -1, -1, -1, -1, -1, 39, 1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, 1, -1, -1, 104, 1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 108, 1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 112, 1, - 116, 1, 120, 1, 124, 1,-128, 1,-124, 1,-120, 1,-116, 1,-112, 1,-108, 1,-104, 1,-100, 1, -96, 1, -92, 1, -88, 1, -84, 1, -80, 1, - -76, 1, -72, 1, -68, 1, -64, 1, -60, 1, -56, 1, -52, 1, -48, 1, -44, 1, -40, 1, -36, 1, -32, 1, -28, 1, -24, 1, -20, 1, -16, 1, - -12, 1, -8, 1, -4, 1, 0, 2, 4, 2, 8, 2, 12, 2, 16, 2, 20, 2, 24, 2, 28, 2, 32, 2, 36, 2, 40, 2, 44, 2, 48, 2, - 52, 2, 56, 2, 60, 2, 64, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 68, 2, -1, -1, -1, -1, -1, -1, -1, -1, 72, 2, 88, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, 2, 113, 2, - 27, 91, 90, 0, 7, 0, 27, 91, 50, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, - 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 68, 0, 27, 91, 67, 0, 27, 91, 85, 0, 27, 91, 65, 0, 27, 91, 77, 0, 27, 91, - 49, 109, 0, 27, 91, 115, 27, 91, 49, 98, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, 48, 109, 0, 27, - 91, 50, 98, 27, 91, 117, 13, 27, 91, 75, 0, 27, 91, 109, 0, 27, 91, 109, 0, 27, 91, 76, 0, 8, 0, 27, 91, 77, 0, 27, 91, 66, - 0, 27, 70, 65, 0, 27, 70, 49, 0, 27, 70, 65, 0, 27, 70, 50, 0, 27, 70, 51, 0, 27, 70, 52, 0, 27, 70, 53, 0, 27, 70, 54, - 0, 27, 70, 55, 0, 27, 70, 56, 0, 27, 70, 57, 0, 27, 91, 76, 0, 27, 91, 68, 0, 27, 91, 85, 0, 27, 91, 84, 0, 27, 91, 83, - 0, 27, 91, 67, 0, 27, 91, 65, 0, 13, 10, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, - 37, 112, 49, 37, 100, 83, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, - 67, 0, 27, 91, 37, 112, 49, 37, 100, 84, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 99, 0, 27, 91, 117, 0, 27, 91, 115, 0, 27, - 91, 83, 0, 27, 91, 84, 0, 9, 0, 43, 16, 44, 17, 45, 24, 46, 25, 48, -37, 96, 4, 97, -79, 102, -8, 103, -15, 104, -80, 106, -39, 107, - -65, 108, -38, 109, -64, 110, -59, 111, 126, 112, -60, 113, -60, 114, -60, 115, 95, 116, -61, 117, -76, 118, -63, 119, -62, 120, -77, 121, -13, 122, -14, 123, - -29, 124, -40, 125,-100, 126, -2, 0, 27, 91, 90, 0, 27, 91, 85, 0, 27, 70, 66, 0, 27, 70, 67, 0, 27, 70, 68, 0, 27, 70, 69, 0, - 27, 70, 70, 0, 27, 70, 71, 0, 27, 70, 72, 0, 27, 70, 73, 0, 27, 70, 74, 0, 27, 70, 75, 0, 27, 70, 76, 0, 27, 70, 77, 0, - 27, 70, 78, 0, 27, 70, 79, 0, 27, 70, 80, 0, 27, 70, 81, 0, 27, 70, 82, 0, 27, 70, 83, 0, 27, 70, 84, 0, 27, 70, 85, 0, - 27, 70, 86, 0, 27, 70, 87, 0, 27, 70, 88, 0, 27, 70, 89, 0, 27, 70, 90, 0, 27, 70, 97, 0, 27, 70, 98, 0, 27, 70, 99, 0, - 27, 70, 100, 0, 27, 70, 101, 0, 27, 70, 102, 0, 27, 70, 103, 0, 27, 70, 104, 0, 27, 70, 105, 0, 27, 70, 106, 0, 27, 70, 107, 0, - 27, 70, 109, 0, 27, 70, 110, 0, 27, 70, 111, 0, 27, 70, 112, 0, 27, 70, 113, 0, 27, 70, 114, 0, 27, 70, 115, 0, 27, 70, 116, 0, - 27, 70, 117, 0, 27, 70, 118, 0, 27, 70, 119, 0, 27, 70, 120, 0, 27, 70, 121, 0, 27, 70, 122, 0, 27, 70, 43, 0, 27, 70, 45, 0, - 27, 70, 12, 0, 27, 91, 109, 0, 27, 91, 37, 112, 49, 37, 123, 51, 48, 125, 37, 43, 37, 100, 109, 0, 27, 91, 37, 112, 49, 37, 39, 40, - 39, 37, 43, 37, 100, 109, 0, 27, 91, 51, 37, 112, 49, 37, 100, 109, 0, 27, 91, 52, 37, 112, 49, 37, 100, 109, 0 + 26, 1, 82, 0, 15, 0, 16, 0, 105, 1, 123, 2, 105, 110, 116, 101, + 114, 105, 120, 124, 111, 112, 101, 110, 110, 116, 124, 111, 112, 101, 110, 110, + 116, 45, 50, 53, 124, 110, 116, 99, 111, 110, 115, 111, 108, 101, 124, 110, + 116, 99, 111, 110, 115, 111, 108, 101, 45, 50, 53, 124, 79, 112, 101, 110, + 78, 84, 45, 116, 101, 114, 109, 32, 99, 111, 109, 112, 97, 116, 105, 98, + 108, 101, 32, 119, 105, 116, 104, 32, 99, 111, 108, 111, 114, 0, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 80, 0, + -1, -1, 25, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 8, 0, 64, 0, 3, 0, 0, 0, + 4, 0, -1, -1, -1, -1, -1, -1, 6, 0, 11, 0, 15, 0, -1, -1, + -1, -1, 19, 0, 36, 0, 38, 0, -1, -1, 42, 0, -1, -1, -1, -1, + 46, 0, 50, 0, 54, 0, -1, -1, -1, -1, 58, 0, -1, -1, -1, -1, + -1, -1, -1, -1, 62, 0, 67, 0, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 75, 0, 80, 0, 85, 0, -1, -1, -1, -1, 90, 0, 95, 0, + -1, -1, -1, -1, 107, 0, 111, 0, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 115, 0, -1, -1, 119, 0, -1, -1, + -1, -1, -1, -1, 121, 0, -1, -1, 125, 0, -1, -1, -1, -1, -1, -1, +-127, 0,-123, 0,-119, 0,-115, 0,-111, 0,-107, 0,-103, 0, -99, 0, + -95, 0, -91, 0, -87, 0, -1, -1, -83, 0, -1, -1, -79, 0, -75, 0, + -71, 0, -67, 0, -63, 0, -1, -1, -1, -1, -1, -1, -59, 0, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -55, 0, -1, -1, + -1, -1, -52, 0, -43, 0, -1, -1, -34, 0, -25, 0, -16, 0, -7, 0, + 2, 1, 11, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 20, 1, -1, -1, -1, -1, -1, -1, 23, 1, -1, -1, 27, 1, + 31, 1, 35, 1, -1, -1, -1, -1, -1, -1, 39, 1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 41, 1, -1, -1, 104, 1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 108, 1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 112, 1, + 116, 1, 120, 1, 124, 1,-128, 1,-124, 1,-120, 1,-116, 1,-112, 1, +-108, 1,-104, 1,-100, 1, -96, 1, -92, 1, -88, 1, -84, 1, -80, 1, + -76, 1, -72, 1, -68, 1, -64, 1, -60, 1, -56, 1, -52, 1, -48, 1, + -44, 1, -40, 1, -36, 1, -32, 1, -28, 1, -24, 1, -20, 1, -16, 1, + -12, 1, -8, 1, -4, 1, 0, 2, 4, 2, 8, 2, 12, 2, 16, 2, + 20, 2, 24, 2, 28, 2, 32, 2, 36, 2, 40, 2, 44, 2, 48, 2, + 52, 2, 56, 2, 60, 2, 64, 2, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 68, 2, -1, -1, -1, -1, -1, -1, -1, -1, 72, 2, 88, 2, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, 2, 113, 2, + 27, 91, 90, 0, 7, 0, 27, 91, 50, 74, 0, 27, 91, 75, 0, 27, + 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, + 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 68, 0, 27, 91, + 67, 0, 27, 91, 85, 0, 27, 91, 65, 0, 27, 91, 77, 0, 27, 91, + 49, 109, 0, 27, 91, 115, 27, 91, 49, 98, 0, 27, 91, 55, 109, 0, + 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, 48, 109, 0, 27, + 91, 50, 98, 27, 91, 117, 13, 27, 91, 75, 0, 27, 91, 109, 0, 27, + 91, 109, 0, 27, 91, 76, 0, 8, 0, 27, 91, 77, 0, 27, 91, 66, + 0, 27, 70, 65, 0, 27, 70, 49, 0, 27, 70, 65, 0, 27, 70, 50, + 0, 27, 70, 51, 0, 27, 70, 52, 0, 27, 70, 53, 0, 27, 70, 54, + 0, 27, 70, 55, 0, 27, 70, 56, 0, 27, 70, 57, 0, 27, 91, 76, + 0, 27, 91, 68, 0, 27, 91, 85, 0, 27, 91, 84, 0, 27, 91, 83, + 0, 27, 91, 67, 0, 27, 91, 65, 0, 13, 10, 0, 27, 91, 37, 112, + 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, + 37, 112, 49, 37, 100, 83, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, + 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, + 67, 0, 27, 91, 37, 112, 49, 37, 100, 84, 0, 27, 91, 37, 112, 49, + 37, 100, 65, 0, 27, 99, 0, 27, 91, 117, 0, 27, 91, 115, 0, 27, + 91, 83, 0, 27, 91, 84, 0, 9, 0, 43, 16, 44, 17, 45, 24, 46, + 25, 48, -37, 96, 4, 97, -79, 102, -8, 103, -15, 104, -80, 106, -39, 107, + -65, 108, -38, 109, -64, 110, -59, 111, 126, 112, -60, 113, -60, 114, -60, 115, + 95, 116, -61, 117, -76, 118, -63, 119, -62, 120, -77, 121, -13, 122, -14, 123, + -29, 124, -40, 125,-100, 126, -2, 0, 27, 91, 90, 0, 27, 91, 85, 0, + 27, 70, 66, 0, 27, 70, 67, 0, 27, 70, 68, 0, 27, 70, 69, 0, + 27, 70, 70, 0, 27, 70, 71, 0, 27, 70, 72, 0, 27, 70, 73, 0, + 27, 70, 74, 0, 27, 70, 75, 0, 27, 70, 76, 0, 27, 70, 77, 0, + 27, 70, 78, 0, 27, 70, 79, 0, 27, 70, 80, 0, 27, 70, 81, 0, + 27, 70, 82, 0, 27, 70, 83, 0, 27, 70, 84, 0, 27, 70, 85, 0, + 27, 70, 86, 0, 27, 70, 87, 0, 27, 70, 88, 0, 27, 70, 89, 0, + 27, 70, 90, 0, 27, 70, 97, 0, 27, 70, 98, 0, 27, 70, 99, 0, + 27, 70, 100, 0, 27, 70, 101, 0, 27, 70, 102, 0, 27, 70, 103, 0, + 27, 70, 104, 0, 27, 70, 105, 0, 27, 70, 106, 0, 27, 70, 107, 0, + 27, 70, 109, 0, 27, 70, 110, 0, 27, 70, 111, 0, 27, 70, 112, 0, + 27, 70, 113, 0, 27, 70, 114, 0, 27, 70, 115, 0, 27, 70, 116, 0, + 27, 70, 117, 0, 27, 70, 118, 0, 27, 70, 119, 0, 27, 70, 120, 0, + 27, 70, 121, 0, 27, 70, 122, 0, 27, 70, 43, 0, 27, 70, 45, 0, + 27, 70, 12, 0, 27, 91, 109, 0, 27, 91, 37, 112, 49, 37, 123, 51, + 48, 125, 37, 43, 37, 100, 109, 0, 27, 91, 37, 112, 49, 37, 39, 40, + 39, 37, 43, 37, 100, 109, 0, 27, 91, 51, 37, 112, 49, 37, 100, 109, + 0, 27, 91, 52, 37, 112, 49, 37, 100, 109, 0 }; // Taken from Dickey ncurses terminfo.src dated 2017-04-22. static const char st_256colour_terminfo[] = { @@ -1926,51 +2211,96 @@ static const char st_256colour_terminfo[] = { }; // Taken from Dickey ncurses terminfo.src dated 2017-04-22. static const char ansi_terminfo[] = { - 26, 1, 40, 0, 23, 0, 16, 0, 125, 1, 68, 2, 97, 110, 115, 105, 124, 97, 110, 115, 105, 47, 112, 99, 45, 116, 101, 114, 109, 32, 99, 111, - 109, 112, 97, 116, 105, 98, 108, 101, 32, 119, 105, 116, 104, 32, 99, 111, 108, 111, 114, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 8, 0, 64, 0, 3, 0, 0, 0, 4, 0, 6, 0, -1, -1, 8, 0, 13, 0, 20, 0, 24, 0, 28, 0, -1, -1, - 39, 0, 56, 0, 60, 0, -1, -1, 64, 0, -1, -1, -1, -1, 68, 0, -1, -1, 72, 0, -1, -1, 76, 0, 80, 0, -1, -1, -1, -1, 84, 0, - 90, 0, 95, 0, -1, -1, -1, -1, -1, -1, -1, -1, 100, 0, -1, -1, 105, 0, 110, 0, 115, 0, 120, 0,-127, 0,-121, 0, -1, -1, -1, -1, - -1, -1,-113, 0,-109, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,-105, 0, -1, -1,-101, 0, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -99, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -95, 0, -91, 0, -1, -1, -87, 0, -1, -1, -1, -1, -1, -1, -83, 0, -1, -1, -1, -1, -1, -1, -79, 0, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -75, 0, -1, -1, -70, 0, - -61, 0, -52, 0, -43, 0, -34, 0, -25, 0, -16, 0, -7, 0, 2, 1, 11, 1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 1, 25, 1, 30, 1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 1, -1, -1, 61, 1, -1, -1, 63, 1,-107, 1, -1, -1,-104, 1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,-100, 1, -1, -1, -37, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -33, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -28, 1, -17, 1, -12, 1, 7, 2, 11, 2, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 2, 30, 2, -1, -1, - -1, -1, -1, -1, 40, 2, 44, 2, 48, 2, 52, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 56, 2, 62, 2, 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, - 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 27, 91, - 66, 0, 27, 91, 72, 0, 27, 91, 68, 0, 27, 91, 67, 0, 27, 91, 65, 0, 27, 91, 80, 0, 27, 91, 77, 0, 27, 91, 49, 49, 109, 0, - 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 56, 109, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, - 37, 112, 49, 37, 100, 88, 0, 27, 91, 49, 48, 109, 0, 27, 91, 48, 59, 49, 48, 109, 0, 27, 91, 109, 0, 27, 91, 109, 0, 27, 91, 76, - 0, 8, 0, 27, 91, 66, 0, 27, 91, 72, 0, 27, 91, 76, 0, 27, 91, 68, 0, 27, 91, 67, 0, 27, 91, 65, 0, 13, 27, 91, 83, 0, - 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, - 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 83, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, - 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 84, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 91, 52, 105, 0, 27, - 91, 53, 105, 0, 37, 112, 49, 37, 99, 27, 91, 37, 112, 50, 37, 123, 49, 125, 37, 45, 37, 100, 98, 0, 27, 91, 37, 105, 37, 112, 49, 37, - 100, 100, 0, 10, 0, 27, 91, 48, 59, 49, 48, 37, 63, 37, 112, 49, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, - 59, 37, 63, 37, 112, 51, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 37, 63, 37, 112, 54, 37, 116, 59, 49, - 37, 59, 37, 63, 37, 112, 55, 37, 116, 59, 56, 37, 59, 37, 63, 37, 112, 57, 37, 116, 59, 49, 49, 37, 59, 109, 0, 27, 72, 0, 27, 91, - 73, 0, 43, 16, 44, 17, 45, 24, 46, 25, 48, -37, 96, 4, 97, -79, 102, -8, 103, -15, 104, -80, 106, -39, 107, -65, 108, -38, 109, -64, 110, -59, - 111, 126, 112, -60, 113, -60, 114, -60, 115, 95, 116, -61, 117, -76, 118, -63, 119, -62, 120, -77, 121, -13, 122, -14, 123, -29, 124, -40, 125,-100, 126, -2, - 0, 27, 91, 90, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 37, 91, 59, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 93, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 91, 51, 37, 112, 49, - 37, 100, 109, 0, 27, 91, 52, 37, 112, 49, 37, 100, 109, 0, 27, 40, 66, 0, 27, 41, 66, 0, 27, 42, 66, 0, 27, 43, 66, 0, 27, 91, + 26, 1, 40, 0, 23, 0, 16, 0, 125, 1, 68, 2, 97, 110, 115, 105, + 124, 97, 110, 115, 105, 47, 112, 99, 45, 116, 101, 114, 109, 32, 99, 111, + 109, 112, 97, 116, 105, 98, 108, 101, 32, 119, 105, 116, 104, 32, 99, 111, + 108, 111, 114, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 80, 0, 8, 0, + 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 8, 0, 64, 0, 3, 0, 0, 0, 4, 0, + 6, 0, -1, -1, 8, 0, 13, 0, 20, 0, 24, 0, 28, 0, -1, -1, + 39, 0, 56, 0, 60, 0, -1, -1, 64, 0, -1, -1, -1, -1, 68, 0, + -1, -1, 72, 0, -1, -1, 76, 0, 80, 0, -1, -1, -1, -1, 84, 0, + 90, 0, 95, 0, -1, -1, -1, -1, -1, -1, -1, -1, 100, 0, -1, -1, + 105, 0, 110, 0, 115, 0, 120, 0,-127, 0,-121, 0, -1, -1, -1, -1, + -1, -1,-113, 0,-109, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1,-105, 0, -1, -1,-101, 0, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -99, 0, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -95, 0, -91, 0, -1, -1, -87, 0, -1, -1, -1, -1, + -1, -1, -83, 0, -1, -1, -1, -1, -1, -1, -79, 0, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -75, 0, -1, -1, -70, 0, + -61, 0, -52, 0, -43, 0, -34, 0, -25, 0, -16, 0, -7, 0, 2, 1, + 11, 1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 1, 25, 1, 30, 1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 1, -1, -1, 61, 1, + -1, -1, 63, 1,-107, 1, -1, -1,-104, 1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +-100, 1, -1, -1, -37, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -33, 1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -28, 1, -17, 1, -12, 1, 7, 2, 11, 2, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 2, 30, 2, -1, -1, + -1, -1, -1, -1, 40, 2, 44, 2, 48, 2, 52, 2, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 56, 2, 62, 2, 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, + 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, + 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, + 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 27, 91, + 66, 0, 27, 91, 72, 0, 27, 91, 68, 0, 27, 91, 67, 0, 27, 91, + 65, 0, 27, 91, 80, 0, 27, 91, 77, 0, 27, 91, 49, 49, 109, 0, + 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 56, 109, 0, 27, + 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, + 37, 112, 49, 37, 100, 88, 0, 27, 91, 49, 48, 109, 0, 27, 91, 48, + 59, 49, 48, 109, 0, 27, 91, 109, 0, 27, 91, 109, 0, 27, 91, 76, + 0, 8, 0, 27, 91, 66, 0, 27, 91, 72, 0, 27, 91, 76, 0, 27, + 91, 68, 0, 27, 91, 67, 0, 27, 91, 65, 0, 13, 27, 91, 83, 0, + 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, + 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, + 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 83, 0, 27, 91, 37, + 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, + 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 84, + 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 91, 52, 105, 0, 27, + 91, 53, 105, 0, 37, 112, 49, 37, 99, 27, 91, 37, 112, 50, 37, 123, + 49, 125, 37, 45, 37, 100, 98, 0, 27, 91, 37, 105, 37, 112, 49, 37, + 100, 100, 0, 10, 0, 27, 91, 48, 59, 49, 48, 37, 63, 37, 112, 49, + 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, + 59, 37, 63, 37, 112, 51, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, + 52, 37, 116, 59, 53, 37, 59, 37, 63, 37, 112, 54, 37, 116, 59, 49, + 37, 59, 37, 63, 37, 112, 55, 37, 116, 59, 56, 37, 59, 37, 63, 37, + 112, 57, 37, 116, 59, 49, 49, 37, 59, 109, 0, 27, 72, 0, 27, 91, + 73, 0, 43, 16, 44, 17, 45, 24, 46, 25, 48, -37, 96, 4, 97, -79, + 102, -8, 103, -15, 104, -80, 106, -39, 107, -65, 108, -38, 109, -64, 110, -59, + 111, 126, 112, -60, 113, -60, 114, -60, 115, 95, 116, -61, 117, -76, 118, -63, + 119, -62, 120, -77, 121, -13, 122, -14, 123, -29, 124, -40, 125,-100, 126, -2, + 0, 27, 91, 90, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, 100, + 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 37, 91, 59, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 93, 99, 0, 27, 91, 99, + 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 91, 51, 37, 112, 49, + 37, 100, 109, 0, 27, 91, 52, 37, 112, 49, 37, 100, 109, 0, 27, 40, + 66, 0, 27, 41, 66, 0, 27, 42, 66, 0, 27, 43, 66, 0, 27, 91, 49, 49, 109, 0, 27, 91, 49, 48, 109, 0 }; From 16300d02c7fbe95396697fc6c09012e2c2b47b69 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sat, 27 May 2017 12:38:14 +0100 Subject: [PATCH 027/161] tui: Improvements to RGB colour support. The details are in the on-line help under :help true-color . The brief precis is that nvim is (I hope.) converging with tmux and libvte. It is taking the same approach with setrgbf and setrgbb terminfo capabilities that it does with the Ss and Se terminfo capabilities. --- runtime/doc/term.txt | 21 ++++++++++++------- src/nvim/tui/tui.c | 48 ++++++++++++++++++++++++++++++++++++-------- 2 files changed, 54 insertions(+), 15 deletions(-) diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index c4eefe4e53..fcfb548723 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -82,11 +82,16 @@ operation; and it will override |terminfo| saying that it has fewer colours available. *true-color* *xterm-true-color* -Nvim supports using true (24-bit) colours in the terminal. |terminfo| does -not contain flags to say when terminals have true colour support. So Nvim -simply assumes true colour support for (all) "xterm", "rxvt", "linux", -"putty", and "iterm" terminal types, or when Konsole or a terminal emulator -that sets the COLORTERM environment variable to "truecolor" is detected. +Nvim supports using true (24-bit) colours in the terminal, on terminals that +support it. It uses the same |terminfo| extensions that were proposed by +Rüdiger Sonderfeld in 2013 for this: "setrgbf" and "setrgbb". If your +terminfo definition specifies these, then nothing more is required. + +If your terminfo definition is missing them, then Nvim will on a wide range of +terminals resort to using the ISO 8613-6:1994/ITU T.416:1993 control sequences +for setting RGB colours. This includes the "rxvt", "linux", "st", and "iterm" +terminal types, or when Konsole, genuine Xterm, or a terminal emulator that +sets the COLORTERM environment variable to "truecolor" is detected. *xterm-resize* Nvim can resize the terminal display on some terminals that implement an @@ -99,12 +104,14 @@ Nvim will adjust the shape of the cursor from a block to a line when in insert mode (or as specified by the 'guicursor' option), on terminals that support it. It uses the same |terminfo| extensions that were pioneered by tmux for this: "Ss" and "Se". If your terminfo definition specifies these, as some -(such as "xterm+tmux") do, then nothing more is required. +(such as those based upon "xterm+tmux") do, then nothing more is required. If your terminfo definition is missing them, then Nvim will on a wide range of terminals resort to using the conventional DECSUSR control sequence for adjusting the cursor shape. If Konsole is detected, Nvim will use the -idiosyncratic Konsole terminal control sequences for this. +idiosyncratic Konsole terminal control sequences for this. Similarly if the +Linux kernel's built-in terminal emulator is detected, with its idiosyncratic +control sequence. Note: tmux itself accepts the conventional DECSUSR control sequence, the same as many other terminals do. It has to translate this into whatever control diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 58c9e75de8..3c985bcbcb 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -2447,7 +2447,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, // Dickey ncurses terminfo has included the Ss and Se capabilities, pioneered // by tmux, since 2011-07-14. So adding them to terminal types, that do - // actually have such control sequences but lack the currect definitions in + // actually have such control sequences but lack the correct definitions in // terminfo, is a fixup, not an augmentation. data->unibi_ext.reset_cursor_style = unibi_find_ext_str(ut, "Se"); data->unibi_ext.set_cursor_style = unibi_find_ext_str(ut, "Ss"); @@ -2479,7 +2479,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, // form. data->unibi_ext.set_cursor_style = (int)unibi_add_ext_str(ut, "Ss", "\x1b[%?" - "%p1%{4}%>" "%t%p1%{2}%-" // a bit of a bodge for extension values + "%p1%{4}%>" "%t%p1%{2}%-" // a bit of a bodge for extension values "%e%p1" // the conventional codes are just passed through "%;%d q"); if (-1 == data->unibi_ext.reset_cursor_style) { @@ -2537,6 +2537,7 @@ static void augment_terminfo(TUIData *data, const char *term, const char *colorterm, long vte_version, bool konsole, bool iterm) { unibi_term *ut = data->ut; + bool true_xterm = !!os_getenv("XTERM_VERSION"); bool xterm = term && STARTS_WITH(term, "xterm"); bool dtterm = term && STARTS_WITH(term, "dtterm"); bool linuxvt = term && STARTS_WITH(term, "linux"); @@ -2544,6 +2545,7 @@ static void augment_terminfo(TUIData *data, const char *term, bool teraterm = term && STARTS_WITH(term, "teraterm"); bool putty = term && STARTS_WITH(term, "putty"); bool screen = term && STARTS_WITH(term, "screen"); + bool st = term && STARTS_WITH(term, "st"); bool tmux_wrap = screen && !!os_getenv("TMUX"); bool truecolor = colorterm && (0 == strcmp(colorterm, "truecolor") || 0 == strcmp(colorterm, "24bit")); @@ -2561,13 +2563,43 @@ static void augment_terminfo(TUIData *data, const char *term, data->unibi_ext.reset_scroll_region = (int)unibi_add_ext_str(ut, NULL, "\x1b[r"); } - // See https://gist.github.com/XVilka/8346728 for more about this. - if (putty || xterm || rxvt || linuxvt || konsole || iterm || truecolor) { - data->unibi_ext.set_rgb_foreground = (int)unibi_add_ext_str(ut, NULL, - "\x1b[38;2;%p1%d;%p2%d;%p3%dm"); - data->unibi_ext.set_rgb_background = (int)unibi_add_ext_str(ut, NULL, - "\x1b[48;2;%p1%d;%p2%d;%p3%dm"); + + // Dickey ncurses terminfo does not include the setrgbf and setrgbb + // capabilities, proposed by Rüdiger Sonderfeld on 2013-10-15. So adding + // them to terminal types, that do actually have such control sequences but + // lack the correct definitions in terminfo, is an augmentation, not a + // fixup. See https://gist.github.com/XVilka/8346728 for more about this. + bool has_standard_rgb = vte_version >= 3600 // per GNOME bug #685759 + || true_xterm; + // "standard" means using colons like ISO 8613-6:1994/ITU T.416:1993 says. + bool has_non_standard_rgb = + linuxvt // Linux 4.8+ supports true-colour SGR. + || konsole // per commentary in VT102Emulation.cpp + // per http://lists.schmorp.de/pipermail/rxvt-unicode/2016q2/002261.html + || rxvt + || st // per experimentation + || iterm || truecolor; + data->unibi_ext.set_rgb_foreground = unibi_find_ext_str(ut, "setrgbf"); + if (-1 == data->unibi_ext.set_rgb_foreground) { + if (has_standard_rgb) { + data->unibi_ext.set_rgb_foreground = (int)unibi_add_ext_str(ut, "setrgbf", + "\x1b[38:2:%p1%d:%p2%d:%p3%dm"); + } else if (has_non_standard_rgb) { + data->unibi_ext.set_rgb_foreground = (int)unibi_add_ext_str(ut, "setrgbf", + "\x1b[38;2;%p1%d;%p2%d;%p3%dm"); + } } + data->unibi_ext.set_rgb_background = unibi_find_ext_str(ut, "setrgbb"); + if (-1 == data->unibi_ext.set_rgb_background) { + if (has_standard_rgb) { + data->unibi_ext.set_rgb_background = (int)unibi_add_ext_str(ut, "setrgbb", + "\x1b[48:2:%p1%d:%p2%d:%p3%dm"); + } else if (has_non_standard_rgb) { + data->unibi_ext.set_rgb_background = (int)unibi_add_ext_str(ut, "setrgbb", + "\x1b[48;2;%p1%d;%p2%d;%p3%dm"); + } + } + if (iterm) { data->unibi_ext.set_cursor_color = (int)unibi_add_ext_str( ut, NULL, TMUX_WRAP(tmux_wrap, "\033]Pl%p1%06x\033\\")); From a2434aeddb6da97b034ddeb55d990c8838f5e664 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sat, 27 May 2017 15:05:26 +0100 Subject: [PATCH 028/161] tui: Remove tmux wrapper from the Konsole path. tmux has its own code path, now; and the tmux wrapping was not the ideal thing to do in the first place. Also improve the commentary on the built-in terminfo records. --- src/nvim/tui/tui.c | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 3c985bcbcb..9b3aa1cf43 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1148,7 +1148,7 @@ static int unibi_find_ext_str(unibi_term *ut, const char *name) // on the compiled files. // Taken from Dickey ncurses terminfo.src dated 2017-04-22. -// This is a 256-colour terminfo description that lacks +// This is a 256-colour terminfo description that lacks true-colour and // DECSTBN/DECSLRM/DECLRMM capabilities that xterm actually has. static const char xterm_256colour_terminfo[] = { 26, 1, 37, 0, 29, 0, 15, 0, 105, 1, -42, 5, 120, 116, 101, 114, @@ -1588,6 +1588,8 @@ static const char iterm_16colour_terminfo[] = { 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0 }; // Taken from Dickey ncurses terminfo.src dated 2017-04-22. +// This is a 256-colour terminfo description that lacks true-colour +// capabilities that rxvt actually has. static const char rxvt_256colour_terminfo[] = { 26, 1, 47, 0, 29, 0, 15, 0, 110, 1, -31, 4, 114, 120, 118, 116, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 114, 120, 118, 116, 32, 50, @@ -1723,6 +1725,8 @@ static const char rxvt_256colour_terminfo[] = { 40, 48, 0 }; // Taken from Dickey ncurses terminfo.src dated 2017-04-22. +// This is a 16-colour terminfo description that lacks true-colour +// and 256-colour capabilities that linux (4.8+) actually has. static const char linux_16colour_terminfo[] = { 26, 1, 43, 0, 29, 0, 16, 0, 125, 1, 125, 3, 108, 105, 110, 117, 120, 45, 49, 54, 99, 111, 108, 111, 114, 124, 108, 105, 110, 117, 120, 32, @@ -2066,6 +2070,8 @@ static const char interix_8colour_terminfo[] = { 0, 27, 91, 52, 37, 112, 49, 37, 100, 109, 0 }; // Taken from Dickey ncurses terminfo.src dated 2017-04-22. +// This is a 256-colour terminfo description that lacks true-colour +// capabilities that stterm actually has. static const char st_256colour_terminfo[] = { 26, 1, 55, 0, 29, 0, 15, 0, 105, 1, 117, 5, 115, 116, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 115, 116, 116, 101, 114, 109, 45, 50, @@ -2510,23 +2516,25 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, } unibi_set_ext_str(ut, (size_t)data->unibi_ext.reset_cursor_style, "\x1b[?c"); } else if (konsole) { - // Konsole uses an idiosyncratic escape code to set the cursor shape and does - // not support DECSCUSR. The tmux wrapping is unused, now. + // Konsole uses an idiosyncratic escape code to set the cursor shape and + // does not support DECSCUSR. This makes Konsole set up and apply a + // nonce profile, which has side-effects on temporary font resizing. + // In an ideal world, Konsole would just support DECSCUSR. data->unibi_ext.set_cursor_style = (int)unibi_add_ext_str(ut, "Ss", - TMUX_WRAP(tmux_wrap, "\x1b]50;CursorShape=%?" - "%p1%{3}%<" "%t%{0}" // block - "%e%p1%{4}%<" "%t%{2}" // underline - "%e%{1}" // everything else is bar - "%;%d;BlinkingCursorEnabled=%?" - "%p1%{1}%<" "%t%{1}" // Fortunately if we exclude zero as special, - "%e%p1%{1}%&" // in all other cases we can treat bit #0 as a flag. - "%;%d\x07")); + "\x1b]50;CursorShape=%?" + "%p1%{3}%<" "%t%{0}" // block + "%e%p1%{4}%<" "%t%{2}" // underline + "%e%{1}" // everything else is bar + "%;%d;BlinkingCursorEnabled=%?" + "%p1%{1}%<" "%t%{1}" // Fortunately if we exclude zero as special, + "%e%p1%{1}%&" // in all other cases we can treat bit #0 as a flag. + "%;%d\x07"); if (-1 == data->unibi_ext.reset_cursor_style) { data->unibi_ext.reset_cursor_style = (int)unibi_add_ext_str(ut, "Se", ""); } unibi_set_ext_str(ut, (size_t)data->unibi_ext.reset_cursor_style, - TMUX_WRAP(tmux_wrap, "\x1b]50;CursorShape=0;BlinkingCursorEnabled=1\x07")); + "\x1b]50;\x07"); } } } @@ -2601,6 +2609,9 @@ static void augment_terminfo(TUIData *data, const char *term, } if (iterm) { + // FIXME: Bypassing tmux like this affects the cursor colour globally, in + // all panes, which is not particularly desirable. A better approach + // would use a tmux control sequence and an extra if(screen) test. data->unibi_ext.set_cursor_color = (int)unibi_add_ext_str( ut, NULL, TMUX_WRAP(tmux_wrap, "\033]Pl%p1%06x\033\\")); } else if (xterm) { From e6cbb01b5539ee9a099714b5372ea8bfd0d3bc7d Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sat, 27 May 2017 18:11:35 +0100 Subject: [PATCH 029/161] tui: Update colour tests. --- test/functional/terminal/tui_spec.lua | 142 ++++++++++++++++++++++---- 1 file changed, 123 insertions(+), 19 deletions(-) diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index 3ed63f68e9..b3aaa83b17 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -318,6 +318,7 @@ end) describe("tui 't_Co' (terminal colors)", function() local screen local is_linux = (helpers.eval("system('uname') =~? 'linux'") == 1) + local is_freebsd = (helpers.eval("system('uname') =~? 'FreeBSD'") == 1) local function assert_term_colors(term, colorterm, maxcolors) helpers.clear({env={TERM=term}, args={}}) @@ -332,7 +333,7 @@ describe("tui 't_Co' (terminal colors)", function() thelpers.feed_data(":echo &t_Co\n") helpers.wait() local tline - if maxcolors == 8 then + if maxcolors == 8 or maxcolors == 16 then tline = "~ " else tline = "{4:~ }" @@ -348,35 +349,71 @@ describe("tui 't_Co' (terminal colors)", function() ]], tline, tline, tline, tostring(maxcolors and maxcolors or ""))) end - it("unknown TERM sets empty 't_Co'", function() - assert_term_colors("yet-another-term", nil, nil) + -- ansi and no terminal type at all: + + it("no TERM uses 8 colors", function() + assert_term_colors(nil, nil, 8) end) - it("unknown TERM with COLORTERM=screen-256color uses 256 colors", function() - assert_term_colors("yet-another-term", "screen-256color", 256) + it("TERM=ansi no COLORTERM uses 8 colors", function() + assert_term_colors("ansi", nil, 8) end) + it("TERM=ansi with COLORTERM=anything-no-number uses 16 colors", function() + assert_term_colors("ansi", "yet-another-term", 16) + end) + + it("unknown TERM COLORTERM with 256 in name uses 256 colors", function() + assert_term_colors("ansi", "yet-another-term-256color", 256) + end) + + it("TERM=ansi-256color sets 256 colours", function() + assert_term_colors("ansi-256color", nil, 256) + end) + + -- Unknown terminal types: + + it("unknown TERM no COLORTERM sets 8 colours", function() + assert_term_colors("yet-another-term", nil, 8) + end) + + it("unknown TERM with COLORTERM=anything-no-number uses 16 colors", function() + assert_term_colors("yet-another-term", "yet-another-term", 16) + end) + + it("unknown TERM with 256 in name sets 256 colours", function() + assert_term_colors("yet-another-term-256color", nil, 256) + end) + + it("unknown TERM COLORTERM with 256 in name uses 256 colors", function() + assert_term_colors("yet-another-term", "yet-another-term-256color", 256) + end) + + -- Linux kernel terminal emulator: + it("TERM=linux uses 256 colors", function() - if is_linux then - assert_term_colors("linux", nil, 256) - else - pending() - end + assert_term_colors("linux", nil, 256) end) it("TERM=linux-16color uses 256 colors", function() - if is_linux then - assert_term_colors("linux-16color", nil, 256) + assert_term_colors("linux-16color", nil, 256) + end) + + -- screen and tmux: + + it("TERM=screen no COLORTERM uses 8/256 colors", function() + if is_freebsd then + assert_term_colors("screen", nil, 256) else - pending() + assert_term_colors("screen", nil, 8) end end) - it("TERM=screen uses 8 colors", function() - if is_linux then - assert_term_colors("screen", nil, 8) + it("TERM=screen COLORTERM=screen uses 16/256 colors", function() + if is_freebsd then + assert_term_colors("screen", "screen", 256) else - pending() + assert_term_colors("screen", "screen", 16) end end) @@ -384,15 +421,82 @@ describe("tui 't_Co' (terminal colors)", function() assert_term_colors("screen", "screen-256color", 256) end) - it("TERM=yet-another-term COLORTERM=screen-256color uses 256 colors", function() - assert_term_colors("screen", "screen-256color", 256) + it("TERM=screen-256color no COLORTERM uses 256 colors", function() + assert_term_colors("screen-256color", nil, 256) end) + it("TERM=tmux no COLORTERM uses 8/256 colors", function() + if is_freebsd then + assert_term_colors("tmux", nil, 256) + else + assert_term_colors("tmux", nil, 8) + end + end) + + it("TERM=tmux COLORTERM=tmux uses 16/256 colors", function() + if is_freebsd then + assert_term_colors("tmux", "tmux", 256) + else + assert_term_colors("tmux", "tmux", 16) + end + end) + + it("TERM=tmux COLORTERM=tmux-256color uses 256 colors", function() + assert_term_colors("tmux", "tmux-256color", 256) + end) + + it("TERM=tmux-256color no COLORTERM uses 256 colors", function() + assert_term_colors("tmux-256color", nil, 256) + end) + + -- xterm and imitators: + it("TERM=xterm uses 256 colors", function() assert_term_colors("xterm", nil, 256) end) + it("TERM=xterm COLORTERM=gnome-terminal uses 256 colors", function() + assert_term_colors("xterm", "gnome-terminal", 256) + end) + + it("TERM=xterm COLORTERM=mate-terminal uses 256 colors", function() + assert_term_colors("xterm", "mate-terminal", 256) + end) + it("TERM=xterm-256color uses 256 colors", function() assert_term_colors("xterm-256color", nil, 256) end) + + -- rxvt and stterm: + + it("TERM=rxvt no COLORTERM uses 256 colors", function() + assert_term_colors("rxvt", nil, 256) + end) + + it("TERM=rxvt-256color uses 256 colors", function() + assert_term_colors("rxvt-256color", nil, 256) + end) + + it("TERM=st no COLORTERM uses 256 colors", function() + assert_term_colors("st", nil, 256) + end) + + it("TERM=st-256color uses 256 colors", function() + assert_term_colors("st-256color", nil, 256) + end) + + -- others: + + it("TERM=interix uses 8 colors", function() + assert_term_colors("interix", nil, 8) + end) + + it("TERM=iterm uses 16/256 colors", function() + if is_freebsd then + assert_term_colors("iterm", nil, 256) + else + assert_term_colors("iterm", nil, 16) + end + end) + end) From 8768b7f4a045093001c55d12a85419bebe5869dc Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sat, 27 May 2017 18:36:31 +0100 Subject: [PATCH 030/161] tui: Remove now-unused flag variable. Follows on from fcf0d13f48bffbd41749069ce383d01153dd960c. --- src/nvim/tui/tui.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 9b3aa1cf43..a687b3dc64 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -2358,7 +2358,6 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, bool teraterm = term && STARTS_WITH(term, "teraterm"); bool putty = term && STARTS_WITH(term, "putty"); bool screen = term && STARTS_WITH(term, "screen"); - bool tmux_wrap = screen && !!os_getenv("TMUX"); char *fix_normal = (char *)unibi_get_str(ut, unibi_cursor_normal); if (fix_normal) { From 1f3b5e1a826fbff8ce2fa84e0e50d082d65a08bd Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sat, 27 May 2017 19:04:06 +0100 Subject: [PATCH 031/161] tui: Correct error in terminfo extension processing. Using the wrong unibilium query function just happened to work with the various terminfo records used in local testing. --- src/nvim/tui/tui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index a687b3dc64..d71f4b6656 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1133,7 +1133,7 @@ static void unibi_set_if_empty(unibi_term *ut, enum unibi_string str, static int unibi_find_ext_str(unibi_term *ut, const char *name) { - size_t max = unibi_count_ext_bool(ut); + size_t max = unibi_count_ext_str(ut); for (size_t i = 0; i < max; ++i) { const char * n = unibi_get_ext_str_name(ut, i); if (0 == strcmp(n, name)) { From 6910bfee0fb9470b0b30e5a46efeebfe760e6a2c Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sat, 27 May 2017 19:11:00 +0100 Subject: [PATCH 032/161] tui: Correct error in terminfo extension processing. Using the right unibilium query function then revealed a latent NULL pointer problem. --- src/nvim/tui/tui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index d71f4b6656..15a0be0e42 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1136,7 +1136,7 @@ static int unibi_find_ext_str(unibi_term *ut, const char *name) size_t max = unibi_count_ext_str(ut); for (size_t i = 0; i < max; ++i) { const char * n = unibi_get_ext_str_name(ut, i); - if (0 == strcmp(n, name)) { + if (n && 0 == strcmp(n, name)) { return (int)i; } } From 8f60395dd1fdf3b6995c75475878e2d73e7482c0 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sat, 27 May 2017 19:52:14 +0100 Subject: [PATCH 033/161] tui: Update colour tests some more. --- test/functional/terminal/tui_spec.lua | 42 +++++++++++++++------------ 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index b3aaa83b17..ff4314c36c 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -425,20 +425,12 @@ describe("tui 't_Co' (terminal colors)", function() assert_term_colors("screen-256color", nil, 256) end) - it("TERM=tmux no COLORTERM uses 8/256 colors", function() - if is_freebsd then - assert_term_colors("tmux", nil, 256) - else - assert_term_colors("tmux", nil, 8) - end + it("TERM=tmux no COLORTERM uses 256 colors", function() + assert_term_colors("tmux", nil, 256) end) - it("TERM=tmux COLORTERM=tmux uses 16/256 colors", function() - if is_freebsd then - assert_term_colors("tmux", "tmux", 256) - else - assert_term_colors("tmux", "tmux", 16) - end + it("TERM=tmux COLORTERM=tmux uses 256 colors", function() + assert_term_colors("tmux", "tmux", 256) end) it("TERM=tmux COLORTERM=tmux-256color uses 256 colors", function() @@ -477,7 +469,23 @@ describe("tui 't_Co' (terminal colors)", function() assert_term_colors("rxvt-256color", nil, 256) end) - it("TERM=st no COLORTERM uses 256 colors", function() + it("TERM=st no COLORTERM uses 8/256 colors", function() + if is_freebsd then + assert_term_colors("st", nil, 256) + else + assert_term_colors("st", nil, 8) + end + end) + + it("TERM=st COLORTERM=st uses 16/256 colors", function() + if is_freebsd then + assert_term_colors("st", nil, 256) + else + assert_term_colors("st", nil, 16) + end + end) + + it("TERM=st COLORTERM=st-256color uses 256 colors", function() assert_term_colors("st", nil, 256) end) @@ -491,12 +499,8 @@ describe("tui 't_Co' (terminal colors)", function() assert_term_colors("interix", nil, 8) end) - it("TERM=iterm uses 16/256 colors", function() - if is_freebsd then - assert_term_colors("iterm", nil, 256) - else - assert_term_colors("iterm", nil, 16) - end + it("TERM=iterm uses 256 colors", function() + assert_term_colors("iterm", nil, 256) end) end) From 0d537672748bfd49674a21fdd9cac2b79c2085a9 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sat, 27 May 2017 20:08:02 +0100 Subject: [PATCH 034/161] tui: Add iTerm and rxvt to the terminals that know extended DECSCUSR. --- src/nvim/tui/tui.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 15a0be0e42..5c191d94a8 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -2462,7 +2462,9 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, // teminfo entries. See // https://github.com/gnachman/iTerm2/pull/92 for more. // xterm even has an extended version that has a vertical bar. - if (true_xterm // per xterm ctlseqs doco (since version 282) + if (true_xterm // per xterm ctlseqs doco (since version 282) + || rxvt // per command.C + || iterm // per analysis of VT100Terminal.m // Allows forcing the use of DECSCUSR on linux type terminals, such as // console-terminal-emulator from the nosh toolset, which does indeed // implement the xterm extension: From 24db94b1a6d821699222564856f8e1d89841dfa6 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sun, 28 May 2017 00:55:04 +0100 Subject: [PATCH 035/161] tui: Fix Interix and account for deferred wrap. The Interix termcap entry is missing the carriage_return capability which nvim relies upon. And Interix is one of the few terminal emulators that does not defer automatic wrap at the right margin, which is now accounted for when moving the cursor left and when outputting whole lines at a time. --- src/nvim/tui/tui.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 5c191d94a8..3d27758b01 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -76,6 +76,7 @@ typedef struct { bool can_change_scroll_region; bool can_set_lr_margin; bool can_set_left_right_margin; + bool immediate_wrap_after_last_column; bool mouse_enabled; bool busy; cursorentry_T cursor_shapes[SHAPE_IDX_COUNT]; @@ -184,6 +185,8 @@ static void terminfo_start(UI *ui) data->can_set_left_right_margin = !!unibi_get_str(data->ut, unibi_set_left_margin_parm) && !!unibi_get_str(data->ut, unibi_set_right_margin_parm); + data->immediate_wrap_after_last_column = + term && STARTS_WITH(term, "interix"); // Set 't_Co' from the result of unibilium & fix_terminfo. t_colors = unibi_get_num(data->ut, unibi_max_colors); // Enter alternate screen and clear @@ -423,6 +426,23 @@ static bool cheap_to_print(UI *ui, int row, int col, int next) return true; } +/// The behaviour that this is checking for the absence of is undocumented, +/// but is implemented in the majority of terminals and terminal emulators. +/// Printing at the right margin does not cause an automatic wrap until the +/// next character is printed, holding the cursor in place until then. +static void check_final_column_wrap(UI *ui) +{ + TUIData *data = ui->data; + if (!data->immediate_wrap_after_last_column) { + return; + } + UGrid *grid = &data->grid; + if (grid->col == ui->width) { + grid->col = 0; + ++grid->row; + } +} + /// This optimizes several cases where it is cheaper to do something other /// than send a full cursor positioning control sequence. However, there are /// some further optimizations that may seem obvious but that will not work. @@ -460,6 +480,7 @@ static void cursor_goto(UI *ui, int row, int col) grid->col, col - 1, { print_cell(ui, cell); ++grid->col; + check_final_column_wrap(ui); }); } } @@ -471,6 +492,9 @@ static void cursor_goto(UI *ui, int row, int col) unibi_out(ui, unibi_cursor_left); } } else { + if (!data->immediate_wrap_after_last_column && grid->col >= ui->width) { + --n; // We have calculated one too many columns because of delayed wrap. + } data->params[0].i = n; unibi_out(ui, unibi_parm_left_cursor); } @@ -565,6 +589,7 @@ static void clear_region(UI *ui, int top, int bot, int left, int right) cursor_goto(ui, row, col); print_cell(ui, cell); ++grid->col; + check_final_column_wrap(ui); }); } @@ -879,6 +904,7 @@ static void tui_put(UI *ui, String text) { TUIData *data = ui->data; print_cell(ui, ugrid_put(&data->grid, (uint8_t *)text.data, text.size)); + check_final_column_wrap(ui); } static void tui_bell(UI *ui) @@ -932,6 +958,7 @@ static void tui_flush(UI *ui) cursor_goto(ui, row, col); print_cell(ui, cell); ++grid->col; + check_final_column_wrap(ui); }); } @@ -2408,6 +2435,8 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, } else if (term && STARTS_WITH(term, "tmux")) { unibi_set_if_empty(ut, unibi_to_status_line, "\x1b_"); unibi_set_if_empty(ut, unibi_from_status_line, "\x1b\\"); + } else if (term && STARTS_WITH(term, "interix")) { + unibi_set_if_empty(ut, unibi_carriage_return, "\x0d"); } else if (linuxvt) { // No deviations from the vanilla terminfo. } else if (term && STARTS_WITH(term, "putty")) { From 3f8dedd7aefaa64cea83add75715701b50625812 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sun, 28 May 2017 01:30:08 +0100 Subject: [PATCH 036/161] tui: Correct a copy and paste error in stterm tests. The test decsription was correct; the test was not. --- test/functional/terminal/tui_spec.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index ff4314c36c..ac30be1e58 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -479,14 +479,14 @@ describe("tui 't_Co' (terminal colors)", function() it("TERM=st COLORTERM=st uses 16/256 colors", function() if is_freebsd then - assert_term_colors("st", nil, 256) + assert_term_colors("st", "st", 256) else - assert_term_colors("st", nil, 16) + assert_term_colors("st", "st", 16) end end) it("TERM=st COLORTERM=st-256color uses 256 colors", function() - assert_term_colors("st", nil, 256) + assert_term_colors("st", "st-256color", 256) end) it("TERM=st-256color uses 256 colors", function() From 5377de33ac4adea54c9c9980c7a6bc8cc70c0c7a Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sun, 28 May 2017 12:18:01 +0100 Subject: [PATCH 037/161] tui: Add st to the always 256-colour capable list. Also comment and augment some terminal colour tests. --- src/nvim/tui/tui.c | 2 +- test/functional/terminal/tui_spec.lua | 49 ++++++++++++++++++++------- 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 3d27758b01..5ea46c5ab7 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -2459,7 +2459,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, if (unibi_get_num(ut, unibi_max_colors) < 256) { // See http://fedoraproject.org/wiki/Features/256_Color_Terminals for // more on this. - if (konsole || mate || xterm || gnome || rxvt + if (konsole || mate || xterm || gnome || rxvt || st || linuxvt // Linux 4.8+ supports 256-colour SGR. || (colorterm && strstr(colorterm, "256")) || (term && strstr(term, "256")) diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index ac30be1e58..225a1fc170 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -399,7 +399,15 @@ describe("tui 't_Co' (terminal colors)", function() assert_term_colors("linux-16color", nil, 256) end) + it("TERM=linux-256color uses 256 colors", function() + assert_term_colors("linux-256color", nil, 256) + end) + -- screen and tmux: + -- + -- FreeBSD falls back to the built-in screen-256colour entry. + -- Linux and MacOS have a screen entry in external terminfo with 8 colours, + -- which is raised to 16 by COLORTERM. it("TERM=screen no COLORTERM uses 8/256 colors", function() if is_freebsd then @@ -460,35 +468,48 @@ describe("tui 't_Co' (terminal colors)", function() end) -- rxvt and stterm: + -- + -- FreeBSD and MacOS fall back to the built-in rxvt-256color and + -- st-256colour entries. + -- Linux has an rxvt, an st, and an st-16color entry in external terminfo + -- with 8, 8, and 16 colours respectively, which are raised to 256. it("TERM=rxvt no COLORTERM uses 256 colors", function() assert_term_colors("rxvt", nil, 256) end) + it("TERM=rxvt COLORTERM=rxvt uses 256 colors", function() + assert_term_colors("rxvt", "rxvt", 256) + end) + it("TERM=rxvt-256color uses 256 colors", function() assert_term_colors("rxvt-256color", nil, 256) end) - it("TERM=st no COLORTERM uses 8/256 colors", function() - if is_freebsd then - assert_term_colors("st", nil, 256) - else - assert_term_colors("st", nil, 8) - end + it("TERM=st no COLORTERM uses 256 colors", function() + assert_term_colors("st", nil, 256) end) - it("TERM=st COLORTERM=st uses 16/256 colors", function() - if is_freebsd then - assert_term_colors("st", "st", 256) - else - assert_term_colors("st", "st", 16) - end + it("TERM=st COLORTERM=st uses 256 colors", function() + assert_term_colors("st", "st", 256) end) it("TERM=st COLORTERM=st-256color uses 256 colors", function() assert_term_colors("st", "st-256color", 256) end) + it("TERM=st-16color no COLORTERM uses 8/256 colors", function() + assert_term_colors("st", nil, 256) + end) + + it("TERM=st-16color COLORTERM=st uses 16/256 colors", function() + assert_term_colors("st", "st", 256) + end) + + it("TERM=st-16color COLORTERM=st-256color uses 256 colors", function() + assert_term_colors("st", "st-256color", 256) + end) + it("TERM=st-256color uses 256 colors", function() assert_term_colors("st-256color", nil, 256) end) @@ -499,6 +520,10 @@ describe("tui 't_Co' (terminal colors)", function() assert_term_colors("interix", nil, 8) end) + it("TERM=iTerm.app uses 256 colors", function() + assert_term_colors("iTerm.app", nil, 256) + end) + it("TERM=iterm uses 256 colors", function() assert_term_colors("iterm", nil, 256) end) From 5265ac500064eecba3317ad8152cab14e9950db7 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sun, 28 May 2017 12:42:22 +0100 Subject: [PATCH 038/161] tui: Change terminal family recognition to avoid '+' entries. The terminfo commentary states that these are not standalone entries suitable for end-use. --- src/nvim/tui/tui.c | 63 +++++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 5ea46c5ab7..d0ed3af897 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -48,6 +48,12 @@ #define TMUX_WRAP(is_tmux,seq) ((is_tmux) ? "\x1bPtmux;\x1b" seq "\x1b\\" : seq) #define LINUXRESETC "\x1b[?0c" +// Per the commentary in terminfo, only a minus sign is a true suffix +// separator. +#define TERMINAL_FAMILY(term, prefix) ((term) \ + && (0 == memcmp((term), (prefix), sizeof(prefix) - 1)) \ + && ('\0' == (term)[sizeof(prefix) - 1] || '-' == (term)[sizeof(prefix) - 1])) + typedef struct { int top, bot, left, right; } Rect; @@ -186,7 +192,7 @@ static void terminfo_start(UI *ui) !!unibi_get_str(data->ut, unibi_set_left_margin_parm) && !!unibi_get_str(data->ut, unibi_set_right_margin_parm); data->immediate_wrap_after_last_column = - term && STARTS_WITH(term, "interix"); + TERMINAL_FAMILY(term, "interix"); // Set 't_Co' from the result of unibilium & fix_terminfo. t_colors = unibi_get_num(data->ut, unibi_max_colors); // Enter alternate screen and clear @@ -2344,23 +2350,23 @@ static const char ansi_terminfo[] = { /// behave as much like an external terminfo database as possible. static unibi_term *load_builtin_terminfo(const char * term) { - if (term && STARTS_WITH(term, "xterm")) { + if (TERMINAL_FAMILY(term, "xterm")) { return unibi_from_mem(xterm_256colour_terminfo, sizeof xterm_256colour_terminfo); - } else if (term && STARTS_WITH(term, "screen")) { + } else if (TERMINAL_FAMILY(term, "screen")) { return unibi_from_mem(screen_256colour_terminfo, sizeof screen_256colour_terminfo); - } else if (term && STARTS_WITH(term, "tmux")) { + } else if (TERMINAL_FAMILY(term, "tmux")) { return unibi_from_mem(tmux_256colour_terminfo, sizeof tmux_256colour_terminfo); - } else if (term && STARTS_WITH(term, "rxvt")) { + } else if (TERMINAL_FAMILY(term, "rxvt")) { return unibi_from_mem(rxvt_256colour_terminfo, sizeof rxvt_256colour_terminfo); - } else if (term && STARTS_WITH(term, "putty")) { + } else if (TERMINAL_FAMILY(term, "putty")) { return unibi_from_mem(putty_256colour_terminfo, sizeof putty_256colour_terminfo); - } else if (term && STARTS_WITH(term, "linux")) { + } else if (TERMINAL_FAMILY(term, "linux")) { return unibi_from_mem(linux_16colour_terminfo, sizeof linux_16colour_terminfo); - } else if (term && STARTS_WITH(term, "interix")) { + } else if (TERMINAL_FAMILY(term, "interix")) { return unibi_from_mem(interix_8colour_terminfo, sizeof interix_8colour_terminfo); - } else if (term && (STARTS_WITH(term, "iterm") || STARTS_WITH(term, "iTerm"))) { + } else if (TERMINAL_FAMILY(term, "iterm") || TERMINAL_FAMILY(term, "iTerm.app")) { return unibi_from_mem(iterm_16colour_terminfo, sizeof iterm_16colour_terminfo); - } else if (term && STARTS_WITH(term, "st")) { + } else if (TERMINAL_FAMILY(term, "st")) { return unibi_from_mem(st_256colour_terminfo, sizeof st_256colour_terminfo); } else { return unibi_from_mem(ansi_terminfo, sizeof ansi_terminfo); @@ -2377,14 +2383,15 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, { unibi_term *ut = data->ut; bool true_xterm = !!os_getenv("XTERM_VERSION"); - bool xterm = term && STARTS_WITH(term, "xterm"); + bool xterm = TERMINAL_FAMILY(term, "xterm"); bool mate = colorterm && strstr(colorterm, "mate-terminal"); bool gnome = colorterm && strstr(colorterm, "gnome-terminal"); - bool linuxvt = term && STARTS_WITH(term, "linux"); - bool rxvt = term && STARTS_WITH(term, "rxvt"); - bool teraterm = term && STARTS_WITH(term, "teraterm"); - bool putty = term && STARTS_WITH(term, "putty"); - bool screen = term && STARTS_WITH(term, "screen"); + bool linuxvt = TERMINAL_FAMILY(term, "linux"); + bool rxvt = TERMINAL_FAMILY(term, "rxvt"); + bool teraterm = TERMINAL_FAMILY(term, "teraterm"); + bool putty = TERMINAL_FAMILY(term, "putty"); + bool screen = TERMINAL_FAMILY(term, "screen"); + bool st = TERMINAL_FAMILY(term, "st"); char *fix_normal = (char *)unibi_get_str(ut, unibi_cursor_normal); if (fix_normal) { @@ -2432,16 +2439,16 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, } else if (screen) { unibi_set_if_empty(ut, unibi_to_status_line, "\x1b_"); unibi_set_if_empty(ut, unibi_from_status_line, "\x1b\\"); - } else if (term && STARTS_WITH(term, "tmux")) { + } else if (TERMINAL_FAMILY(term, "tmux")) { unibi_set_if_empty(ut, unibi_to_status_line, "\x1b_"); unibi_set_if_empty(ut, unibi_from_status_line, "\x1b\\"); - } else if (term && STARTS_WITH(term, "interix")) { + } else if (TERMINAL_FAMILY(term, "interix")) { unibi_set_if_empty(ut, unibi_carriage_return, "\x0d"); } else if (linuxvt) { // No deviations from the vanilla terminfo. - } else if (term && STARTS_WITH(term, "putty")) { + } else if (TERMINAL_FAMILY(term, "putty")) { // No deviations from the vanilla terminfo. - } else if (term && (STARTS_WITH(term, "iterm") || STARTS_WITH(term, "iTerm"))) { + } else if (TERMINAL_FAMILY(term, "iterm") || TERMINAL_FAMILY(term, "iTerm.app")) { // No deviations from the vanilla terminfo. } @@ -2576,14 +2583,14 @@ static void augment_terminfo(TUIData *data, const char *term, { unibi_term *ut = data->ut; bool true_xterm = !!os_getenv("XTERM_VERSION"); - bool xterm = term && STARTS_WITH(term, "xterm"); - bool dtterm = term && STARTS_WITH(term, "dtterm"); - bool linuxvt = term && STARTS_WITH(term, "linux"); - bool rxvt = term && STARTS_WITH(term, "rxvt"); - bool teraterm = term && STARTS_WITH(term, "teraterm"); - bool putty = term && STARTS_WITH(term, "putty"); - bool screen = term && STARTS_WITH(term, "screen"); - bool st = term && STARTS_WITH(term, "st"); + bool xterm = TERMINAL_FAMILY(term, "xterm"); + bool dtterm = TERMINAL_FAMILY(term, "dtterm"); + bool linuxvt = TERMINAL_FAMILY(term, "linux"); + bool rxvt = TERMINAL_FAMILY(term, "rxvt"); + bool teraterm = TERMINAL_FAMILY(term, "teraterm"); + bool putty = TERMINAL_FAMILY(term, "putty"); + bool screen = TERMINAL_FAMILY(term, "screen"); + bool st = TERMINAL_FAMILY(term, "st"); bool tmux_wrap = screen && !!os_getenv("TMUX"); bool truecolor = colorterm && (0 == strcmp(colorterm, "truecolor") || 0 == strcmp(colorterm, "24bit")); From 41403c6d25e00bfad004a85111abb3d88190fdbb Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sun, 28 May 2017 13:54:38 +0100 Subject: [PATCH 039/161] tui: Treat genuine Xterm and iTerm.app as standards-conformant. They both can handle SGR control sequences in the form set out in ISO 8613-6:1994/ITU T.416:1993. --- src/nvim/tui/tui.c | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index d0ed3af897..725310d645 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1512,7 +1512,7 @@ static const char screen_256colour_terminfo[] = { 85, 80, 53, 0, 107, 97, 50, 0, 107, 98, 49, 0, 107, 98, 51, 0, 107, 99, 50, 0 }; // Taken from Dickey ncurses terminfo.src dated 2017-04-22. -static const char iterm_16colour_terminfo[] = { +static const char iterm_256colour_terminfo[] = { 26, 1, 57, 0, 29, 0, 15, 0, 105, 1, 73, 3, 105, 84, 101, 114, 109, 46, 97, 112, 112, 124, 105, 116, 101, 114, 109, 124, 105, 84, 101, 114, 109, 46, 97, 112, 112, 32, 116, 101, 114, 109, 105, 110, 97, 108, 32, 101, @@ -2365,7 +2365,7 @@ static unibi_term *load_builtin_terminfo(const char * term) } else if (TERMINAL_FAMILY(term, "interix")) { return unibi_from_mem(interix_8colour_terminfo, sizeof interix_8colour_terminfo); } else if (TERMINAL_FAMILY(term, "iterm") || TERMINAL_FAMILY(term, "iTerm.app")) { - return unibi_from_mem(iterm_16colour_terminfo, sizeof iterm_16colour_terminfo); + return unibi_from_mem(iterm_256colour_terminfo, sizeof iterm_256colour_terminfo); } else if (TERMINAL_FAMILY(term, "st")) { return unibi_from_mem(st_256colour_terminfo, sizeof st_256colour_terminfo); } else { @@ -2379,7 +2379,7 @@ static unibi_term *load_builtin_terminfo(const char * term) /// external or a built-in database. In an ideal world, the real terminfo data /// would be correct and complete, and this function would be almost empty. static void patch_terminfo_bugs(TUIData *data, const char *term, - const char *colorterm, long vte_version, bool konsole, bool iterm) + const char *colorterm, long vte_version, bool konsole, bool iterm_env) { unibi_term *ut = data->ut; bool true_xterm = !!os_getenv("XTERM_VERSION"); @@ -2392,6 +2392,8 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, bool putty = TERMINAL_FAMILY(term, "putty"); bool screen = TERMINAL_FAMILY(term, "screen"); bool st = TERMINAL_FAMILY(term, "st"); + bool iterm = TERMINAL_FAMILY(term, "iterm") || TERMINAL_FAMILY(term, "iTerm.app"); + bool iterm_pretending_xterm = xterm && iterm_env; char *fix_normal = (char *)unibi_get_str(ut, unibi_cursor_normal); if (fix_normal) { @@ -2446,15 +2448,22 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, unibi_set_if_empty(ut, unibi_carriage_return, "\x0d"); } else if (linuxvt) { // No deviations from the vanilla terminfo. - } else if (TERMINAL_FAMILY(term, "putty")) { + } else if (putty) { // No deviations from the vanilla terminfo. - } else if (TERMINAL_FAMILY(term, "iterm") || TERMINAL_FAMILY(term, "iTerm.app")) { + } else if (iterm) { + // No deviations from the vanilla terminfo. + } else if (st) { // No deviations from the vanilla terminfo. } #define XTERM_SETAF_256 \ - "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m" + "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38:5:%p1%d%;m" #define XTERM_SETAB_256 \ + "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48:5:%p1%d%;m" + // "standard" means using colons like ISO 8613-6:1994/ITU T.416:1993 says. +#define XTERM_SETAF_256_NONSTANDARD \ + "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m" +#define XTERM_SETAB_256_NONSTANDARD \ "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m" #define XTERM_SETAF_16 \ "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e39%;m" @@ -2466,14 +2475,18 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, if (unibi_get_num(ut, unibi_max_colors) < 256) { // See http://fedoraproject.org/wiki/Features/256_Color_Terminals for // more on this. - if (konsole || mate || xterm || gnome || rxvt || st + if (xterm && true_xterm) { + unibi_set_num(ut, unibi_max_colors, 256); + unibi_set_str(ut, unibi_set_a_foreground, XTERM_SETAF_256); + unibi_set_str(ut, unibi_set_a_background, XTERM_SETAB_256); + } else if (konsole || mate || xterm || gnome || rxvt || st || linuxvt // Linux 4.8+ supports 256-colour SGR. || (colorterm && strstr(colorterm, "256")) || (term && strstr(term, "256")) ) { unibi_set_num(ut, unibi_max_colors, 256); - unibi_set_str(ut, unibi_set_a_foreground, XTERM_SETAF_256); - unibi_set_str(ut, unibi_set_a_background, XTERM_SETAB_256); + unibi_set_str(ut, unibi_set_a_foreground, XTERM_SETAF_256_NONSTANDARD); + unibi_set_str(ut, unibi_set_a_background, XTERM_SETAB_256_NONSTANDARD); } } // Terminals where there is actually 16-colour SGR support despite what @@ -2500,7 +2513,8 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, // xterm even has an extended version that has a vertical bar. if (true_xterm // per xterm ctlseqs doco (since version 282) || rxvt // per command.C - || iterm // per analysis of VT100Terminal.m + // per analysis of VT100Terminal.m + || iterm || iterm_pretending_xterm // Allows forcing the use of DECSCUSR on linux type terminals, such as // console-terminal-emulator from the nosh toolset, which does indeed // implement the xterm extension: @@ -2579,7 +2593,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, /// This adds stuff that is not in standard terminfo as extended unibilium /// capabilities. static void augment_terminfo(TUIData *data, const char *term, - const char *colorterm, long vte_version, bool konsole, bool iterm) + const char *colorterm, long vte_version, bool konsole, bool iterm_env) { unibi_term *ut = data->ut; bool true_xterm = !!os_getenv("XTERM_VERSION"); @@ -2591,6 +2605,8 @@ static void augment_terminfo(TUIData *data, const char *term, bool putty = TERMINAL_FAMILY(term, "putty"); bool screen = TERMINAL_FAMILY(term, "screen"); bool st = TERMINAL_FAMILY(term, "st"); + bool iterm = TERMINAL_FAMILY(term, "iterm") || TERMINAL_FAMILY(term, "iTerm.app"); + bool iterm_pretending_xterm = xterm && iterm_env; bool tmux_wrap = screen && !!os_getenv("TMUX"); bool truecolor = colorterm && (0 == strcmp(colorterm, "truecolor") || 0 == strcmp(colorterm, "24bit")); @@ -2615,6 +2631,7 @@ static void augment_terminfo(TUIData *data, const char *term, // lack the correct definitions in terminfo, is an augmentation, not a // fixup. See https://gist.github.com/XVilka/8346728 for more about this. bool has_standard_rgb = vte_version >= 3600 // per GNOME bug #685759 + || iterm || iterm_pretending_xterm // per analysis of VT100Terminal.m || true_xterm; // "standard" means using colons like ISO 8613-6:1994/ITU T.416:1993 says. bool has_non_standard_rgb = @@ -2623,7 +2640,7 @@ static void augment_terminfo(TUIData *data, const char *term, // per http://lists.schmorp.de/pipermail/rxvt-unicode/2016q2/002261.html || rxvt || st // per experimentation - || iterm || truecolor; + || truecolor; data->unibi_ext.set_rgb_foreground = unibi_find_ext_str(ut, "setrgbf"); if (-1 == data->unibi_ext.set_rgb_foreground) { if (has_standard_rgb) { @@ -2645,7 +2662,7 @@ static void augment_terminfo(TUIData *data, const char *term, } } - if (iterm) { + if (iterm || iterm_pretending_xterm) { // FIXME: Bypassing tmux like this affects the cursor colour globally, in // all panes, which is not particularly desirable. A better approach // would use a tmux control sequence and an extra if(screen) test. From 32396b5879b429def1c48948069c55366d41b9be Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sun, 28 May 2017 15:30:46 +0100 Subject: [PATCH 040/161] tui: Perform length safety check in comparison macros. --- src/nvim/tui/tui.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 725310d645..16040cb5c5 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -44,14 +44,16 @@ #define OUTBUF_SIZE 0xffff #define TOO_MANY_EVENTS 1000000 -#define STARTS_WITH(str, prefix) (!memcmp((str), (prefix), sizeof(prefix) - 1)) +#define STARTS_WITH(str, prefix) (strlen(term) >= (sizeof(prefix) - 1) \ + && 0 == memcmp((str), (prefix), sizeof(prefix) - 1)) #define TMUX_WRAP(is_tmux,seq) ((is_tmux) ? "\x1bPtmux;\x1b" seq "\x1b\\" : seq) #define LINUXRESETC "\x1b[?0c" // Per the commentary in terminfo, only a minus sign is a true suffix // separator. #define TERMINAL_FAMILY(term, prefix) ((term) \ - && (0 == memcmp((term), (prefix), sizeof(prefix) - 1)) \ + && strlen(term) >= (sizeof(prefix) - 1) \ + && 0 == memcmp((term), (prefix), sizeof(prefix) - 1) \ && ('\0' == (term)[sizeof(prefix) - 1] || '-' == (term)[sizeof(prefix) - 1])) typedef struct { From 1c1231bf139943382df6cec9221f84708d4aea64 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Mon, 29 May 2017 07:51:06 +0100 Subject: [PATCH 041/161] tui: Add built-in terminfo entry for VTE. Also slightly refactor the way in which GNOME/MATE Terminal pretending to be xterm is detected. --- src/nvim/tui/tui.c | 183 ++++++++++++++++++++++++-- test/functional/terminal/tui_spec.lua | 39 ++++++ 2 files changed, 209 insertions(+), 13 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 16040cb5c5..5110e8797d 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1179,12 +1179,12 @@ static int unibi_find_ext_str(unibi_term *ut, const char *name) } // One creates the dumps from terminfo.src by using -// od -t d1 -w +// od -t d1 -w16 | cut -c9- | sed -e 's/\>/,/g' // on the compiled files. // Taken from Dickey ncurses terminfo.src dated 2017-04-22. // This is a 256-colour terminfo description that lacks true-colour and -// DECSTBN/DECSLRM/DECLRMM capabilities that xterm actually has. +// DECSTBM/DECSLRM/DECLRMM capabilities that xterm actually has. static const char xterm_256colour_terminfo[] = { 26, 1, 37, 0, 29, 0, 15, 0, 105, 1, -42, 5, 120, 116, 101, 114, 109, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 120, 116, 101, 114, 109, @@ -2251,6 +2251,157 @@ static const char st_256colour_terminfo[] = { 100, 37, 59, 109, 0 }; // Taken from Dickey ncurses terminfo.src dated 2017-04-22. +// This is a 256-colour terminfo description that lacks true-colour +// capabilities that gnome actually has. +static const char vte_256colour_terminfo[] = { + 26, 1, 52, 0, 29, 0, 15, 0, 105, 1, -55, 5, 103, 110, 111, 109, + 101, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 71, 78, 79, 77, 69, + 32, 84, 101, 114, 109, 105, 110, 97, 108, 32, 119, 105, 116, 104, 32, 120, + 116, 101, 114, 109, 32, 50, 53, 54, 45, 99, 111, 108, 111, 114, 115, 0, + 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 80, 0, + 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, 0, 0, 4, 0, + 6, 0, 8, 0, 25, 0, 30, 0, 38, 0, 42, 0, 46, 0, -1, -1, + 57, 0, 74, 0, 76, 0, 80, 0, 87, 0, -1, -1, 89, 0, 96, 0, + -1, -1, 100, 0, -1, -1, 104, 0, 108, 0, -1, -1, -1, -1, 112, 0, + -1, -1, 114, 0, 119, 0, -1, -1, -128, 0, -123, 0, -118, 0, -1, -1, +-113, 0, -108, 0, -103, 0, -98, 0, -89, 0, -87, 0, -81, 0, -1, -1, + -68, 0, -63, 0, -57, 0, -51, 0, -1, -1, -1, -1, -1, -1, -33, 0, + -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, 4, 1, -1, -1, -1, -1, + -1, -1, 6, 1, -1, -1, 11, 1, -1, -1, -1, -1, -1, -1, -1, -1, + 15, 1, 19, 1, 25, 1, 29, 1, 33, 1, 37, 1, 43, 1, 49, 1, + 55, 1, 61, 1, 67, 1, 71, 1, -1, -1, 76, 1, -1, -1, 80, 1, + 85, 1, 90, 1, 94, 1, 101, 1, -1, -1, 108, 1, 112, 1, 120, 1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -128, 1, +-119, 1, -110, 1, -101, 1, -92, 1, -83, 1, -74, 1, -65, 1, -56, 1, + -47, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -38, 1, -35, 1, -1, -1, -1, -1, 16, 2, 19, 2, 30, 2, 33, 2, + 35, 2, 38, 2, 116, 2, -1, -1, 119, 2, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 121, 2, -1, -1, -1, -1, -1, -1, -1, -1, + 125, 2, -1, -1, -78, 2, -1, -1, -1, -1, -74, 2, -68, 2, -1, -1, + -1, -1, -62, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -58, 2, -54, 2, -1, -1, -50, 2, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -45, 2, -1, -1, -38, 2, + -33, 2, -1, -1, -1, -1, -1, -1, -1, -1, -26, 2, -19, 2, -12, 2, + -1, -1, -1, -1, -5, 2, -1, -1, 2, 3, -1, -1, -1, -1, -1, -1, + 9, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 16, 3, 22, 3, + 28, 3, 35, 3, 42, 3, 49, 3, 56, 3, 64, 3, 72, 3, 80, 3, + 88, 3, 96, 3, 104, 3, 112, 3, 120, 3, 127, 3, -122, 3, -115, 3, +-108, 3, -100, 3, -92, 3, -84, 3, -76, 3, -68, 3, -60, 3, -52, 3, + -44, 3, -37, 3, -30, 3, -23, 3, -16, 3, -8, 3, 0, 4, 8, 4, + 16, 4, 24, 4, 32, 4, 40, 4, 48, 4, 55, 4, 62, 4, 69, 4, + 76, 4, 84, 4, 92, 4, 100, 4, 108, 4, 116, 4, 124, 4, -124, 4, +-116, 4, -109, 4, -102, 4, -95, 4, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -90, 4, -79, 4, -74, 4, -55, 4, -51, 4, + -42, 4, -35, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, 5, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 64, 5, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 70, 5, -1, -1, -1, -1, -1, -1, 74, 5, -119, 5, 27, 91, + 90, 0, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, + 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, + 91, 50, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, + 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, + 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, + 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, 50, 53, 104, 0, 27, 91, + 67, 0, 27, 91, 65, 0, 27, 91, 80, 0, 27, 91, 77, 0, 14, 0, + 27, 91, 49, 109, 0, 27, 55, 27, 91, 63, 52, 55, 104, 0, 27, 91, + 50, 109, 0, 27, 91, 52, 104, 0, 27, 91, 56, 109, 0, 27, 91, 55, + 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, 37, 112, + 49, 37, 100, 88, 0, 15, 0, 27, 91, 48, 109, 15, 0, 27, 91, 50, + 74, 27, 91, 63, 52, 55, 108, 27, 56, 0, 27, 91, 52, 108, 0, 27, + 91, 50, 55, 109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, 104, + 36, 60, 49, 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 27, 91, 109, + 27, 91, 63, 55, 104, 27, 91, 52, 108, 27, 62, 27, 55, 27, 91, 114, + 27, 91, 63, 49, 59, 51, 59, 52, 59, 54, 108, 27, 56, 0, 27, 91, + 76, 0, 127, 0, 27, 91, 51, 126, 0, 27, 79, 66, 0, 27, 79, 80, + 0, 27, 91, 50, 49, 126, 0, 27, 79, 81, 0, 27, 79, 82, 0, 27, + 79, 83, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, + 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, + 0, 27, 79, 72, 0, 27, 91, 50, 126, 0, 27, 79, 68, 0, 27, 91, + 54, 126, 0, 27, 91, 53, 126, 0, 27, 79, 67, 0, 27, 91, 49, 59, + 50, 66, 0, 27, 91, 49, 59, 50, 65, 0, 27, 79, 65, 0, 27, 91, + 63, 49, 108, 27, 62, 0, 27, 91, 63, 49, 104, 27, 61, 0, 27, 91, + 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, + 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, + 64, 0, 27, 91, 37, 112, 49, 37, 100, 83, 0, 27, 91, 37, 112, 49, + 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, + 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 84, 0, 27, + 91, 37, 112, 49, 37, 100, 65, 0, 27, 99, 0, 27, 55, 27, 91, 114, + 27, 56, 27, 91, 109, 27, 91, 63, 55, 104, 27, 91, 33, 112, 27, 91, + 63, 49, 59, 51, 59, 52, 59, 54, 108, 27, 91, 52, 108, 27, 62, 27, + 91, 63, 49, 48, 48, 48, 108, 27, 91, 63, 50, 53, 104, 0, 27, 56, + 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, + 0, 27, 77, 0, 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, + 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, + 112, 53, 37, 116, 59, 50, 37, 59, 37, 63, 37, 112, 55, 37, 116, 59, + 56, 37, 59, 37, 63, 37, 112, 49, 37, 112, 51, 37, 124, 37, 116, 59, + 55, 37, 59, 109, 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, + 59, 0, 27, 72, 0, 9, 0, 27, 91, 69, 0, 96, 96, 97, 97, 102, + 102, 103, 103, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, + 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, + 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, + 27, 91, 90, 0, 27, 91, 63, 55, 104, 0, 27, 91, 63, 55, 108, 0, + 27, 41, 48, 0, 27, 79, 70, 0, 27, 79, 77, 0, 27, 91, 49, 126, + 0, 27, 91, 51, 59, 50, 126, 0, 27, 91, 52, 126, 0, 27, 91, 49, + 59, 50, 70, 0, 27, 91, 49, 59, 50, 72, 0, 27, 91, 50, 59, 50, + 126, 0, 27, 91, 49, 59, 50, 68, 0, 27, 91, 54, 59, 50, 126, 0, + 27, 91, 53, 59, 50, 126, 0, 27, 91, 49, 59, 50, 67, 0, 27, 91, + 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 49, 59, 50, 80, + 0, 27, 91, 49, 59, 50, 81, 0, 27, 91, 49, 59, 50, 82, 0, 27, + 91, 49, 59, 50, 83, 0, 27, 91, 49, 53, 59, 50, 126, 0, 27, 91, + 49, 55, 59, 50, 126, 0, 27, 91, 49, 56, 59, 50, 126, 0, 27, 91, + 49, 57, 59, 50, 126, 0, 27, 91, 50, 48, 59, 50, 126, 0, 27, 91, + 50, 49, 59, 50, 126, 0, 27, 91, 50, 51, 59, 50, 126, 0, 27, 91, + 50, 52, 59, 50, 126, 0, 27, 91, 49, 59, 53, 80, 0, 27, 91, 49, + 59, 53, 81, 0, 27, 91, 49, 59, 53, 82, 0, 27, 91, 49, 59, 53, + 83, 0, 27, 91, 49, 53, 59, 53, 126, 0, 27, 91, 49, 55, 59, 53, + 126, 0, 27, 91, 49, 56, 59, 53, 126, 0, 27, 91, 49, 57, 59, 53, + 126, 0, 27, 91, 50, 48, 59, 53, 126, 0, 27, 91, 50, 49, 59, 53, + 126, 0, 27, 91, 50, 51, 59, 53, 126, 0, 27, 91, 50, 52, 59, 53, + 126, 0, 27, 91, 49, 59, 54, 80, 0, 27, 91, 49, 59, 54, 81, 0, + 27, 91, 49, 59, 54, 82, 0, 27, 91, 49, 59, 54, 83, 0, 27, 91, + 49, 53, 59, 54, 126, 0, 27, 91, 49, 55, 59, 54, 126, 0, 27, 91, + 49, 56, 59, 54, 126, 0, 27, 91, 49, 57, 59, 54, 126, 0, 27, 91, + 50, 48, 59, 54, 126, 0, 27, 91, 50, 49, 59, 54, 126, 0, 27, 91, + 50, 51, 59, 54, 126, 0, 27, 91, 50, 52, 59, 54, 126, 0, 27, 91, + 49, 59, 51, 80, 0, 27, 91, 49, 59, 51, 81, 0, 27, 91, 49, 59, + 51, 82, 0, 27, 91, 49, 59, 51, 83, 0, 27, 91, 49, 53, 59, 51, + 126, 0, 27, 91, 49, 55, 59, 51, 126, 0, 27, 91, 49, 56, 59, 51, + 126, 0, 27, 91, 49, 57, 59, 51, 126, 0, 27, 91, 50, 48, 59, 51, + 126, 0, 27, 91, 50, 49, 59, 51, 126, 0, 27, 91, 50, 51, 59, 51, + 126, 0, 27, 91, 50, 52, 59, 51, 126, 0, 27, 91, 49, 59, 52, 80, + 0, 27, 91, 49, 59, 52, 81, 0, 27, 91, 49, 59, 52, 82, 0, 27, + 91, 49, 75, 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, + 91, 54, 110, 0, 27, 91, 63, 37, 91, 59, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 93, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, + 52, 57, 109, 0, 27, 93, 49, 48, 52, 7, 0, 27, 93, 52, 59, 37, + 112, 49, 37, 100, 59, 114, 103, 98, 58, 37, 112, 50, 37, 123, 50, 53, + 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 50, 46, + 50, 88, 47, 37, 112, 51, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, + 49, 48, 48, 48, 125, 37, 47, 37, 50, 46, 50, 88, 47, 37, 112, 52, + 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, + 47, 37, 50, 46, 50, 88, 27, 92, 0, 27, 91, 51, 109, 0, 27, 91, + 50, 51, 109, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, + 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, + 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, 112, 49, 37, + 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, + 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, + 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, + 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, + 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, + 49, 37, 100, 37, 59, 109, 0 +}; +// Taken from Dickey ncurses terminfo.src dated 2017-04-22. static const char ansi_terminfo[] = { 26, 1, 40, 0, 23, 0, 16, 0, 125, 1, 68, 2, 97, 110, 115, 105, 124, 97, 110, 115, 105, 47, 112, 99, 45, 116, 101, 114, 109, 32, 99, 111, @@ -2370,6 +2521,8 @@ static unibi_term *load_builtin_terminfo(const char * term) return unibi_from_mem(iterm_256colour_terminfo, sizeof iterm_256colour_terminfo); } else if (TERMINAL_FAMILY(term, "st")) { return unibi_from_mem(st_256colour_terminfo, sizeof st_256colour_terminfo); + } else if (TERMINAL_FAMILY(term, "gnome") || TERMINAL_FAMILY(term, "vte")) { + return unibi_from_mem(vte_256colour_terminfo, sizeof vte_256colour_terminfo); } else { return unibi_from_mem(ansi_terminfo, sizeof ansi_terminfo); } @@ -2384,18 +2537,20 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, const char *colorterm, long vte_version, bool konsole, bool iterm_env) { unibi_term *ut = data->ut; - bool true_xterm = !!os_getenv("XTERM_VERSION"); + const char * xterm_version = os_getenv("XTERM_VERSION"); bool xterm = TERMINAL_FAMILY(term, "xterm"); - bool mate = colorterm && strstr(colorterm, "mate-terminal"); - bool gnome = colorterm && strstr(colorterm, "gnome-terminal"); bool linuxvt = TERMINAL_FAMILY(term, "linux"); bool rxvt = TERMINAL_FAMILY(term, "rxvt"); bool teraterm = TERMINAL_FAMILY(term, "teraterm"); bool putty = TERMINAL_FAMILY(term, "putty"); bool screen = TERMINAL_FAMILY(term, "screen"); bool st = TERMINAL_FAMILY(term, "st"); + bool gnome = TERMINAL_FAMILY(term, "gnome") || TERMINAL_FAMILY(term, "vte"); bool iterm = TERMINAL_FAMILY(term, "iterm") || TERMINAL_FAMILY(term, "iTerm.app"); bool iterm_pretending_xterm = xterm && iterm_env; + bool gnome_pretending_xterm = xterm && colorterm && strstr(colorterm, "gnome-terminal"); + bool mate_pretending_xterm = xterm && colorterm && strstr(colorterm, "mate-terminal"); + bool true_xterm = xterm && !!xterm_version; char *fix_normal = (char *)unibi_get_str(ut, unibi_cursor_normal); if (fix_normal) { @@ -2449,13 +2604,13 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, } else if (TERMINAL_FAMILY(term, "interix")) { unibi_set_if_empty(ut, unibi_carriage_return, "\x0d"); } else if (linuxvt) { - // No deviations from the vanilla terminfo. + // No bugs in the vanilla terminfo for our purposes. } else if (putty) { - // No deviations from the vanilla terminfo. + // No bugs in the vanilla terminfo for our purposes. } else if (iterm) { - // No deviations from the vanilla terminfo. + unibi_set_if_empty(ut, unibi_enter_italics_mode, "\x1b[3m"); } else if (st) { - // No deviations from the vanilla terminfo. + // No bugs in the vanilla terminfo for our purposes. } #define XTERM_SETAF_256 \ @@ -2477,12 +2632,13 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, if (unibi_get_num(ut, unibi_max_colors) < 256) { // See http://fedoraproject.org/wiki/Features/256_Color_Terminals for // more on this. - if (xterm && true_xterm) { + if (true_xterm) { unibi_set_num(ut, unibi_max_colors, 256); unibi_set_str(ut, unibi_set_a_foreground, XTERM_SETAF_256); unibi_set_str(ut, unibi_set_a_background, XTERM_SETAB_256); - } else if (konsole || mate || xterm || gnome || rxvt || st + } else if (konsole || iterm || xterm || gnome || rxvt || st || linuxvt // Linux 4.8+ supports 256-colour SGR. + || mate_pretending_xterm || gnome_pretending_xterm || (colorterm && strstr(colorterm, "256")) || (term && strstr(term, "256")) ) { @@ -2520,7 +2676,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, // Allows forcing the use of DECSCUSR on linux type terminals, such as // console-terminal-emulator from the nosh toolset, which does indeed // implement the xterm extension: - || (linuxvt && (true_xterm || (vte_version > 0) || colorterm))) { + || (linuxvt && (xterm_version || (vte_version > 0) || colorterm))) { data->unibi_ext.set_cursor_style = (int)unibi_add_ext_str(ut, "Ss", "\x1b[%p1%d q"); if (-1 == data->unibi_ext.reset_cursor_style) { @@ -2598,7 +2754,7 @@ static void augment_terminfo(TUIData *data, const char *term, const char *colorterm, long vte_version, bool konsole, bool iterm_env) { unibi_term *ut = data->ut; - bool true_xterm = !!os_getenv("XTERM_VERSION"); + const char * xterm_version = os_getenv("XTERM_VERSION"); bool xterm = TERMINAL_FAMILY(term, "xterm"); bool dtterm = TERMINAL_FAMILY(term, "dtterm"); bool linuxvt = TERMINAL_FAMILY(term, "linux"); @@ -2609,6 +2765,7 @@ static void augment_terminfo(TUIData *data, const char *term, bool st = TERMINAL_FAMILY(term, "st"); bool iterm = TERMINAL_FAMILY(term, "iterm") || TERMINAL_FAMILY(term, "iTerm.app"); bool iterm_pretending_xterm = xterm && iterm_env; + bool true_xterm = xterm && !!xterm_version; bool tmux_wrap = screen && !!os_getenv("TMUX"); bool truecolor = colorterm && (0 == strcmp(colorterm, "truecolor") || 0 == strcmp(colorterm, "24bit")); diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index 225a1fc170..d27e93c9f9 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -514,6 +514,45 @@ describe("tui 't_Co' (terminal colors)", function() assert_term_colors("st-256color", nil, 256) end) + -- gnome and vte: + -- + -- FreeBSD and MacOS fall back to the built-in vte-256color entry. + -- Linux has a gnome, a vte, a gnome-256color, and a vte-256color entry in + -- external terminfo with 8, 8, 256, and 256 colours respectively, which are + -- raised to 256. + + it("TERM=gnome no COLORTERM uses 256 colors", function() + assert_term_colors("gnome", nil, 256) + end) + + it("TERM=gnome COLORTERM=gnome uses 256 colors", function() + assert_term_colors("gnome", "gnome", 256) + end) + + it("TERM=gnome COLORTERM=gnome-256color uses 256 colors", function() + assert_term_colors("gnome", "gnome-256color", 256) + end) + + it("TERM=gnome-256color uses 256 colors", function() + assert_term_colors("gnome-256color", nil, 256) + end) + + it("TERM=vte no COLORTERM uses 256 colors", function() + assert_term_colors("vte", nil, 256) + end) + + it("TERM=vte COLORTERM=vte uses 256 colors", function() + assert_term_colors("vte", "vte", 256) + end) + + it("TERM=vte COLORTERM=vte-256color uses 256 colors", function() + assert_term_colors("vte", "vte-256color", 256) + end) + + it("TERM=vte-256color uses 256 colors", function() + assert_term_colors("vte-256color", nil, 256) + end) + -- others: it("TERM=interix uses 8 colors", function() From 533f5c38c4bcc6f6340efeffd1b20e6ea57e28b1 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Mon, 29 May 2017 08:02:39 +0100 Subject: [PATCH 042/161] doco: Note some common $TERM mistakes and how to fix them. Also explain more clearly the difference between Vim and Nvim when it comes to built-in terminfo entries. --- runtime/doc/term.txt | 34 +++++++++++++++++++++++++++++++--- runtime/doc/vim_diff.txt | 5 +++++ 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index fcfb548723..b15321e6f2 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -24,10 +24,30 @@ the pc terminal, for Unix an ansi terminal. On Unix the terminfo database is used. There is no access to the terminfo settings with |:set|. +If you experience terminal difficulties, first ensure that you have set the +correct terminal type in your $TERM environment variable so that Nvim is +pulling the correct entry from the terminfo database in the first place. + +As noted in the commentary in the terminfo source file: + - The correct $TERM for GNOME Terminal has been "gnome" since 1999, or + "gnome-256color" since 2006. "vte" and "vte-256color" are equivalents. + "xterm" and "xterm-256color" are incorrect. + - The correct $TERM for iTerm.app is "iterm" or "iTerm.app". "xterm" and + "xterm-256color" are incorrect; for starters they do not include + iTerm.app's status line capability. + - The correct $TERM for Terminal.app is "nsterm". "vt100", "xterm", and + "xterm-256color" are incorrect; for starters they do not include + Terminal.app's status line capability or correctly describe its + cursor-addressed mode. + - The correct $TERM for tmux is "tmux" or "tmux-256color". "screen" is + incorrect; for starters it does not include tmux's italics and status line + capabilities or correctly describe how to set inverse video. + *builtin-terms* *builtin_terms* -If a terminfo database is not available, Nvim will look up the terminal type -in a compiled-in mini-database of terminfo entries for "xterm", "putty", -"screen", "tmux", "rxvt", "iterm", "interix", "linux", and "ansi". +If a |terminfo| database is not available, or no entry for the terminal type is +found in that database, Nvim will look up the terminal type in a compiled-in +mini-database of terminfo entries for "xterm", "putty", "screen", "tmux", +"rxvt", "iterm", "interix", "linux", "st", "vte", "gnome", and "ansi". The lookup matches the initial portion of the terminal type, so (for example) "putty-256color" and "putty" will both be mapped to the built-in "putty" @@ -37,6 +57,14 @@ capable if possible. See |termcap-colors|. If no built-in terminfo record matches the terminal type, the built-in "ansi" terminfo record is used as a final fallback. +The built-in mini-database is not combined with an external terminfo database, +nor can it be used in preference to one. You can thus entirely override any +omissions or out-of-date information in the built-in terminfo database by +supplying an external one with entries for the terminal type. Note that the +Unibilium library (used by Nvim to read terminfo) allows you to override an +out-of-date system terminfo database with one in your $HOME/.terminfo/ +directory. + Settings depending on terminal *term-dependent-settings* If you want to set options or mappings, depending on the terminal name, you diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index cc4f441639..9661f1da98 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -160,6 +160,11 @@ Because of general |256-color| usage whereever possible, Nvim will even use 256-colour capability on Linux virtual terminals. Vim uses only 8 colours plus bright foreground on Linux VTs. +Vim combines what is in its |builtin-terms| with what it reads from termcap, +and has a |ttybuiltin| setting to control how that combination works. Nvim +uses either one or the other of an external |terminfo| entry or the built-in +one. It does not attempt to mix data from the two. + |:!| does not support "interactive" commands. Use |:terminal| instead. (GUI Vim has a similar limitation, see ":help gui-pty" in Vim.) From c2a0fd349efa877e96a70ad49a47827ef0690cc6 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Mon, 29 May 2017 16:14:09 +0100 Subject: [PATCH 043/161] doco: Move TERM help into its own section and expand. :help TERM previously pointed to a section that no longer even discussed the variable. --- runtime/doc/starting.txt | 4 ++-- runtime/doc/term.txt | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 4b3f894cf7..9fbf309847 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -214,7 +214,7 @@ argument. :set to display option values. When 'verbose' is non-zero messages are printed (for debugging, to stderr). - $TERM is not used. + $TERM (see |TERM|) is not used. If Vim appears to be stuck try typing "qa!". You don't get a prompt thus you can't see Vim is waiting for you to type something. @@ -355,7 +355,7 @@ argument. At startup, Vim checks environment variables and files and sets values accordingly. Vim proceeds in this order: -1. Set the 'shell' option *SHELL* *COMSPEC* *TERM* +1. Set the 'shell' option *SHELL* *COMSPEC* The environment variable SHELL, if it exists, is used to set the 'shell' option. On Windows, the COMSPEC variable is used if SHELL is not set. diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index b15321e6f2..b6aa37a508 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -24,6 +24,7 @@ the pc terminal, for Unix an ansi terminal. On Unix the terminfo database is used. There is no access to the terminfo settings with |:set|. + *TERM* If you experience terminal difficulties, first ensure that you have set the correct terminal type in your $TERM environment variable so that Nvim is pulling the correct entry from the terminfo database in the first place. @@ -43,6 +44,16 @@ As noted in the commentary in the terminfo source file: incorrect; for starters it does not include tmux's italics and status line capabilities or correctly describe how to set inverse video. +Setting your $TERM environment variable to the correct value also avoids the +problem that SSH does not mirror arbitrary client-end environment variables +such as $COLORTERM, $XTERM_VERSION, $VTE_VERSION, $KONSOLE_PROFILE_NAME, and +$TERM_PROGRAM to the server end, whereas it does send the $TERM environment +variable. + +Note that the Unibilium library (used by Nvim to read terminfo) allows you to +override an out-of-date system terminfo database with one in your +$HOME/.terminfo/ directory, in part or in whole. + *builtin-terms* *builtin_terms* If a |terminfo| database is not available, or no entry for the terminal type is found in that database, Nvim will look up the terminal type in a compiled-in @@ -60,10 +71,7 @@ terminfo record is used as a final fallback. The built-in mini-database is not combined with an external terminfo database, nor can it be used in preference to one. You can thus entirely override any omissions or out-of-date information in the built-in terminfo database by -supplying an external one with entries for the terminal type. Note that the -Unibilium library (used by Nvim to read terminfo) allows you to override an -out-of-date system terminfo database with one in your $HOME/.terminfo/ -directory. +supplying an external one with entries for the terminal type. Settings depending on terminal *term-dependent-settings* From 1b008be1e61139f1387dd6f23e77ff34291f2f97 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Mon, 29 May 2017 18:56:20 +0100 Subject: [PATCH 044/161] tui: Correct to_status_line for screen. PM...ST actually sends the string to screen's message area. Sending the string to the status line requires a different control sequence peculiar to screen. Also make iTerm2 SGR 38/48 consistent. --- src/nvim/tui/tui.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 5110e8797d..6666296487 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -177,6 +177,7 @@ static void terminfo_start(UI *ui) if (!data->ut) { data->ut = load_builtin_terminfo(term); } + // None of the following work over SSH; see :help TERM . const char *colorterm = os_getenv("COLORTERM"); const char *termprg = os_getenv("TERM_PROGRAM"); const char *vte_version_env = os_getenv("VTE_VERSION"); @@ -184,6 +185,7 @@ static void terminfo_start(UI *ui) bool iterm = termprg && strstr(termprg, "iTerm.app"); bool konsole = os_getenv("KONSOLE_PROFILE_NAME") || os_getenv("KONSOLE_DBUS_SESSION"); + patch_terminfo_bugs(data, term, colorterm, vte_version, konsole, iterm); augment_terminfo(data, term, colorterm, vte_version, konsole, iterm); data->can_change_scroll_region = @@ -2547,6 +2549,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, bool st = TERMINAL_FAMILY(term, "st"); bool gnome = TERMINAL_FAMILY(term, "gnome") || TERMINAL_FAMILY(term, "vte"); bool iterm = TERMINAL_FAMILY(term, "iterm") || TERMINAL_FAMILY(term, "iTerm.app"); + // None of the following work over SSH; see :help TERM . bool iterm_pretending_xterm = xterm && iterm_env; bool gnome_pretending_xterm = xterm && colorterm && strstr(colorterm, "gnome-terminal"); bool mate_pretending_xterm = xterm && colorterm && strstr(colorterm, "mate-terminal"); @@ -2596,7 +2599,8 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, unibi_set_if_empty(ut, unibi_from_status_line, "\x07"); unibi_set_if_empty(ut, unibi_set_tb_margin, "\x1b[%i%p1%d;%p2%dr"); } else if (screen) { - unibi_set_if_empty(ut, unibi_to_status_line, "\x1b_"); + // per the screen manual; 2017-04 terminfo.src lacks these. + unibi_set_if_empty(ut, unibi_to_status_line, "\x1bk"); unibi_set_if_empty(ut, unibi_from_status_line, "\x1b\\"); } else if (TERMINAL_FAMILY(term, "tmux")) { unibi_set_if_empty(ut, unibi_to_status_line, "\x1b_"); @@ -2632,11 +2636,11 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, if (unibi_get_num(ut, unibi_max_colors) < 256) { // See http://fedoraproject.org/wiki/Features/256_Color_Terminals for // more on this. - if (true_xterm) { + if (true_xterm || iterm || iterm_pretending_xterm) { unibi_set_num(ut, unibi_max_colors, 256); unibi_set_str(ut, unibi_set_a_foreground, XTERM_SETAF_256); unibi_set_str(ut, unibi_set_a_background, XTERM_SETAB_256); - } else if (konsole || iterm || xterm || gnome || rxvt || st + } else if (konsole || xterm || gnome || rxvt || st || linuxvt // Linux 4.8+ supports 256-colour SGR. || mate_pretending_xterm || gnome_pretending_xterm || (colorterm && strstr(colorterm, "256")) @@ -2673,6 +2677,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, || rxvt // per command.C // per analysis of VT100Terminal.m || iterm || iterm_pretending_xterm + || teraterm // per TeraTerm "Supported Control Functions" doco // Allows forcing the use of DECSCUSR on linux type terminals, such as // console-terminal-emulator from the nosh toolset, which does indeed // implement the xterm extension: @@ -2685,8 +2690,8 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, } unibi_set_ext_str(ut, (size_t)data->unibi_ext.reset_cursor_style, "\x1b[ q"); } else if (putty // per MinTTY 0.4.3-1 release notes from 2009 - || teraterm // per TeraTerm "Supported Control Functions" doco - || (vte_version >= 3900) // VTE-based terminals since this version. + || per https://bugzilla.gnome.org/show_bug.cgi?id=720821 + || (vte_version >= 3900) // per tmux manual page and per // https://lists.gnu.org/archive/html/screen-devel/2013-03/msg00000.html || screen) { @@ -2764,6 +2769,7 @@ static void augment_terminfo(TUIData *data, const char *term, bool screen = TERMINAL_FAMILY(term, "screen"); bool st = TERMINAL_FAMILY(term, "st"); bool iterm = TERMINAL_FAMILY(term, "iterm") || TERMINAL_FAMILY(term, "iTerm.app"); + // None of the following work over SSH; see :help TERM . bool iterm_pretending_xterm = xterm && iterm_env; bool true_xterm = xterm && !!xterm_version; bool tmux_wrap = screen && !!os_getenv("TMUX"); From 4408bd28cbf21a242855c53c7433268c7959ae48 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Mon, 29 May 2017 19:16:02 +0100 Subject: [PATCH 045/161] tui: Char signedness fix for the big blocks of (signed) numbers. --- src/nvim/tui/tui.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 6666296487..c39d1368e3 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1187,7 +1187,7 @@ static int unibi_find_ext_str(unibi_term *ut, const char *name) // Taken from Dickey ncurses terminfo.src dated 2017-04-22. // This is a 256-colour terminfo description that lacks true-colour and // DECSTBM/DECSLRM/DECLRMM capabilities that xterm actually has. -static const char xterm_256colour_terminfo[] = { +static const signed char xterm_256colour_terminfo[] = { 26, 1, 37, 0, 29, 0, 15, 0, 105, 1, -42, 5, 120, 116, 101, 114, 109, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 120, 116, 101, 114, 109, 32, 119, 105, 116, 104, 32, 50, 53, 54, 32, 99, 111, 108, 111, 114, 115, @@ -1338,7 +1338,7 @@ static const char xterm_256colour_terminfo[] = { // Taken from unibilium/t/static_tmux.c as of 2015-08-14. // This is an 256-colour terminfo description that lacks // status line capabilities that tmux actually has. -static const char tmux_256colour_terminfo[] = { +static const signed char tmux_256colour_terminfo[] = { 26, 1, 56, 0, 15, 0, 15, 0, 105, 1, -48, 2, 116, 109, 117, 120, 124, 86, 84, 32, 49, 48, 48, 47, 65, 78, 83, 73, 32, 88, 51, 46, 54, 52, 32, 118, 105, 114, 116, 117, 97, 108, 32, 116, 101, 114, 109, 105, 110, 97, 108, 32, 119, 105, 116, 104, 32, 50, 53, 54, @@ -1421,7 +1421,7 @@ static const char tmux_256colour_terminfo[] = { // Taken from unibilium/t/static_screen-256color.c as of 2015-08-14. // This is an 256-colour terminfo description that lacks // status line capabilities that screen actually has. -static const char screen_256colour_terminfo[] = { +static const signed char screen_256colour_terminfo[] = { 26, 1, 43, 0, 43, 0, 15, 0, 105, 1, -43, 2, 115, 99, 114, 101, 101, 110, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 71, 78, 85, 32, 83, 99, 114, 101, 101, 110, 32, 119, 105, 116, 104, 32, 50, 53, 54, 32, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, @@ -1516,7 +1516,7 @@ static const char screen_256colour_terminfo[] = { 85, 80, 53, 0, 107, 97, 50, 0, 107, 98, 49, 0, 107, 98, 51, 0, 107, 99, 50, 0 }; // Taken from Dickey ncurses terminfo.src dated 2017-04-22. -static const char iterm_256colour_terminfo[] = { +static const signed char iterm_256colour_terminfo[] = { 26, 1, 57, 0, 29, 0, 15, 0, 105, 1, 73, 3, 105, 84, 101, 114, 109, 46, 97, 112, 112, 124, 105, 116, 101, 114, 109, 124, 105, 84, 101, 114, 109, 46, 97, 112, 112, 32, 116, 101, 114, 109, 105, 110, 97, 108, 32, 101, @@ -1627,7 +1627,7 @@ static const char iterm_256colour_terminfo[] = { // Taken from Dickey ncurses terminfo.src dated 2017-04-22. // This is a 256-colour terminfo description that lacks true-colour // capabilities that rxvt actually has. -static const char rxvt_256colour_terminfo[] = { +static const signed char rxvt_256colour_terminfo[] = { 26, 1, 47, 0, 29, 0, 15, 0, 110, 1, -31, 4, 114, 120, 118, 116, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 114, 120, 118, 116, 32, 50, 46, 55, 46, 57, 32, 119, 105, 116, 104, 32, 120, 116, 101, 114, 109, 32, @@ -1764,7 +1764,7 @@ static const char rxvt_256colour_terminfo[] = { // Taken from Dickey ncurses terminfo.src dated 2017-04-22. // This is a 16-colour terminfo description that lacks true-colour // and 256-colour capabilities that linux (4.8+) actually has. -static const char linux_16colour_terminfo[] = { +static const signed char linux_16colour_terminfo[] = { 26, 1, 43, 0, 29, 0, 16, 0, 125, 1, 125, 3, 108, 105, 110, 117, 120, 45, 49, 54, 99, 111, 108, 111, 114, 124, 108, 105, 110, 117, 120, 32, 99, 111, 110, 115, 111, 108, 101, 32, 119, 105, 116, 104, 32, 49, 54, 32, @@ -1878,7 +1878,7 @@ static const char linux_16colour_terminfo[] = { 91, 49, 49, 109, 0, 27, 91, 49, 48, 109, 0 }; // Taken from Dickey ncurses terminfo.src dated 2017-04-22. -static const char putty_256colour_terminfo[] = { +static const signed char putty_256colour_terminfo[] = { 26, 1, 48, 0, 29, 0, 16, 0, 125, 1,-106, 4, 112, 117, 116, 116, 121, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 80, 117, 84, 84, 89, 32, 48, 46, 53, 56, 32, 119, 105, 116, 104, 32, 120, 116, 101, 114, 109, @@ -2010,7 +2010,7 @@ static const char putty_256colour_terminfo[] = { 49, 49, 109, 0, 27, 91, 49, 48, 109, 0 }; // Taken from Dickey ncurses terminfo.src dated 2017-04-22. -static const char interix_8colour_terminfo[] = { +static const signed char interix_8colour_terminfo[] = { 26, 1, 82, 0, 15, 0, 16, 0, 105, 1, 123, 2, 105, 110, 116, 101, 114, 105, 120, 124, 111, 112, 101, 110, 110, 116, 124, 111, 112, 101, 110, 110, 116, 45, 50, 53, 124, 110, 116, 99, 111, 110, 115, 111, 108, 101, 124, 110, @@ -2109,7 +2109,7 @@ static const char interix_8colour_terminfo[] = { // Taken from Dickey ncurses terminfo.src dated 2017-04-22. // This is a 256-colour terminfo description that lacks true-colour // capabilities that stterm actually has. -static const char st_256colour_terminfo[] = { +static const signed char st_256colour_terminfo[] = { 26, 1, 55, 0, 29, 0, 15, 0, 105, 1, 117, 5, 115, 116, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 115, 116, 116, 101, 114, 109, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 115, 105, 109, 112, 108, 101, 116, 101, @@ -2255,7 +2255,7 @@ static const char st_256colour_terminfo[] = { // Taken from Dickey ncurses terminfo.src dated 2017-04-22. // This is a 256-colour terminfo description that lacks true-colour // capabilities that gnome actually has. -static const char vte_256colour_terminfo[] = { +static const signed char vte_256colour_terminfo[] = { 26, 1, 52, 0, 29, 0, 15, 0, 105, 1, -55, 5, 103, 110, 111, 109, 101, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 71, 78, 79, 77, 69, 32, 84, 101, 114, 109, 105, 110, 97, 108, 32, 119, 105, 116, 104, 32, 120, @@ -2404,7 +2404,7 @@ static const char vte_256colour_terminfo[] = { 49, 37, 100, 37, 59, 109, 0 }; // Taken from Dickey ncurses terminfo.src dated 2017-04-22. -static const char ansi_terminfo[] = { +static const signed char ansi_terminfo[] = { 26, 1, 40, 0, 23, 0, 16, 0, 125, 1, 68, 2, 97, 110, 115, 105, 124, 97, 110, 115, 105, 47, 112, 99, 45, 116, 101, 114, 109, 32, 99, 111, 109, 112, 97, 116, 105, 98, 108, 101, 32, 119, 105, 116, 104, 32, 99, 111, @@ -2506,27 +2506,27 @@ static const char ansi_terminfo[] = { static unibi_term *load_builtin_terminfo(const char * term) { if (TERMINAL_FAMILY(term, "xterm")) { - return unibi_from_mem(xterm_256colour_terminfo, sizeof xterm_256colour_terminfo); + return unibi_from_mem((const char *)xterm_256colour_terminfo, sizeof xterm_256colour_terminfo); } else if (TERMINAL_FAMILY(term, "screen")) { - return unibi_from_mem(screen_256colour_terminfo, sizeof screen_256colour_terminfo); + return unibi_from_mem((const char *)screen_256colour_terminfo, sizeof screen_256colour_terminfo); } else if (TERMINAL_FAMILY(term, "tmux")) { - return unibi_from_mem(tmux_256colour_terminfo, sizeof tmux_256colour_terminfo); + return unibi_from_mem((const char *)tmux_256colour_terminfo, sizeof tmux_256colour_terminfo); } else if (TERMINAL_FAMILY(term, "rxvt")) { - return unibi_from_mem(rxvt_256colour_terminfo, sizeof rxvt_256colour_terminfo); + return unibi_from_mem((const char *)rxvt_256colour_terminfo, sizeof rxvt_256colour_terminfo); } else if (TERMINAL_FAMILY(term, "putty")) { - return unibi_from_mem(putty_256colour_terminfo, sizeof putty_256colour_terminfo); + return unibi_from_mem((const char *)putty_256colour_terminfo, sizeof putty_256colour_terminfo); } else if (TERMINAL_FAMILY(term, "linux")) { - return unibi_from_mem(linux_16colour_terminfo, sizeof linux_16colour_terminfo); + return unibi_from_mem((const char *)linux_16colour_terminfo, sizeof linux_16colour_terminfo); } else if (TERMINAL_FAMILY(term, "interix")) { - return unibi_from_mem(interix_8colour_terminfo, sizeof interix_8colour_terminfo); + return unibi_from_mem((const char *)interix_8colour_terminfo, sizeof interix_8colour_terminfo); } else if (TERMINAL_FAMILY(term, "iterm") || TERMINAL_FAMILY(term, "iTerm.app")) { - return unibi_from_mem(iterm_256colour_terminfo, sizeof iterm_256colour_terminfo); + return unibi_from_mem((const char *)iterm_256colour_terminfo, sizeof iterm_256colour_terminfo); } else if (TERMINAL_FAMILY(term, "st")) { - return unibi_from_mem(st_256colour_terminfo, sizeof st_256colour_terminfo); + return unibi_from_mem((const char *)st_256colour_terminfo, sizeof st_256colour_terminfo); } else if (TERMINAL_FAMILY(term, "gnome") || TERMINAL_FAMILY(term, "vte")) { - return unibi_from_mem(vte_256colour_terminfo, sizeof vte_256colour_terminfo); + return unibi_from_mem((const char *)vte_256colour_terminfo, sizeof vte_256colour_terminfo); } else { - return unibi_from_mem(ansi_terminfo, sizeof ansi_terminfo); + return unibi_from_mem((const char *)ansi_terminfo, sizeof ansi_terminfo); } } @@ -2690,7 +2690,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, } unibi_set_ext_str(ut, (size_t)data->unibi_ext.reset_cursor_style, "\x1b[ q"); } else if (putty // per MinTTY 0.4.3-1 release notes from 2009 - || per https://bugzilla.gnome.org/show_bug.cgi?id=720821 + // per https://bugzilla.gnome.org/show_bug.cgi?id=720821 || (vte_version >= 3900) // per tmux manual page and per // https://lists.gnu.org/archive/html/screen-devel/2013-03/msg00000.html From c2015186741839fed3cd9e4b5a4cbdd188d224df Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Tue, 30 May 2017 00:25:58 +0100 Subject: [PATCH 046/161] doco: Correct :help term-dependent-settings . The example used &term which is no longer meaningful. Fortunately, we can change this into a useful example using $TERM that also shows how to address a common need with termguicolors at the same time. --- runtime/doc/term.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index b6aa37a508..c85ad06957 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -76,13 +76,15 @@ supplying an external one with entries for the terminal type. Settings depending on terminal *term-dependent-settings* If you want to set options or mappings, depending on the terminal name, you -can do this best in your vimrc. Example: > +can do this best in your init.vim. Example: > - if &term == "xterm" - ... xterm maps and settings ... - elseif &term =~ "vt10." - ... vt100, vt102 maps and settings ... - endif + if $TERM =~ '^\(rxvt\|screen\)\(\|-.*\)' + set notermguicolors + elseif $TERM =~ '^\(xterm\|tmux\)\(\|-.*\)' + set termguicolors + elseif $TERM =~ ... + ... and so forth ... + endif < *scroll-region* *xterm-scroll-region* Where possible, Nvim will use the terminal's ability to set a scroll region in From 1aba6c607be931d6e812a34a7f458f05c0007200 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Tue, 30 May 2017 01:59:06 +0100 Subject: [PATCH 047/161] tui: Change screen status line back to hardstatus. Reverse the change in c11c60325a2baba94abe6bdfa1c11afe28c16661. --- src/nvim/tui/tui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index c39d1368e3..4bfa5beb17 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -2600,7 +2600,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, unibi_set_if_empty(ut, unibi_set_tb_margin, "\x1b[%i%p1%d;%p2%dr"); } else if (screen) { // per the screen manual; 2017-04 terminfo.src lacks these. - unibi_set_if_empty(ut, unibi_to_status_line, "\x1bk"); + unibi_set_if_empty(ut, unibi_to_status_line, "\x1b_"); unibi_set_if_empty(ut, unibi_from_status_line, "\x1b\\"); } else if (TERMINAL_FAMILY(term, "tmux")) { unibi_set_if_empty(ut, unibi_to_status_line, "\x1b_"); From 63fd5618150ffa0ba6f9143395ef6bf56f642f64 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Tue, 30 May 2017 17:15:41 +0100 Subject: [PATCH 048/161] tui: Fix OBOE in linux cnorm capability fixup code. --- src/nvim/tui/tui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 4bfa5beb17..91615bcb01 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -2566,7 +2566,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, unibi_set_str(ut, unibi_cursor_normal, fix_normal); } if (linuxvt - && (strlen(fix_normal) + 1) >= (sizeof LINUXRESETC - 1) + && strlen(fix_normal) >= (sizeof LINUXRESETC - 1) && !memcmp(strchr(fix_normal,0) - (sizeof LINUXRESETC - 1), LINUXRESETC, sizeof LINUXRESETC - 1)) { // The Linux terminfo entry similarly includes a Linux-idiosyncractic // cursor shape reset in cnorm, which similarly interferes with From 1903fb5de047c19955570b4cd838f552bd54f633 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Tue, 30 May 2017 17:33:07 +0100 Subject: [PATCH 049/161] tui: Make iTerm2 have no deferred wrap. Testing by Enrico Ghirardi and review of the source indicates that iTerm2 is a second terminal emulator that does not defer automatic wrap at the right margin. --- src/nvim/tui/tui.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 91615bcb01..b463f1dc5e 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -182,12 +182,12 @@ static void terminfo_start(UI *ui) const char *termprg = os_getenv("TERM_PROGRAM"); const char *vte_version_env = os_getenv("VTE_VERSION"); long vte_version = vte_version_env ? strtol(vte_version_env, NULL, 10) : 0; - bool iterm = termprg && strstr(termprg, "iTerm.app"); + bool iterm_env = termprg && strstr(termprg, "iTerm.app"); bool konsole = os_getenv("KONSOLE_PROFILE_NAME") || os_getenv("KONSOLE_DBUS_SESSION"); - patch_terminfo_bugs(data, term, colorterm, vte_version, konsole, iterm); - augment_terminfo(data, term, colorterm, vte_version, konsole, iterm); + patch_terminfo_bugs(data, term, colorterm, vte_version, konsole, iterm_env); + augment_terminfo(data, term, colorterm, vte_version, konsole, iterm_env); data->can_change_scroll_region = !!unibi_get_str(data->ut, unibi_change_scroll_region); data->can_set_lr_margin = @@ -196,7 +196,9 @@ static void terminfo_start(UI *ui) !!unibi_get_str(data->ut, unibi_set_left_margin_parm) && !!unibi_get_str(data->ut, unibi_set_right_margin_parm); data->immediate_wrap_after_last_column = - TERMINAL_FAMILY(term, "interix"); + TERMINAL_FAMILY(term, "iterm") + || TERMINAL_FAMILY(term, "interix") + || (TERMINAL_FAMILY(term, "xterm") && iterm_env); // Set 't_Co' from the result of unibilium & fix_terminfo. t_colors = unibi_get_num(data->ut, unibi_max_colors); // Enter alternate screen and clear From a2aba3f2f156bc81adcc2ad8c84c8a0f1ffa55e0 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Tue, 30 May 2017 20:05:11 +0100 Subject: [PATCH 050/161] tui: Handle a corner case for rare terminals. Terminals that do not defer automatic right margin wrap cannot print characters in the bottom right corner without immediately scrolling. --- src/nvim/tui/tui.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index b463f1dc5e..e3612b5c06 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -414,8 +414,18 @@ static void update_attrs(UI *ui, HlAttrs attrs) static void print_cell(UI *ui, UCell *ptr) { + TUIData *data = ui->data; + UGrid *grid = &data->grid; + if (data->immediate_wrap_after_last_column + && grid->row >= ui->height - 1 + && grid->col >= ui->width - 1) { + // This (rare) kind of terminal simply cannot print in this corner without + // scrolling the entire screen up a line, which we do not want to happen. + return; + } update_attrs(ui, ptr->attrs); out(ui, ptr->data, strlen(ptr->data)); + ++grid->col; } static bool cheap_to_print(UI *ui, int row, int col, int next) @@ -451,7 +461,9 @@ static void check_final_column_wrap(UI *ui) UGrid *grid = &data->grid; if (grid->col == ui->width) { grid->col = 0; - ++grid->row; + if (grid->row < ui->height) { + ++grid->row; + } } } @@ -491,7 +503,6 @@ static void cursor_goto(UI *ui, int row, int col) UGRID_FOREACH_CELL(grid, grid->row, grid->row, grid->col, col - 1, { print_cell(ui, cell); - ++grid->col; check_final_column_wrap(ui); }); } @@ -600,7 +611,6 @@ static void clear_region(UI *ui, int top, int bot, int left, int right) UGRID_FOREACH_CELL(grid, top, bot, left, right, { cursor_goto(ui, row, col); print_cell(ui, cell); - ++grid->col; check_final_column_wrap(ui); }); } @@ -915,7 +925,15 @@ static void tui_highlight_set(UI *ui, HlAttrs attrs) static void tui_put(UI *ui, String text) { TUIData *data = ui->data; - print_cell(ui, ugrid_put(&data->grid, (uint8_t *)text.data, text.size)); + UGrid *grid = &data->grid; + UCell *cell; + + cell = ugrid_put(&data->grid, (uint8_t *)text.data, text.size); + // ugrid_put does not advance the cursor correctly, as the actual terminal + // will when we print. Its cursor motion model is simplistic and wrong. So + // we have to undo what it has just done before doing it right. + --grid->col; + print_cell(ui, cell); check_final_column_wrap(ui); } @@ -969,7 +987,6 @@ static void tui_flush(UI *ui) UGRID_FOREACH_CELL(grid, r.top, r.bot, r.left, r.right, { cursor_goto(ui, row, col); print_cell(ui, cell); - ++grid->col; check_final_column_wrap(ui); }); } From 94d00d94731d5617982b5a1f4ac8c1f7a26ae202 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Tue, 30 May 2017 20:50:22 +0100 Subject: [PATCH 051/161] doco: Add some guidance on up-to-date terminfo. --- runtime/doc/term.txt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index c85ad06957..2a6b09a9ff 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -24,6 +24,17 @@ the pc terminal, for Unix an ansi terminal. On Unix the terminfo database is used. There is no access to the terminfo settings with |:set|. +The Unibilium library (used by Nvim to read terminfo) allows you to override +an out-of-date system terminfo database with one in your $HOME/.terminfo/ +directory, in part or in whole. + +Building your own up-to-date terminfo database is usually as simple as running +this as a non-superuser: +> + wget http://invisible-island.net/datafiles/current/terminfo.src.gz + gunzip terminfo.src.gz + tic terminfo.src +< *TERM* If you experience terminal difficulties, first ensure that you have set the correct terminal type in your $TERM environment variable so that Nvim is @@ -50,9 +61,7 @@ such as $COLORTERM, $XTERM_VERSION, $VTE_VERSION, $KONSOLE_PROFILE_NAME, and $TERM_PROGRAM to the server end, whereas it does send the $TERM environment variable. -Note that the Unibilium library (used by Nvim to read terminfo) allows you to -override an out-of-date system terminfo database with one in your -$HOME/.terminfo/ directory, in part or in whole. +See |terminfo| for dealing with out of date terminfo databases. *builtin-terms* *builtin_terms* If a |terminfo| database is not available, or no entry for the terminal type is From 7cbf52db1bdfb0184ee1b1b8ba9c7df77615ca20 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Tue, 30 May 2017 23:08:47 +0100 Subject: [PATCH 052/161] tui: Separate out built-in terminfo records. They are now in their own nvim/tui/terminfo.c file. Also turn the TERMINAL_FAMILY macro into a function. Use the terminfo_ prefix for its name as other parts of the program are unlikely to want that namespace, and the prefix is already used for some other TUI functions. --- src/nvim/tui/terminfo.c | 108 +++ src/nvim/tui/terminfo.h | 8 + src/nvim/tui/tui.c | 1410 +-------------------------------------- 3 files changed, 149 insertions(+), 1377 deletions(-) create mode 100644 src/nvim/tui/terminfo.c create mode 100644 src/nvim/tui/terminfo.h diff --git a/src/nvim/tui/terminfo.c b/src/nvim/tui/terminfo.c new file mode 100644 index 0000000000..9492f3ddb1 --- /dev/null +++ b/src/nvim/tui/terminfo.c @@ -0,0 +1,108 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + +// Built-in fallback terminfo entries. + +#include + +#include "nvim/tui/terminfo.h" +#include "nvim/tui/tui.h" + +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "tui/terminfo.c.generated.h" +#endif + +// One creates the dumps from terminfo.src by using +// od -t d1 -w | cut -c9- | sed -e 's/\>/,/g' +// on the compiled files. + +// Taken from Dickey ncurses terminfo.src dated 2017-04-22. +// This is a 256-colour terminfo description that lacks true-colour and +// DECSTBM/DECSLRM/DECLRMM capabilities that xterm actually has. +static const signed char xterm_256colour_terminfo[] = { + 26, 1, 37, 0, 29, 0, 15, 0, 105, 1, -42, 5, 120, 116, 101, 114, 109, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 120, 116, 101, 114, 109, 32, 119, 105, 116, 104, 32, 50, 53, 54, 32, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, 0, 0, 4, 0, 6, 0, 8, 0, 25, 0, 30, 0, 38, 0, 42, 0, 46, 0, -1, -1, 57, 0, 74, 0, 76, 0, 80, 0, 87, 0, -1, -1, 89, 0, 102, 0, -1, -1, 106, 0, 110, 0, 120, 0, 124, 0, -1, -1, -1, -1,-128, 0,-124, 0,-119, 0,-114, 0, -1, -1,-105, 0,-100, 0, -95, 0, -1, -1, -90, 0, -85, 0, -80, 0, -75, 0, -66, 0, -62, 0, -55, 0, -1, -1, -46, 0, -41, 0, -35, 0, -29, 0, -1, -1, -1, -1, -1, -1, -11, 0, -1, -1, -1, -1, -1, -1, 7, 1, -1, -1, 11, 1, -1, -1, -1, -1, -1, -1, 13, 1, -1, -1, 18, 1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 1, 26, 1, 32, 1, 36, 1, 40, 1, 44, 1, 50, 1, 56, 1, 62, 1, 68, 1, 74, 1, 78, 1, -1, -1, 83, 1, -1, -1, 87, 1, 92, 1, 97, 1, 101, 1, 108, 1, -1, -1, 115, 1, 119, 1, 127, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,-121, 1,-112, 1, -1, -1, -1, -1,-103, 1, -94, 1, -85, 1, -76, 1, -67, 1, -58, 1, -49, 1, -40, 1, -31, 1, -22, 1, -1, -1, -1, -1, -1, -1, -13, 1, -9, 1, -4, 1, -1, -1, 1, 2, 10, 2, -1, -1, -1, -1, 28, 2, 31, 2, 42, 2, 45, 2, 47, 2, 50, 2,-113, 2, -1, -1,-110, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,-108, 2, -1, -1, -1, -1, -1, -1, -1, -1,-104, 2, -1, -1, -51, 2, -1, -1, -1, -1, -47, 2, -41, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -35, 2, -31, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -27, 2, -1, -1, -1, -1, -20, 2, -1, -1, -1, -1, -1, -1, -1, -1, -13, 2, -6, 2, 1, 3, -1, -1, -1, -1, 8, 3, -1, -1, 15, 3, -1, -1, -1, -1, -1, -1, 22, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 29, 3, 35, 3, 41, 3, 48, 3, 55, 3, 62, 3, 69, 3, 77, 3, 85, 3, 93, 3, 101, 3, 109, 3, 117, 3, 125, 3,-123, 3,-116, 3,-109, 3,-102, 3, -95, 3, -87, 3, -79, 3, -71, 3, -63, 3, -55, 3, -47, 3, -39, 3, -31, 3, -24, 3, -17, 3, -10, 3, -3, 3, 5, 4, 13, 4, 21, 4, 29, 4, 37, 4, 45, 4, 53, 4, 61, 4, 68, 4, 75, 4, 82, 4, 89, 4, 97, 4, 105, 4, 113, 4, 121, 4,-127, 4,-119, 4,-111, 4,-103, 4, -96, 4, -89, 4, -82, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -77, 4, -66, 4, -61, 4, -42, 4, -38, 4, -29, 4, -22, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 72, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 77, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 83, 5, -1, -1, -1, -1, -1, -1, 87, 5,-106, 5, 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 50, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, 49, 50, 108, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, 27, 91, 65, 0, 27, 91, 63, 49, 50, 59, 50, 53, 104, 0, 27, 91, 80, 0, 27, 91, 77, 0, 27, 40, 48, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 63, 49, 48, 52, 57, 104, 0, 27, 91, 50, 109, 0, 27, 91, 52, 104, 0, 27, 91, 56, 109, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, 37, 112, 49, 37, 100, 88, 0, 27, 40, 66, 0, 27, 40, 66, 27, 91, 109, 0, 27, 91, 63, 49, 48, 52, 57, 108, 0, 27, 91, 52, 108, 0, 27, 91, 50, 55, 109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, 104, 36, 60, 49, 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 27, 91, 33, 112, 27, 91, 63, 51, 59, 52, 108, 27, 91, 52, 108, 27, 62, 0, 27, 91, 76, 0, 8, 0, 27, 91, 51, 126, 0, 27, 79, 66, 0, 27, 79, 80, 0, 27, 91, 50, 49, 126, 0, 27, 79, 81, 0, 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 79, 72, 0, 27, 91, 50, 126, 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 79, 67, 0, 27, 91, 49, 59, 50, 66, 0, 27, 91, 49, 59, 50, 65, 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, 63, 49, 104, 27, 61, 0, 27, 91, 63, 49, 48, 51, 52, 108, 0, 27, 91, 63, 49, 48, 51, 52, 104, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 83, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 84, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 91, 105, 0, 27, 91, 52, 105, 0, 27, 91, 53, 105, 0, 27, 99, 27, 93, 49, 48, 52, 7, 0, 27, 91, 33, 112, 27, 91, 63, 51, 59, 52, 108, 27, 91, 52, 108, 27, 62, 0, 27, 56, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, 37, 63, 37, 112, 57, 37, 116, 27, 40, 48, 37, 101, 27, 40, 66, 37, 59, 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 53, 37, 116, 59, 50, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 49, 37, 112, 51, 37, 124, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 37, 63, 37, 112, 55, 37, 116, 59, 56, 37, 59, 109, 0, 27, 72, 0, 9, 0, 27, 79, 69, 0, 96, 96, 97, 97, 102, 102, 103, 103, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 91, 63, 55, 104, 0, 27, 91, 63, 55, 108, 0, 27, 79, 70, 0, 27, 79, 77, 0, 27, 91, 51, 59, 50, 126, 0, 27, 91, 49, 59, 50, 70, 0, 27, 91, 49, 59, 50, 72, 0, 27, 91, 50, 59, 50, 126, 0, 27, 91, 49, 59, 50, 68, 0, 27, 91, 54, 59, 50, 126, 0, 27, 91, 53, 59, 50, 126, 0, 27, 91, 49, 59, 50, 67, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 49, 59, 50, 80, 0, 27, 91, 49, 59, 50, 81, 0, 27, 91, 49, 59, 50, 82, 0, 27, 91, 49, 59, 50, 83, 0, 27, 91, 49, 53, 59, 50, 126, 0, 27, 91, 49, 55, 59, 50, 126, 0, 27, 91, 49, 56, 59, 50, 126, 0, 27, 91, 49, 57, 59, 50, 126, 0, 27, 91, 50, 48, 59, 50, 126, 0, 27, 91, 50, 49, 59, 50, 126, 0, 27, 91, 50, 51, 59, 50, 126, 0, 27, 91, 50, 52, 59, 50, 126, 0, 27, 91, 49, 59, 53, 80, 0, 27, 91, 49, 59, 53, 81, 0, 27, 91, 49, 59, 53, 82, 0, 27, 91, 49, 59, 53, 83, 0, 27, 91, 49, 53, 59, 53, 126, 0, 27, 91, 49, 55, 59, 53, 126, 0, 27, 91, 49, 56, 59, 53, 126, 0, 27, 91, 49, 57, 59, 53, 126, 0, 27, 91, 50, 48, 59, 53, 126, 0, 27, 91, 50, 49, 59, 53, 126, 0, 27, 91, 50, 51, 59, 53, 126, 0, 27, 91, 50, 52, 59, 53, 126, 0, 27, 91, 49, 59, 54, 80, 0, 27, 91, 49, 59, 54, 81, 0, 27, 91, 49, 59, 54, 82, 0, 27, 91, 49, 59, 54, 83, 0, 27, 91, 49, 53, 59, 54, 126, 0, 27, 91, 49, 55, 59, 54, 126, 0, 27, 91, 49, 56, 59, 54, 126, 0, 27, 91, 49, 57, 59, 54, 126, 0, 27, 91, 50, 48, 59, 54, 126, 0, 27, 91, 50, 49, 59, 54, 126, 0, 27, 91, 50, 51, 59, 54, 126, 0, 27, 91, 50, 52, 59, 54, 126, 0, 27, 91, 49, 59, 51, 80, 0, 27, 91, 49, 59, 51, 81, 0, 27, 91, 49, 59, 51, 82, 0, 27, 91, 49, 59, 51, 83, 0, 27, 91, 49, 53, 59, 51, 126, 0, 27, 91, 49, 55, 59, 51, 126, 0, 27, 91, 49, 56, 59, 51, 126, 0, 27, 91, 49, 57, 59, 51, 126, 0, 27, 91, 50, 48, 59, 51, 126, 0, 27, 91, 50, 49, 59, 51, 126, 0, 27, 91, 50, 51, 59, 51, 126, 0, 27, 91, 50, 52, 59, 51, 126, 0, 27, 91, 49, 59, 52, 80, 0, 27, 91, 49, 59, 52, 81, 0, 27, 91, 49, 59, 52, 82, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 37, 91, 59, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 93, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 93, 49, 48, 52, 7, 0, 27, 93, 52, 59, 37, 112, 49, 37, 100, 59, 114, 103, 98, 58, 37, 112, 50, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 50, 46, 50, 88, 47, 37, 112, 51, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 50, 46, 50, 88, 47, 37, 112, 52, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 50, 46, 50, 88, 27, 92, 0, 27, 91, 51, 109, 0, 27, 91, 50, 51, 109, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0 +}; +// Taken from unibilium/t/static_tmux.c as of 2015-08-14. +// This is an 256-colour terminfo description that lacks +// status line capabilities that tmux actually has. +static const signed char tmux_256colour_terminfo[] = { + 26, 1, 56, 0, 15, 0, 15, 0, 105, 1, -48, 2, 116, 109, 117, 120, 124, 86, 84, 32, 49, 48, 48, 47, 65, 78, 83, 73, 32, 88, 51, 46, 54, 52, 32, 118, 105, 114, 116, 117, 97, 108, 32, 116, 101, 114, 109, 105, 110, 97, 108, 32, 119, 105, 116, 104, 32, 50, 53, 54, 32, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, 0, 0, 4, 0, 6, 0, 8, 0, 25, 0, 30, 0, 37, 0, 41, 0, -1, -1, -1, -1, 45, 0, 62, 0, 64, 0, 68, 0, 75, 0, -1, -1, 77, 0, 89, 0, -1, -1, 93, 0, 96, 0, 102, 0, 106, 0, -1, -1, -1, -1, 110, 0, 112, 0, 117, 0, 122, 0, -1, -1, -1, -1, 123, 0, -1, -1, -1, -1, -128, 0, -123, 0, -118, 0, -1, -1, -113, 0, -111, 0, -106, 0, -1, -1, -105, 0, -100, 0, -94, 0, -88, 0, -1, -1, -1, -1, -1, -1, -85, 0, -1, -1, -1, -1, -1, -1, -81, 0, -1, -1, -77, 0, -1, -1, -1, -1, -1, -1, -75, 0, -1, -1, -70, 0, -1, -1, -1, -1, -1, -1, -1, -1, -66, 0, -62, 0, -56, 0, -52, 0, -48, 0, -44, 0, -38, 0, -32, 0, -26, 0, -20, 0, -14, 0, -9, 0, -1, -1, -4, 0, -1, -1, 0, 1, 5, 1, 10, 1, -1, -1, -1, -1, -1, -1, 14, 1, 18, 1, 26, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 1, -1, -1, 37, 1, 46, 1, 55, 1, 64, 1, -1, -1, 73, 1, 82, 1, 91, 1, -1, -1, 100, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 109, 1, -1, -1, -1, -1, 126, 1, -1, -1, -127, 1, -124, 1, -122, 1, -119, 1, -46, 1, -1, -1, -43, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -41, 1, -1, -1, 24, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 28, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 40, 2, 46, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 57, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 66, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 71, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 77, 2, -1, -1, -1, -1, -1, -1, 81, 2, -112, 2, 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 51, 52, 104, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, 27, 77, 0, 27, 91, 51, 52, 108, 0, 27, 91, 80, 0, 27, 91, 77, 0, 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 0, 27, 91, 52, 104, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 15, 0, 27, 91, 109, 15, 0, 0, 27, 91, 52, 108, 0, 27, 91, 50, 55, 109, 0, 27, 91, 50, 52, 109, 0, 27, 103, 0, 27, 41, 48, 0, 27, 91, 76, 0, 8, 0, 27, 91, 51, 126, 0, 27, 79, 66, 0, 27, 79, 80, 0, 27, 91, 50, 49, 126, 0, 27, 79, 81, 0, 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 91, 49, 126, 0, 27, 91, 50, 126, 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 79, 67, 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, 63, 49, 104, 27, 61, 0, 27, 69, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 99, 27, 91, 63, 49, 48, 48, 48, 108, 27, 91, 63, 50, 53, 104, 0, 27, 56, 0, 27, 55, 0, 10, 0, 27, 77, 0, 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 49, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 51, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 109, 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, 9, 0, 43, 43, 44, 44, 45, 45, 46, 46, 48, 48, 96, 96, 97, 97, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 40, 66, 27, 41, 48, 0, 27, 91, 52, 126, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 49, 75, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 91, 51, 109, 0, 27, 91, 50, 51, 109, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0 +}; +// Taken from unibilium/t/static_screen-256color.c as of 2015-08-14. +// This is an 256-colour terminfo description that lacks +// status line capabilities that screen actually has. +static const signed char screen_256colour_terminfo[] = { + 26, 1, 43, 0, 43, 0, 15, 0, 105, 1, -43, 2, 115, 99, 114, 101, 101, 110, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 71, 78, 85, 32, 83, 99, 114, 101, 101, 110, 32, 119, 105, 116, 104, 32, 50, 53, 54, 32, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, 0, 0, 4, 0, 6, 0, 8, 0, 25, 0, 30, 0, 37, 0, 41, 0, -1, -1, -1, -1, 45, 0, 62, 0, 64, 0, 68, 0, 75, 0, -1, -1, 77, 0, 89, 0, -1, -1, 93, 0, 96, 0, 102, 0, 106, 0, -1, -1, -1, -1, 110, 0, 112, 0, 117, 0, 122, 0, -1, -1, -1, -1, -125, 0, -1, -1, -1, -1, -120, 0, -115, 0, -110, 0, -1, -1, -105, 0, -103, 0, -98, 0, -1, -1, -89, 0, -84, 0, -78, 0, -72, 0, -1, -1, -1, -1, -1, -1, -69, 0, -1, -1, -1, -1, -1, -1, -65, 0, -1, -1, -61, 0, -1, -1, -1, -1, -1, -1, -59, 0, -1, -1, -54, 0, -1, -1, -1, -1, -1, -1, -1, -1, -50, 0, -46, 0, -40, 0, -36, 0, -32, 0, -28, 0, -22, 0, -16, 0, -10, 0, -4, 0, 2, 1, 7, 1, -1, -1, 12, 1, -1, -1, 16, 1, 21, 1, 26, 1, -1, -1, -1, -1, -1, -1, 30, 1, 34, 1, 42, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 1, -1, -1, 53, 1, 62, 1, 71, 1, 80, 1, -1, -1, 89, 1, 98, 1, 107, 1, -1, -1, 116, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 125, 1, -1, -1, -1, -1, -114, 1, -1, -1, -111, 1, -108, 1, -106, 1, -103, 1, -30, 1, -1, -1, -27, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -25, 1, -1, -1, 40, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 44, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 56, 2, 62, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 68, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 73, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, 2, -1, -1, -1, -1, -1, -1, 86, 2, -107, 2, 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 51, 52, 104, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, 27, 77, 0, 27, 91, 51, 52, 108, 0, 27, 91, 80, 0, 27, 91, 77, 0, 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 63, 49, 48, 52, 57, 104, 0, 27, 91, 52, 104, 0, 27, 91, 55, 109, 0, 27, 91, 51, 109, 0, 27, 91, 52, 109, 0, 15, 0, 27, 91, 109, 15, 0, 27, 91, 63, 49, 48, 52, 57, 108, 0, 27, 91, 52, 108, 0, 27, 91, 50, 51, 109, 0, 27, 91, 50, 52, 109, 0, 27, 103, 0, 27, 41, 48, 0, 27, 91, 76, 0, 8, 0, 27, 91, 51, 126, 0, 27, 79, 66, 0, 27, 79, 80, 0, 27, 91, 50, 49, 126, 0, 27, 79, 81, 0, 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 91, 49, 126, 0, 27, 91, 50, 126, 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 79, 67, 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, 63, 49, 104, 27, 61, 0, 27, 69, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 99, 27, 91, 63, 49, 48, 48, 48, 108, 27, 91, 63, 50, 53, 104, 0, 27, 56, 0, 27, 55, 0, 10, 0, 27, 77, 0, 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 49, 37, 116, 59, 51, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 51, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 109, 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, 9, 0, 43, 43, 44, 44, 45, 45, 46, 46, 48, 48, 96, 96, 97, 97, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 40, 66, 27, 41, 48, 0, 27, 91, 52, 126, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 49, 75, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 0, 3, 0, 1, 0, 24, 0, 52, 0, -112, 0, 1, 1, 0, 0, 1, 0, 0, 0, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 3, 0, 6, 0, 9, 0, 12, 0, 15, 0, 18, 0, 23, 0, 28, 0, 32, 0, 37, 0, 43, 0, 49, 0, 55, 0, 61, 0, 66, 0, 71, 0, 77, 0, 83, 0, 89, 0, 95, 0, 101, 0, 107, 0, 111, 0, 116, 0, 120, 0, 124, 0, -128, 0, 27, 40, 66, 0, 27, 40, 37, 112, 49, 37, 99, 0, 65, 88, 0, 71, 48, 0, 88, 84, 0, 85, 56, 0, 69, 48, 0, 83, 48, 0, 107, 68, 67, 53, 0, 107, 68, 67, 54, 0, 107, 68, 78, 0, 107, 68, 78, 53, 0, 107, 69, 78, 68, 53, 0, 107, 69, 78, 68, 54, 0, 107, 72, 79, 77, 53, 0, 107, 72, 79, 77, 54, 0, 107, 73, 67, 53, 0, 107, 73, 67, 54, 0, 107, 76, 70, 84, 53, 0, 107, 78, 88, 84, 53, 0, 107, 78, 88, 84, 54, 0, 107, 80, 82, 86, 53, 0, 107, 80, 82, 86, 54, 0, 107, 82, 73, 84, 53, 0, 107, 85, 80, 0, 107, 85, 80, 53, 0, 107, 97, 50, 0, 107, 98, 49, 0, 107, 98, 51, 0, 107, 99, 50, 0 +}; +// Taken from Dickey ncurses terminfo.src dated 2017-04-22. +static const signed char iterm_256colour_terminfo[] = { + 26, 1, 57, 0, 29, 0, 15, 0, 105, 1, 73, 3, 105, 84, 101, 114, 109, 46, 97, 112, 112, 124, 105, 116, 101, 114, 109, 124, 105, 84, 101, 114, 109, 46, 97, 112, 112, 32, 116, 101, 114, 109, 105, 110, 97, 108, 32, 101, 109, 117, 108, 97, 116, 111, 114, 32, 102, 111, 114, 32, 77, 97, 99, 32, 79, 83, 32, 88, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, 50, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, -1, -1, 0, 0, 2, 0, -2, -1, 4, 0, 9, 0, 16, 0, 20, 0, 24, 0, -1, -1, 35, 0, 52, 0, 54, 0, 58, 0, 65, 0, -1, -1, 67, 0, 74, 0, -1, -1, 78, 0, -1, -1, 82, 0, 86, 0, 90, 0, -1, -1, 96, 0, 98, 0, 103, 0, 108, 0, -1, -1, -2, -1, 117, 0, 122, 0, -1, -1, 127, 0,-124, 0,-119, 0, -1, -1,-114, 0,-112, 0,-107, 0, -1, -1, -94, 0, -89, 0, -85, 0, -81, 0, -1, -1, -63, 0, -1, -1, -1, -1, -1, -1, -1, -1, -61, 0, -57, 0, -1, -1, -53, 0, -1, -1, -1, -1, -1, -1, -51, 0, -1, -1, -46, 0, -1, -1, -1, -1, -1, -1, -1, -1, -42, 0, -38, 0, -32, 0, -28, 0, -24, 0, -20, 0, -14, 0, -8, 0, -2, 0, 4, 1, 10, 1, -1, -1, -1, -1, 14, 1, -1, -1, 18, 1, 23, 1, 28, 1, -1, -1, -1, -1, -1, -1, 32, 1, 36, 1, 44, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, 1, 61, 1, 70, 1, 79, 1, -1, -1, 88, 1, 97, 1, 106, 1, -1, -1, 115, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 124, 1, -1, -1, -1, -1,-104, 1,-101, 1, -90, 1, -87, 1, -85, 1, -82, 1, -4, 1, -1, -1, -1, 1, 1, 2, -1, -1, -1, -1, -1, -1, 6, 2, 10, 2, 14, 2, 18, 2, 22, 2, -1, -1, -1, -1, 26, 2, -1, -1, -1, -1, -1, -1, -1, -1, 77, 2, 83, 2, -1, -1, -1, -1, 89, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 96, 2, 100, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 104, 2, 110, 2, 116, 2, 122, 2,-128, 2,-122, 2,-116, 2,-110, 2, 104, 2, -98, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -92, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -87, 2, -76, 2, -71, 2, -63, 2, -59, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -54, 2, 9, 3, 7, 0, 13, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, 27, 91, 65, 0, 27, 91, 80, 0, 27, 91, 77, 0, 27, 93, 50, 59, 7, 0, 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 55, 27, 91, 63, 52, 55, 104, 0, 27, 91, 52, 104, 0, 27, 91, 56, 109, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 15, 0, 27, 91, 109, 15, 0, 27, 91, 50, 74, 27, 91, 63, 52, 55, 108, 27, 56, 0, 27, 91, 52, 108, 0, 27, 91, 109, 0, 27, 91, 109, 0, 27, 91, 63, 53, 104, 36, 60, 50, 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 7, 0, 27, 91, 64, 0, 27, 91, 76, 0, 127, 0, 27, 91, 51, 126, 0, 27, 79, 66, 0, 27, 79, 80, 0, 27, 91, 50, 49, 126, 0, 27, 79, 81, 0, 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 79, 72, 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 79, 67, 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, 63, 49, 104, 27, 61, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 62, 27, 91, 63, 51, 108, 27, 91, 63, 52, 108, 27, 91, 63, 53, 108, 27, 91, 63, 55, 104, 27, 91, 63, 56, 104, 0, 27, 56, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 49, 37, 112, 51, 37, 124, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 37, 63, 37, 112, 55, 37, 116, 59, 56, 37, 59, 109, 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, 9, 0, 27, 93, 50, 59, 0, 27, 79, 113, 0, 27, 79, 115, 0, 27, 79, 114, 0, 27, 79, 112, 0, 27, 79, 110, 0, 96, 96, 97, 97, 102, 102, 103, 103, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 63, 55, 104, 0, 27, 91, 63, 55, 108, 0, 27, 40, 66, 27, 41, 48, 0, 27, 79, 70, 0, 27, 79, 77, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 50, 53, 126, 0, 27, 91, 50, 54, 126, 0, 27, 91, 50, 56, 126, 0, 27, 91, 50, 57, 126, 0, 27, 91, 51, 49, 126, 0, 27, 91, 50, 50, 126, 0, 27, 91, 51, 51, 126, 0, 27, 91, 51, 52, 126, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 49, 59, 50, 99, 0, 27, 91, 99, 0, 27, 91, 48, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0 +}; +// Taken from Dickey ncurses terminfo.src dated 2017-04-22. +// This is a 256-colour terminfo description that lacks true-colour +// capabilities that rxvt actually has. +static const signed char rxvt_256colour_terminfo[] = { + 26, 1, 47, 0, 29, 0, 15, 0, 110, 1, -31, 4, 114, 120, 118, 116, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 114, 120, 118, 116, 32, 50, 46, 55, 46, 57, 32, 119, 105, 116, 104, 32, 120, 116, 101, 114, 109, 32, 50, 53, 54, 45, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, -1, -1, 0, 0, 2, 0, 4, 0, 21, 0, 26, 0, 34, 0, 38, 0, 42, 0, -1, -1, 53, 0, 70, 0, 72, 0, 76, 0, 83, 0, -1, -1, 85, 0, 92, 0, -1, -1, 96, 0, -1, -1, -1, -1, 100, 0, -1, -1, -1, -1, 104, 0, 106, 0, 111, 0, 116, 0, -1, -1, -1, -1, 125, 0, -1, -1, -1, -1,-126, 0,-121, 0,-116, 0, -1, -1,-111, 0,-109, 0,-104, 0, -1, -1, -91, 0, -86, 0, -80, 0, -74, 0, -1, -1, -1, -1, -56, 0, -42, 0, -1, -1, -1, -1, -8, 0, -4, 0, -1, -1, 0, 1, -1, -1, -1, -1, -1, -1, 2, 1, -1, -1, 7, 1, -1, -1, 11, 1, -1, -1, 16, 1, 22, 1, 28, 1, 34, 1, 40, 1, 46, 1, 52, 1, 58, 1, 64, 1, 70, 1, 76, 1, 82, 1, 87, 1, -1, -1, 92, 1, -1, -1, 96, 1, 101, 1, 106, 1, 110, 1, 114, 1, -1, -1, 118, 1, 122, 1, 125, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,-128, 1,-119, 1,-110, 1, -1, -1,-101, 1, -92, 1, -83, 1, -1, -1, -74, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -65, 1, -32, 1, -1, -1, -1, -1, 18, 2, 21, 2, 32, 2, 35, 2, 37, 2, 40, 2, 107, 2, -1, -1, 110, 2, -1, -1, -1, -1, -1, -1, -1, -1, 112, 2, 116, 2, 120, 2, 124, 2,-128, 2, -1, -1, -1, -1,-124, 2, -1, -1, -73, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -69, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -62, 2, -57, 2, -1, -1, -53, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -48, 2, -1, -1, -43, 2, -38, 2, -1, -1, -1, -1, -1, -1, -1, -1, -33, 2, -28, 2, -23, 2, -1, -1, -1, -1, -19, 2, -1, -1, -14, 2, -1, -1, -1, -1, -1, -1, -9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -5, 2, 1, 3, 7, 3, 13, 3, 19, 3, 25, 3, 31, 3, 37, 3, 43, 3, 49, 3, 55, 3, 61, 3, 67, 3, 73, 3, 79, 3, 85, 3, 91, 3, 97, 3, 103, 3, 109, 3, 115, 3, 121, 3, 127, 3,-123, 3,-117, 3,-111, 3,-105, 3, -99, 3, -93, 3, -87, 3, -81, 3, -75, 3, -69, 3, -63, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -57, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -52, 3, -41, 3, -36, 3, -28, 3, -24, 3, -15, 3, -8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 86, 4, -1, -1, -1, -1, -1, -1, 90, 4,-103, 4, -1, -1, -1, -1, -1, -1, -39, 4, -35, 4, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 50, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, 27, 91, 65, 0, 27, 91, 77, 0, 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 55, 27, 91, 63, 52, 55, 104, 0, 27, 91, 52, 104, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 15, 0, 27, 91, 109, 15, 0, 27, 91, 50, 74, 27, 91, 63, 52, 55, 108, 27, 56, 0, 27, 91, 52, 108, 0, 27, 91, 50, 55, 109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, 104, 36, 60, 49, 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 27, 91, 63, 52, 55, 108, 27, 61, 27, 91, 63, 49, 108, 0, 27, 91, 114, 27, 91, 109, 27, 91, 50, 74, 27, 91, 72, 27, 91, 63, 55, 104, 27, 91, 63, 49, 59, 51, 59, 52, 59, 54, 108, 27, 91, 52, 108, 0, 27, 91, 64, 0, 27, 91, 76, 0, 8, 0, 27, 91, 51, 126, 0, 27, 91, 66, 0, 27, 91, 56, 94, 0, 27, 91, 50, 49, 126, 0, 27, 91, 49, 49, 126, 0, 27, 91, 50, 49, 126, 0, 27, 91, 49, 50, 126, 0, 27, 91, 49, 51, 126, 0, 27, 91, 49, 52, 126, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 91, 55, 126, 0, 27, 91, 50, 126, 0, 27, 91, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 91, 67, 0, 27, 91, 97, 0, 27, 91, 98, 0, 27, 91, 65, 0, 27, 62, 0, 27, 61, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 62, 27, 91, 49, 59, 51, 59, 52, 59, 53, 59, 54, 108, 27, 91, 63, 55, 104, 27, 91, 109, 27, 91, 114, 27, 91, 50, 74, 27, 91, 72, 0, 27, 91, 114, 27, 91, 109, 27, 91, 50, 74, 27, 91, 72, 27, 91, 63, 55, 104, 27, 91, 63, 49, 59, 51, 59, 52, 59, 54, 108, 27, 91, 52, 108, 27, 62, 27, 91, 63, 49, 48, 48, 48, 108, 27, 91, 63, 50, 53, 104, 0, 27, 56, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 49, 37, 112, 51, 37, 124, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 109, 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, 9, 0, 27, 79, 119, 0, 27, 79, 121, 0, 27, 79, 117, 0, 27, 79, 113, 0, 27, 79, 115, 0, 96, 96, 97, 97, 102, 102, 103, 103, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 40, 66, 27, 41, 48, 0, 27, 91, 56, 126, 0, 27, 79, 77, 0, 27, 91, 49, 126, 0, 27, 91, 51, 36, 0, 27, 91, 52, 126, 0, 27, 91, 56, 36, 0, 27, 91, 55, 36, 0, 27, 91, 50, 36, 0, 27, 91, 100, 0, 27, 91, 54, 36, 0, 27, 91, 53, 36, 0, 27, 91, 99, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 50, 53, 126, 0, 27, 91, 50, 54, 126, 0, 27, 91, 50, 56, 126, 0, 27, 91, 50, 57, 126, 0, 27, 91, 51, 49, 126, 0, 27, 91, 51, 50, 126, 0, 27, 91, 51, 51, 126, 0, 27, 91, 51, 52, 126, 0, 27, 91, 50, 51, 36, 0, 27, 91, 50, 52, 36, 0, 27, 91, 49, 49, 94, 0, 27, 91, 49, 50, 94, 0, 27, 91, 49, 51, 94, 0, 27, 91, 49, 52, 94, 0, 27, 91, 49, 53, 94, 0, 27, 91, 49, 55, 94, 0, 27, 91, 49, 56, 94, 0, 27, 91, 49, 57, 94, 0, 27, 91, 50, 48, 94, 0, 27, 91, 50, 49, 94, 0, 27, 91, 50, 51, 94, 0, 27, 91, 50, 52, 94, 0, 27, 91, 50, 53, 94, 0, 27, 91, 50, 54, 94, 0, 27, 91, 50, 56, 94, 0, 27, 91, 50, 57, 94, 0, 27, 91, 51, 49, 94, 0, 27, 91, 51, 50, 94, 0, 27, 91, 51, 51, 94, 0, 27, 91, 51, 52, 94, 0, 27, 91, 50, 51, 64, 0, 27, 91, 50, 52, 64, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 49, 59, 50, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 93, 49, 48, 52, 7, 0, 27, 93, 52, 59, 37, 112, 49, 37, 100, 59, 114, 103, 98, 58, 37, 112, 50, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 50, 46, 50, 88, 47, 37, 112, 51, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 50, 46, 50, 88, 47, 37, 112, 52, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 50, 46, 50, 88, 27, 92, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 40, 66, 0, 27, 40, 48, 0 +}; +// Taken from Dickey ncurses terminfo.src dated 2017-04-22. +// This is a 16-colour terminfo description that lacks true-colour +// and 256-colour capabilities that linux (4.8+) actually has. +static const signed char linux_16colour_terminfo[] = { + 26, 1, 43, 0, 29, 0, 16, 0, 125, 1, 125, 3, 108, 105, 110, 117, 120, 45, 49, 54, 99, 111, 108, 111, 114, 124, 108, 105, 110, 117, 120, 32, 99, 111, 110, 115, 111, 108, 101, 32, 119, 105, 116, 104, 32, 49, 54, 32, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, -1, -1, 8, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 16, 0, 0, 1, 42, 0, -1, -1, 0, 0, 2, 0, 4, 0, 21, 0, 26, 0, 33, 0, 37, 0, 41, 0, -1, -1, 52, 0, 69, 0, 71, 0, 75, 0, 87, 0, -1, -1, 89, 0, 101, 0, -1, -1, 105, 0, 109, 0, 121, 0, 125, 0, -1, -1, -1, -1,-127, 0,-125, 0,-120, 0, -1, -1, -1, -1,-115, 0,-110, 0, -1, -1, -1, -1,-105, 0,-100, 0, -95, 0, -90, 0, -81, 0, -79, 0, -1, -1, -1, -1, -74, 0, -69, 0, -63, 0, -57, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -39, 0, -35, 0, -1, -1, -31, 0, -1, -1, -1, -1, -1, -1, -29, 0, -1, -1, -24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -20, 0, -15, 0, -9, 0, -4, 0, 1, 1, 6, 1, 11, 1, 17, 1, 23, 1, 29, 1, 35, 1, 40, 1, -1, -1, 45, 1, -1, -1, 49, 1, 54, 1, 59, 1, -1, -1, -1, -1, -1, -1, 63, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 67, 1, -1, -1, 70, 1, 79, 1, 88, 1, 97, 1, -1, -1, 106, 1, 115, 1, 124, 1, -1, -1,-123, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,-114, 1, -1, -1, -1, -1, -1, -1,-108, 1,-105, 1, -94, 1, -91, 1, -89, 1, -86, 1, 1, 2, -1, -1, 4, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, 10, 2, -1, -1, 77, 2, -1, -1, -1, -1, 81, 2, 87, 2, -1, -1, -1, -1, 93, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 97, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 102, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 104, 2, 110, 2, 116, 2, 122, 2,-128, 2,-122, 2,-116, 2,-110, 2,-104, 2, -98, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -92, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -87, 2, -76, 2, -71, 2, -65, 2, -61, 2, -52, 2, -48, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, 3, -1, -1, -1, -1, -1, -1, 37, 3, 75, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 113, 3, 119, 3, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 27, 91, 63, 49, 99, 0, 8, 0, 27, 91, 63, 50, 53, 104, 27, 91, 63, 48, 99, 0, 27, 91, 67, 0, 27, 91, 65, 0, 27, 91, 63, 50, 53, 104, 27, 91, 63, 56, 99, 0, 27, 91, 80, 0, 27, 91, 77, 0, 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 50, 109, 0, 27, 91, 52, 104, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, 37, 112, 49, 37, 100, 88, 0, 15, 0, 27, 91, 109, 15, 0, 27, 91, 52, 108, 0, 27, 91, 50, 55, 109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, 104, 36, 60, 50, 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 27, 91, 64, 0, 27, 91, 76, 0, 127, 0, 27, 91, 51, 126, 0, 27, 91, 66, 0, 27, 91, 91, 65, 0, 27, 91, 50, 49, 126, 0, 27, 91, 91, 66, 0, 27, 91, 91, 67, 0, 27, 91, 91, 68, 0, 27, 91, 91, 69, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 91, 49, 126, 0, 27, 91, 50, 126, 0, 27, 91, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 91, 67, 0, 27, 91, 65, 0, 13, 10, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 99, 27, 93, 82, 0, 27, 56, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, 27, 91, 48, 59, 49, 48, 37, 63, 37, 112, 49, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 51, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 37, 63, 37, 112, 53, 37, 116, 59, 50, 37, 59, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 109, 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, 9, 0, 27, 91, 71, 0, 43, 43, 44, 44, 45, 45, 46, 46, 48, 48, 95, 95, 96, 96, 97, 97, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 99, 126, 126, 0, 27, 91, 90, 0, 27, 91, 63, 55, 104, 0, 27, 91, 63, 55, 108, 0, 27, 41, 48, 0, 27, 91, 52, 126, 0, 26, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 50, 53, 126, 0, 27, 91, 50, 54, 126, 0, 27, 91, 50, 56, 126, 0, 27, 91, 50, 57, 126, 0, 27, 91, 51, 49, 126, 0, 27, 91, 51, 50, 126, 0, 27, 91, 51, 51, 126, 0, 27, 91, 51, 52, 126, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 54, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 93, 82, 0, 27, 93, 80, 37, 112, 49, 37, 120, 37, 112, 50, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 48, 50, 120, 37, 112, 51, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 48, 50, 120, 37, 112, 52, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 48, 50, 120, 0, 27, 91, 77, 0, 27, 91, 51, 37, 112, 49, 37, 123, 56, 125, 37, 109, 37, 100, 37, 63, 37, 112, 49, 37, 123, 55, 125, 37, 62, 37, 116, 59, 49, 37, 101, 59, 50, 49, 37, 59, 109, 0, 27, 91, 52, 37, 112, 49, 37, 123, 56, 125, 37, 109, 37, 100, 37, 63, 37, 112, 49, 37, 123, 55, 125, 37, 62, 37, 116, 59, 53, 37, 101, 59, 50, 53, 37, 59, 109, 0, 27, 91, 49, 49, 109, 0, 27, 91, 49, 48, 109, 0 +}; +// Taken from Dickey ncurses terminfo.src dated 2017-04-22. +static const signed char putty_256colour_terminfo[] = { + 26, 1, 48, 0, 29, 0, 16, 0, 125, 1,-106, 4, 112, 117, 116, 116, 121, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 80, 117, 84, 84, 89, 32, 48, 46, 53, 56, 32, 119, 105, 116, 104, 32, 120, 116, 101, 114, 109, 32, 50, 53, 54, 45, 99, 111, 108, 111, 114, 115, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, -1, 8, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, 22, 0, 0, 0, 4, 0, 6, 0, 8, 0, 25, 0, 30, 0, 37, 0, 41, 0, 45, 0, -1, -1, 56, 0, 73, 0, 76, 0, 80, 0, 87, 0, -1, -1, 89, 0, 96, 0, -1, -1, 100, 0, -1, -1, 103, 0, 107, 0, 111, 0, -1, -1, 117, 0, 119, 0, 124, 0,-127, 0, -1, -1, -1, -1,-120, 0, -1, -1, -1, -1,-115, 0,-110, 0,-105, 0,-100, 0, -91, 0, -89, 0, -84, 0, -1, -1, -73, 0, -68, 0, -62, 0, -56, 0, -1, -1, -38, 0, -1, -1, -36, 0, -1, -1, -1, -1, -1, -1, -2, 0, -1, -1, 2, 1, -1, -1, -1, -1, -1, -1, 4, 1, -1, -1, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, 13, 1, 19, 1, 25, 1, 31, 1, 37, 1, 43, 1, 49, 1, 55, 1, 61, 1, 67, 1, 73, 1, 78, 1, -1, -1, 83, 1, -1, -1, 87, 1, 92, 1, 97, 1, 101, 1, 105, 1, -1, -1, 109, 1, 113, 1, 121, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,-127, 1, -1, -1,-124, 1,-115, 1,-106, 1, -1, -1, -97, 1, -88, 1, -79, 1, -70, 1, -61, 1, -52, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -43, 1, -1, -1, -1, -1, -10, 1, -7, 1, 4, 2, 7, 2, 9, 2, 12, 2, 84, 2, -1, -1, 87, 2, 89, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 94, 2, -1, -1, -1, -1, -1, -1, -1, -1, 98, 2, -1, -1,-107, 2, -1, -1, -1, -1,-103, 2, -97, 2, -1, -1, -1, -1, -91, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -84, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -79, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -77, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -73, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -69, 2, -63, 2, -57, 2, -51, 2, -45, 2, -39, 2, -33, 2, -27, 2, -21, 2, -15, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -4, 2, 7, 3, 12, 3, 18, 3, 22, 3, 31, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 3, -1, -1, -1, -1, -1, -1, 39, 3, 102, 3, -1, -1, -1, -1, -1, -1, -90, 3, -84, 3, -78, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -72, 3,-118, 4,-112, 4, 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 27, 68, 0, 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, 27, 77, 0, 27, 91, 80, 0, 27, 91, 77, 0, 27, 93, 48, 59, 7, 0, 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 63, 52, 55, 104, 0, 27, 91, 52, 104, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, 37, 112, 49, 37, 100, 88, 0, 15, 0, 27, 91, 109, 15, 0, 27, 91, 50, 74, 27, 91, 63, 52, 55, 108, 0, 27, 91, 52, 108, 0, 27, 91, 50, 55, 109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, 104, 36, 60, 49, 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 7, 0, 27, 55, 27, 91, 114, 27, 91, 109, 27, 91, 63, 55, 104, 27, 91, 63, 49, 59, 52, 59, 54, 108, 27, 91, 52, 108, 27, 56, 27, 62, 27, 93, 82, 0, 27, 91, 76, 0, 127, 0, 27, 91, 51, 126, 0, 27, 79, 66, 0, 27, 91, 49, 49, 126, 0, 27, 91, 50, 49, 126, 0, 27, 91, 49, 50, 126, 0, 27, 91, 49, 51, 126, 0, 27, 91, 49, 52, 126, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 91, 49, 126, 0, 27, 91, 50, 126, 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 79, 67, 0, 27, 91, 66, 0, 27, 91, 65, 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, 63, 49, 104, 27, 61, 0, 13, 10, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 83, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 84, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 60, 27, 91, 34, 112, 27, 91, 53, 48, 59, 54, 34, 112, 27, 99, 27, 91, 63, 51, 108, 27, 93, 82, 27, 91, 63, 49, 48, 48, 48, 108, 0, 27, 56, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, 27, 91, 48, 37, 63, 37, 112, 49, 37, 112, 54, 37, 124, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 49, 37, 112, 51, 37, 124, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 109, 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, 9, 0, 27, 93, 48, 59, 0, 27, 91, 71, 0, 96, 96, 97, 97, 102, 102, 103, 103, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 91, 63, 55, 104, 0, 27, 91, 63, 55, 108, 0, 27, 40, 66, 27, 41, 48, 0, 27, 91, 52, 126, 0, 26, 0, 27, 91, 68, 0, 27, 91, 67, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 50, 53, 126, 0, 27, 91, 50, 54, 126, 0, 27, 91, 50, 56, 126, 0, 27, 91, 50, 57, 126, 0, 27, 91, 51, 49, 126, 0, 27, 91, 51, 50, 126, 0, 27, 91, 51, 51, 126, 0, 27, 91, 51, 52, 126, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 54, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 93, 82, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 49, 48, 109, 0, 27, 91, 49, 49, 109, 0, 27, 91, 49, 50, 109, 0, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30,-105,-104, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 123, 49, 48, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30,-105,-103, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 123, 49, 50, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30,-103,-128, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 123, 49, 51, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30,-103, -86, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 123, 49, 52, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30,-103, -85, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 123, 49, 53, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30,-104, -68, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 123, 50, 55, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30,-122,-112, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 123, 49, 53, 53, 125, 37, 61, 37, 116, 27, 37, 37, 71, -32,-126, -94, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 99, 37, 59, 0, 27, 91, 49, 49, 109, 0, 27, 91, 49, 48, 109, 0 +}; +// Taken from Dickey ncurses terminfo.src dated 2017-04-22. +static const signed char interix_8colour_terminfo[] = { + 26, 1, 82, 0, 15, 0, 16, 0, 105, 1, 123, 2, 105, 110, 116, 101, 114, 105, 120, 124, 111, 112, 101, 110, 110, 116, 124, 111, 112, 101, 110, 110, 116, 45, 50, 53, 124, 110, 116, 99, 111, 110, 115, 111, 108, 101, 124, 110, 116, 99, 111, 110, 115, 111, 108, 101, 45, 50, 53, 124, 79, 112, 101, 110, 78, 84, 45, 116, 101, 114, 109, 32, 99, 111, 109, 112, 97, 116, 105, 98, 108, 101, 32, 119, 105, 116, 104, 32, 99, 111, 108, 111, 114, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 80, 0, -1, -1, 25, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, 0, 64, 0, 3, 0, 0, 0, 4, 0, -1, -1, -1, -1, -1, -1, 6, 0, 11, 0, 15, 0, -1, -1, -1, -1, 19, 0, 36, 0, 38, 0, -1, -1, 42, 0, -1, -1, -1, -1, 46, 0, 50, 0, 54, 0, -1, -1, -1, -1, 58, 0, -1, -1, -1, -1, -1, -1, -1, -1, 62, 0, 67, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 75, 0, 80, 0, 85, 0, -1, -1, -1, -1, 90, 0, 95, 0, -1, -1, -1, -1, 107, 0, 111, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 115, 0, -1, -1, 119, 0, -1, -1, -1, -1, -1, -1, 121, 0, -1, -1, 125, 0, -1, -1, -1, -1, -1, -1,-127, 0,-123, 0,-119, 0,-115, 0,-111, 0,-107, 0,-103, 0, -99, 0, -95, 0, -91, 0, -87, 0, -1, -1, -83, 0, -1, -1, -79, 0, -75, 0, -71, 0, -67, 0, -63, 0, -1, -1, -1, -1, -1, -1, -59, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -55, 0, -1, -1, -1, -1, -52, 0, -43, 0, -1, -1, -34, 0, -25, 0, -16, 0, -7, 0, 2, 1, 11, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 1, -1, -1, -1, -1, -1, -1, 23, 1, -1, -1, 27, 1, 31, 1, 35, 1, -1, -1, -1, -1, -1, -1, 39, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, 1, -1, -1, 104, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 108, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 112, 1, 116, 1, 120, 1, 124, 1,-128, 1,-124, 1,-120, 1,-116, 1,-112, 1,-108, 1,-104, 1,-100, 1, -96, 1, -92, 1, -88, 1, -84, 1, -80, 1, -76, 1, -72, 1, -68, 1, -64, 1, -60, 1, -56, 1, -52, 1, -48, 1, -44, 1, -40, 1, -36, 1, -32, 1, -28, 1, -24, 1, -20, 1, -16, 1, -12, 1, -8, 1, -4, 1, 0, 2, 4, 2, 8, 2, 12, 2, 16, 2, 20, 2, 24, 2, 28, 2, 32, 2, 36, 2, 40, 2, 44, 2, 48, 2, 52, 2, 56, 2, 60, 2, 64, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 68, 2, -1, -1, -1, -1, -1, -1, -1, -1, 72, 2, 88, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, 2, 113, 2, 27, 91, 90, 0, 7, 0, 27, 91, 50, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 68, 0, 27, 91, 67, 0, 27, 91, 85, 0, 27, 91, 65, 0, 27, 91, 77, 0, 27, 91, 49, 109, 0, 27, 91, 115, 27, 91, 49, 98, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, 48, 109, 0, 27, 91, 50, 98, 27, 91, 117, 13, 27, 91, 75, 0, 27, 91, 109, 0, 27, 91, 109, 0, 27, 91, 76, 0, 8, 0, 27, 91, 77, 0, 27, 91, 66, 0, 27, 70, 65, 0, 27, 70, 49, 0, 27, 70, 65, 0, 27, 70, 50, 0, 27, 70, 51, 0, 27, 70, 52, 0, 27, 70, 53, 0, 27, 70, 54, 0, 27, 70, 55, 0, 27, 70, 56, 0, 27, 70, 57, 0, 27, 91, 76, 0, 27, 91, 68, 0, 27, 91, 85, 0, 27, 91, 84, 0, 27, 91, 83, 0, 27, 91, 67, 0, 27, 91, 65, 0, 13, 10, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 83, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 84, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 99, 0, 27, 91, 117, 0, 27, 91, 115, 0, 27, 91, 83, 0, 27, 91, 84, 0, 9, 0, 43, 16, 44, 17, 45, 24, 46, 25, 48, -37, 96, 4, 97, -79, 102, -8, 103, -15, 104, -80, 106, -39, 107, -65, 108, -38, 109, -64, 110, -59, 111, 126, 112, -60, 113, -60, 114, -60, 115, 95, 116, -61, 117, -76, 118, -63, 119, -62, 120, -77, 121, -13, 122, -14, 123, -29, 124, -40, 125,-100, 126, -2, 0, 27, 91, 90, 0, 27, 91, 85, 0, 27, 70, 66, 0, 27, 70, 67, 0, 27, 70, 68, 0, 27, 70, 69, 0, 27, 70, 70, 0, 27, 70, 71, 0, 27, 70, 72, 0, 27, 70, 73, 0, 27, 70, 74, 0, 27, 70, 75, 0, 27, 70, 76, 0, 27, 70, 77, 0, 27, 70, 78, 0, 27, 70, 79, 0, 27, 70, 80, 0, 27, 70, 81, 0, 27, 70, 82, 0, 27, 70, 83, 0, 27, 70, 84, 0, 27, 70, 85, 0, 27, 70, 86, 0, 27, 70, 87, 0, 27, 70, 88, 0, 27, 70, 89, 0, 27, 70, 90, 0, 27, 70, 97, 0, 27, 70, 98, 0, 27, 70, 99, 0, 27, 70, 100, 0, 27, 70, 101, 0, 27, 70, 102, 0, 27, 70, 103, 0, 27, 70, 104, 0, 27, 70, 105, 0, 27, 70, 106, 0, 27, 70, 107, 0, 27, 70, 109, 0, 27, 70, 110, 0, 27, 70, 111, 0, 27, 70, 112, 0, 27, 70, 113, 0, 27, 70, 114, 0, 27, 70, 115, 0, 27, 70, 116, 0, 27, 70, 117, 0, 27, 70, 118, 0, 27, 70, 119, 0, 27, 70, 120, 0, 27, 70, 121, 0, 27, 70, 122, 0, 27, 70, 43, 0, 27, 70, 45, 0, 27, 70, 12, 0, 27, 91, 109, 0, 27, 91, 37, 112, 49, 37, 123, 51, 48, 125, 37, 43, 37, 100, 109, 0, 27, 91, 37, 112, 49, 37, 39, 40, 39, 37, 43, 37, 100, 109, 0, 27, 91, 51, 37, 112, 49, 37, 100, 109, 0, 27, 91, 52, 37, 112, 49, 37, 100, 109, 0 +}; +// Taken from Dickey ncurses terminfo.src dated 2017-04-22. +// This is a 256-colour terminfo description that lacks true-colour +// capabilities that stterm actually has. +static const signed char st_256colour_terminfo[] = { + 26, 1, 55, 0, 29, 0, 15, 0, 105, 1, 117, 5, 115, 116, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 115, 116, 116, 101, 114, 109, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 115, 105, 109, 112, 108, 101, 116, 101, 114, 109, 32, 119, 105, 116, 104, 32, 50, 53, 54, 32, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, 0, 0, 4, 0, 6, 0, 8, 0, 25, 0, 30, 0, 38, 0, 42, 0, 46, 0, -1, -1, 57, 0, 74, 0, 76, 0, 80, 0, 87, 0, -1, -1, 89, 0, 102, 0, -1, -1, 106, 0, 110, 0, 117, 0, 121, 0, -1, -1, -1, -1, 125, 0,-127, 0,-122, 0,-117, 0, -1, -1, -1, -1,-108, 0,-103, 0, -1, -1, -98, 0, -93, 0, -88, 0, -83, 0, -74, 0, -70, 0, -65, 0, -1, -1, -56, 0, -51, 0, -45, 0, -39, 0, -1, -1, -21, 0, -1, -1, -19, 0, -1, -1, -1, -1, -1, -1, -4, 0, -1, -1, 0, 1, -1, -1, 2, 1, -1, -1, 9, 1, 14, 1, 21, 1, 25, 1, 32, 1, 39, 1, -1, -1, 46, 1, 50, 1, 56, 1, 60, 1, 64, 1, 68, 1, 74, 1, 80, 1, 86, 1, 92, 1, 98, 1, 103, 1, 108, 1, 115, 1, -1, -1, 119, 1, 124, 1,-127, 1,-123, 1,-116, 1, -1, -1,-109, 1,-105, 1, -97, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -89, 1, -80, 1, -71, 1, -62, 1, -53, 1, -44, 1, -35, 1, -26, 1, -1, -1, -17, 1, -1, -1, -1, -1, -1, -1, -8, 1, -4, 1, 1, 2, -1, -1, 6, 2, 9, 2, -1, -1, -1, -1, 24, 2, 27, 2, 38, 2, 41, 2, 43, 2, 46, 2,-128, 2, -1, -1,-125, 2,-123, 2, -1, -1, -1, -1, -1, -1,-118, 2,-113, 2,-108, 2,-104, 2, -99, 2, -1, -1, -1, -1, -94, 2, -1, -1, -29, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -25, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -21, 2, -16, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -12, 2, -1, -1, -1, -1, -5, 2, -1, -1, -1, -1, -1, -1, -1, -1, 2, 3, 9, 3, 16, 3, -1, -1, -1, -1, 23, 3, -1, -1, 30, 3, -1, -1, -1, -1, -1, -1, 37, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 44, 3, 50, 3, 56, 3, 63, 3, 70, 3, 77, 3, 84, 3, 92, 3, 100, 3, 108, 3, 116, 3, 124, 3,-124, 3,-116, 3,-108, 3,-101, 3, -94, 3, -87, 3, -80, 3, -72, 3, -64, 3, -56, 3, -48, 3, -40, 3, -32, 3, -24, 3, -16, 3, -9, 3, -2, 3, 5, 4, 12, 4, 20, 4, 28, 4, 36, 4, 44, 4, 52, 4, 60, 4, 68, 4, 76, 4, 83, 4, 90, 4, 97, 4, 104, 4, 112, 4, 120, 4,-128, 4,-120, 4,-112, 4,-104, 4, -96, 4, -88, 4, -81, 4, -74, 4, -67, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -62, 4, -51, 4, -46, 4, -38, 4, -34, 4, -2, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -25, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -20, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -14, 4, -1, -1, -1, -1, -1, -1, -10, 4, 53, 5, 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 50, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, 49, 50, 108, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, 27, 91, 65, 0, 27, 91, 63, 50, 53, 104, 0, 27, 91, 80, 0, 27, 91, 77, 0, 27, 40, 48, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 63, 49, 48, 52, 57, 104, 0, 27, 91, 52, 104, 0, 27, 91, 56, 109, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, 37, 112, 49, 37, 100, 88, 0, 27, 40, 66, 0, 27, 91, 48, 109, 0, 27, 91, 63, 49, 48, 52, 57, 108, 0, 27, 91, 52, 108, 0, 27, 91, 50, 55, 109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, 104, 36, 60, 49, 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 7, 0, 27, 91, 52, 108, 27, 62, 27, 91, 63, 49, 48, 51, 52, 108, 0, 27, 91, 76, 0, 127, 0, 27, 91, 51, 59, 53, 126, 0, 27, 91, 51, 126, 0, 27, 91, 51, 59, 50, 126, 0, 27, 79, 66, 0, 27, 91, 50, 59, 50, 126, 0, 27, 91, 49, 59, 50, 70, 0, 27, 91, 49, 59, 53, 70, 0, 27, 79, 80, 0, 27, 91, 50, 49, 126, 0, 27, 79, 81, 0, 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 91, 49, 126, 0, 27, 91, 50, 126, 0, 27, 91, 50, 59, 53, 126, 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 79, 67, 0, 27, 91, 49, 59, 50, 66, 0, 27, 91, 49, 59, 50, 65, 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, 63, 49, 104, 27, 61, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 83, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 91, 105, 0, 27, 91, 52, 105, 0, 27, 91, 53, 105, 0, 27, 99, 0, 27, 91, 52, 108, 27, 62, 27, 91, 63, 49, 48, 51, 52, 108, 0, 27, 56, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, 37, 63, 37, 112, 57, 37, 116, 27, 40, 48, 37, 101, 27, 40, 66, 37, 59, 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 49, 37, 112, 51, 37, 124, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 37, 63, 37, 112, 55, 37, 116, 59, 56, 37, 59, 109, 0, 27, 72, 0, 9, 0, 27, 93, 48, 59, 0, 27, 91, 49, 126, 0, 27, 91, 53, 126, 0, 27, 79, 117, 0, 27, 91, 52, 126, 0, 27, 91, 54, 126, 0, 43, 67, 44, 68, 45, 65, 46, 66, 48, 69, 96, 96, 97, 97, 102, 102, 103, 103, 104, 70, 105, 71, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 41, 48, 0, 27, 91, 52, 126, 0, 27, 79, 77, 0, 27, 91, 51, 59, 50, 126, 0, 27, 91, 49, 59, 50, 70, 0, 27, 91, 49, 59, 50, 72, 0, 27, 91, 50, 59, 50, 126, 0, 27, 91, 49, 59, 50, 68, 0, 27, 91, 54, 59, 50, 126, 0, 27, 91, 53, 59, 50, 126, 0, 27, 91, 49, 59, 50, 67, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 49, 59, 50, 80, 0, 27, 91, 49, 59, 50, 81, 0, 27, 91, 49, 59, 50, 82, 0, 27, 91, 49, 59, 50, 83, 0, 27, 91, 49, 53, 59, 50, 126, 0, 27, 91, 49, 55, 59, 50, 126, 0, 27, 91, 49, 56, 59, 50, 126, 0, 27, 91, 49, 57, 59, 50, 126, 0, 27, 91, 50, 48, 59, 50, 126, 0, 27, 91, 50, 49, 59, 50, 126, 0, 27, 91, 50, 51, 59, 50, 126, 0, 27, 91, 50, 52, 59, 50, 126, 0, 27, 91, 49, 59, 53, 80, 0, 27, 91, 49, 59, 53, 81, 0, 27, 91, 49, 59, 53, 82, 0, 27, 91, 49, 59, 53, 83, 0, 27, 91, 49, 53, 59, 53, 126, 0, 27, 91, 49, 55, 59, 53, 126, 0, 27, 91, 49, 56, 59, 53, 126, 0, 27, 91, 49, 57, 59, 53, 126, 0, 27, 91, 50, 48, 59, 53, 126, 0, 27, 91, 50, 49, 59, 53, 126, 0, 27, 91, 50, 51, 59, 53, 126, 0, 27, 91, 50, 52, 59, 53, 126, 0, 27, 91, 49, 59, 54, 80, 0, 27, 91, 49, 59, 54, 81, 0, 27, 91, 49, 59, 54, 82, 0, 27, 91, 49, 59, 54, 83, 0, 27, 91, 49, 53, 59, 54, 126, 0, 27, 91, 49, 55, 59, 54, 126, 0, 27, 91, 49, 56, 59, 54, 126, 0, 27, 91, 49, 57, 59, 54, 126, 0, 27, 91, 50, 48, 59, 54, 126, 0, 27, 91, 50, 49, 59, 54, 126, 0, 27, 91, 50, 51, 59, 54, 126, 0, 27, 91, 50, 52, 59, 54, 126, 0, 27, 91, 49, 59, 51, 80, 0, 27, 91, 49, 59, 51, 81, 0, 27, 91, 49, 59, 51, 82, 0, 27, 91, 49, 59, 51, 83, 0, 27, 91, 49, 53, 59, 51, 126, 0, 27, 91, 49, 55, 59, 51, 126, 0, 27, 91, 49, 56, 59, 51, 126, 0, 27, 91, 49, 57, 59, 51, 126, 0, 27, 91, 50, 48, 59, 51, 126, 0, 27, 91, 50, 49, 59, 51, 126, 0, 27, 91, 50, 51, 59, 51, 126, 0, 27, 91, 50, 52, 59, 51, 126, 0, 27, 91, 49, 59, 52, 80, 0, 27, 91, 49, 59, 52, 81, 0, 27, 91, 49, 59, 52, 82, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 49, 59, 50, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 91, 51, 109, 0, 27, 91, 50, 51, 109, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0 +}; +// Taken from Dickey ncurses terminfo.src dated 2017-04-22. +// This is a 256-colour terminfo description that lacks true-colour +// capabilities that gnome actually has. +static const signed char vte_256colour_terminfo[] = { + 26, 1, 52, 0, 29, 0, 15, 0, 105, 1, -55, 5, 103, 110, 111, 109, 101, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 71, 78, 79, 77, 69, 32, 84, 101, 114, 109, 105, 110, 97, 108, 32, 119, 105, 116, 104, 32, 120, 116, 101, 114, 109, 32, 50, 53, 54, 45, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, 0, 0, 4, 0, 6, 0, 8, 0, 25, 0, 30, 0, 38, 0, 42, 0, 46, 0, -1, -1, 57, 0, 74, 0, 76, 0, 80, 0, 87, 0, -1, -1, 89, 0, 96, 0, -1, -1, 100, 0, -1, -1, 104, 0, 108, 0, -1, -1, -1, -1, 112, 0, -1, -1, 114, 0, 119, 0, -1, -1, -128, 0, -123, 0, -118, 0, -1, -1,-113, 0, -108, 0, -103, 0, -98, 0, -89, 0, -87, 0, -81, 0, -1, -1, -68, 0, -63, 0, -57, 0, -51, 0, -1, -1, -1, -1, -1, -1, -33, 0, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, 4, 1, -1, -1, -1, -1, -1, -1, 6, 1, -1, -1, 11, 1, -1, -1, -1, -1, -1, -1, -1, -1, 15, 1, 19, 1, 25, 1, 29, 1, 33, 1, 37, 1, 43, 1, 49, 1, 55, 1, 61, 1, 67, 1, 71, 1, -1, -1, 76, 1, -1, -1, 80, 1, 85, 1, 90, 1, 94, 1, 101, 1, -1, -1, 108, 1, 112, 1, 120, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -128, 1,-119, 1, -110, 1, -101, 1, -92, 1, -83, 1, -74, 1, -65, 1, -56, 1, -47, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -38, 1, -35, 1, -1, -1, -1, -1, 16, 2, 19, 2, 30, 2, 33, 2, 35, 2, 38, 2, 116, 2, -1, -1, 119, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 121, 2, -1, -1, -1, -1, -1, -1, -1, -1, 125, 2, -1, -1, -78, 2, -1, -1, -1, -1, -74, 2, -68, 2, -1, -1, -1, -1, -62, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -58, 2, -54, 2, -1, -1, -50, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -45, 2, -1, -1, -38, 2, -33, 2, -1, -1, -1, -1, -1, -1, -1, -1, -26, 2, -19, 2, -12, 2, -1, -1, -1, -1, -5, 2, -1, -1, 2, 3, -1, -1, -1, -1, -1, -1, 9, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 16, 3, 22, 3, 28, 3, 35, 3, 42, 3, 49, 3, 56, 3, 64, 3, 72, 3, 80, 3, 88, 3, 96, 3, 104, 3, 112, 3, 120, 3, 127, 3, -122, 3, -115, 3,-108, 3, -100, 3, -92, 3, -84, 3, -76, 3, -68, 3, -60, 3, -52, 3, -44, 3, -37, 3, -30, 3, -23, 3, -16, 3, -8, 3, 0, 4, 8, 4, 16, 4, 24, 4, 32, 4, 40, 4, 48, 4, 55, 4, 62, 4, 69, 4, 76, 4, 84, 4, 92, 4, 100, 4, 108, 4, 116, 4, 124, 4, -124, 4,-116, 4, -109, 4, -102, 4, -95, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -90, 4, -79, 4, -74, 4, -55, 4, -51, 4, -42, 4, -35, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 64, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 70, 5, -1, -1, -1, -1, -1, -1, 74, 5, -119, 5, 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 50, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, 27, 91, 65, 0, 27, 91, 80, 0, 27, 91, 77, 0, 14, 0, 27, 91, 49, 109, 0, 27, 55, 27, 91, 63, 52, 55, 104, 0, 27, 91, 50, 109, 0, 27, 91, 52, 104, 0, 27, 91, 56, 109, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, 37, 112, 49, 37, 100, 88, 0, 15, 0, 27, 91, 48, 109, 15, 0, 27, 91, 50, 74, 27, 91, 63, 52, 55, 108, 27, 56, 0, 27, 91, 52, 108, 0, 27, 91, 50, 55, 109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, 104, 36, 60, 49, 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 27, 91, 109, 27, 91, 63, 55, 104, 27, 91, 52, 108, 27, 62, 27, 55, 27, 91, 114, 27, 91, 63, 49, 59, 51, 59, 52, 59, 54, 108, 27, 56, 0, 27, 91, 76, 0, 127, 0, 27, 91, 51, 126, 0, 27, 79, 66, 0, 27, 79, 80, 0, 27, 91, 50, 49, 126, 0, 27, 79, 81, 0, 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 79, 72, 0, 27, 91, 50, 126, 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 79, 67, 0, 27, 91, 49, 59, 50, 66, 0, 27, 91, 49, 59, 50, 65, 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, 63, 49, 104, 27, 61, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 83, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 84, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 99, 0, 27, 55, 27, 91, 114, 27, 56, 27, 91, 109, 27, 91, 63, 55, 104, 27, 91, 33, 112, 27, 91, 63, 49, 59, 51, 59, 52, 59, 54, 108, 27, 91, 52, 108, 27, 62, 27, 91, 63, 49, 48, 48, 48, 108, 27, 91, 63, 50, 53, 104, 0, 27, 56, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 53, 37, 116, 59, 50, 37, 59, 37, 63, 37, 112, 55, 37, 116, 59, 56, 37, 59, 37, 63, 37, 112, 49, 37, 112, 51, 37, 124, 37, 116, 59, 55, 37, 59, 109, 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, 9, 0, 27, 91, 69, 0, 96, 96, 97, 97, 102, 102, 103, 103, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 91, 63, 55, 104, 0, 27, 91, 63, 55, 108, 0, 27, 41, 48, 0, 27, 79, 70, 0, 27, 79, 77, 0, 27, 91, 49, 126, 0, 27, 91, 51, 59, 50, 126, 0, 27, 91, 52, 126, 0, 27, 91, 49, 59, 50, 70, 0, 27, 91, 49, 59, 50, 72, 0, 27, 91, 50, 59, 50, 126, 0, 27, 91, 49, 59, 50, 68, 0, 27, 91, 54, 59, 50, 126, 0, 27, 91, 53, 59, 50, 126, 0, 27, 91, 49, 59, 50, 67, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 49, 59, 50, 80, 0, 27, 91, 49, 59, 50, 81, 0, 27, 91, 49, 59, 50, 82, 0, 27, 91, 49, 59, 50, 83, 0, 27, 91, 49, 53, 59, 50, 126, 0, 27, 91, 49, 55, 59, 50, 126, 0, 27, 91, 49, 56, 59, 50, 126, 0, 27, 91, 49, 57, 59, 50, 126, 0, 27, 91, 50, 48, 59, 50, 126, 0, 27, 91, 50, 49, 59, 50, 126, 0, 27, 91, 50, 51, 59, 50, 126, 0, 27, 91, 50, 52, 59, 50, 126, 0, 27, 91, 49, 59, 53, 80, 0, 27, 91, 49, 59, 53, 81, 0, 27, 91, 49, 59, 53, 82, 0, 27, 91, 49, 59, 53, 83, 0, 27, 91, 49, 53, 59, 53, 126, 0, 27, 91, 49, 55, 59, 53, 126, 0, 27, 91, 49, 56, 59, 53, 126, 0, 27, 91, 49, 57, 59, 53, 126, 0, 27, 91, 50, 48, 59, 53, 126, 0, 27, 91, 50, 49, 59, 53, 126, 0, 27, 91, 50, 51, 59, 53, 126, 0, 27, 91, 50, 52, 59, 53, 126, 0, 27, 91, 49, 59, 54, 80, 0, 27, 91, 49, 59, 54, 81, 0, 27, 91, 49, 59, 54, 82, 0, 27, 91, 49, 59, 54, 83, 0, 27, 91, 49, 53, 59, 54, 126, 0, 27, 91, 49, 55, 59, 54, 126, 0, 27, 91, 49, 56, 59, 54, 126, 0, 27, 91, 49, 57, 59, 54, 126, 0, 27, 91, 50, 48, 59, 54, 126, 0, 27, 91, 50, 49, 59, 54, 126, 0, 27, 91, 50, 51, 59, 54, 126, 0, 27, 91, 50, 52, 59, 54, 126, 0, 27, 91, 49, 59, 51, 80, 0, 27, 91, 49, 59, 51, 81, 0, 27, 91, 49, 59, 51, 82, 0, 27, 91, 49, 59, 51, 83, 0, 27, 91, 49, 53, 59, 51, 126, 0, 27, 91, 49, 55, 59, 51, 126, 0, 27, 91, 49, 56, 59, 51, 126, 0, 27, 91, 49, 57, 59, 51, 126, 0, 27, 91, 50, 48, 59, 51, 126, 0, 27, 91, 50, 49, 59, 51, 126, 0, 27, 91, 50, 51, 59, 51, 126, 0, 27, 91, 50, 52, 59, 51, 126, 0, 27, 91, 49, 59, 52, 80, 0, 27, 91, 49, 59, 52, 81, 0, 27, 91, 49, 59, 52, 82, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 37, 91, 59, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 93, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 93, 49, 48, 52, 7, 0, 27, 93, 52, 59, 37, 112, 49, 37, 100, 59, 114, 103, 98, 58, 37, 112, 50, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 50, 46, 50, 88, 47, 37, 112, 51, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 50, 46, 50, 88, 47, 37, 112, 52, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 50, 46, 50, 88, 27, 92, 0, 27, 91, 51, 109, 0, 27, 91, 50, 51, 109, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0 +}; +// Taken from Dickey ncurses terminfo.src dated 2017-04-22. +static const signed char ansi_terminfo[] = { + 26, 1, 40, 0, 23, 0, 16, 0, 125, 1, 68, 2, 97, 110, 115, 105, 124, 97, 110, 115, 105, 47, 112, 99, 45, 116, 101, 114, 109, 32, 99, 111, 109, 112, 97, 116, 105, 98, 108, 101, 32, 119, 105, 116, 104, 32, 99, 111, 108, 111, 114, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, 0, 64, 0, 3, 0, 0, 0, 4, 0, 6, 0, -1, -1, 8, 0, 13, 0, 20, 0, 24, 0, 28, 0, -1, -1, 39, 0, 56, 0, 60, 0, -1, -1, 64, 0, -1, -1, -1, -1, 68, 0, -1, -1, 72, 0, -1, -1, 76, 0, 80, 0, -1, -1, -1, -1, 84, 0, 90, 0, 95, 0, -1, -1, -1, -1, -1, -1, -1, -1, 100, 0, -1, -1, 105, 0, 110, 0, 115, 0, 120, 0,-127, 0,-121, 0, -1, -1, -1, -1, -1, -1,-113, 0,-109, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,-105, 0, -1, -1,-101, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -99, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -95, 0, -91, 0, -1, -1, -87, 0, -1, -1, -1, -1, -1, -1, -83, 0, -1, -1, -1, -1, -1, -1, -79, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -75, 0, -1, -1, -70, 0, -61, 0, -52, 0, -43, 0, -34, 0, -25, 0, -16, 0, -7, 0, 2, 1, 11, 1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 1, 25, 1, 30, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 1, -1, -1, 61, 1, -1, -1, 63, 1,-107, 1, -1, -1,-104, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,-100, 1, -1, -1, -37, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -33, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -28, 1, -17, 1, -12, 1, 7, 2, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 2, 30, 2, -1, -1, -1, -1, -1, -1, 40, 2, 44, 2, 48, 2, 52, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 56, 2, 62, 2, 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 27, 91, 66, 0, 27, 91, 72, 0, 27, 91, 68, 0, 27, 91, 67, 0, 27, 91, 65, 0, 27, 91, 80, 0, 27, 91, 77, 0, 27, 91, 49, 49, 109, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 56, 109, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, 37, 112, 49, 37, 100, 88, 0, 27, 91, 49, 48, 109, 0, 27, 91, 48, 59, 49, 48, 109, 0, 27, 91, 109, 0, 27, 91, 109, 0, 27, 91, 76, 0, 8, 0, 27, 91, 66, 0, 27, 91, 72, 0, 27, 91, 76, 0, 27, 91, 68, 0, 27, 91, 67, 0, 27, 91, 65, 0, 13, 27, 91, 83, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 83, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 84, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 91, 52, 105, 0, 27, 91, 53, 105, 0, 37, 112, 49, 37, 99, 27, 91, 37, 112, 50, 37, 123, 49, 125, 37, 45, 37, 100, 98, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, 10, 0, 27, 91, 48, 59, 49, 48, 37, 63, 37, 112, 49, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 51, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 55, 37, 116, 59, 56, 37, 59, 37, 63, 37, 112, 57, 37, 116, 59, 49, 49, 37, 59, 109, 0, 27, 72, 0, 27, 91, 73, 0, 43, 16, 44, 17, 45, 24, 46, 25, 48, -37, 96, 4, 97, -79, 102, -8, 103, -15, 104, -80, 106, -39, 107, -65, 108, -38, 109, -64, 110, -59, 111, 126, 112, -60, 113, -60, 114, -60, 115, 95, 116, -61, 117, -76, 118, -63, 119, -62, 120, -77, 121, -13, 122, -14, 123, -29, 124, -40, 125,-100, 126, -2, 0, 27, 91, 90, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 37, 91, 59, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 93, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 91, 51, 37, 112, 49, 37, 100, 109, 0, 27, 91, 52, 37, 112, 49, 37, 100, 109, 0, 27, 40, 66, 0, 27, 41, 66, 0, 27, 42, 66, 0, 27, 43, 66, 0, 27, 91, 49, 49, 109, 0, 27, 91, 49, 48, 109, 0 +}; + +/// Load one of the built-in terminfo entries when unibilium has failed to +/// load a terminfo record from an external database, as it does on termcap- +/// -only systems. We do not do any fancy recognition of xterm pretenders +/// here. An external terminfo database would not do that, and we want to +/// behave as much like an external terminfo database as possible. +unibi_term *load_builtin_terminfo(const char * term) +{ + if (terminfo_is_term_family(term, "xterm")) { + return unibi_from_mem((const char *)xterm_256colour_terminfo, sizeof xterm_256colour_terminfo); + } else if (terminfo_is_term_family(term, "screen")) { + return unibi_from_mem((const char *)screen_256colour_terminfo, sizeof screen_256colour_terminfo); + } else if (terminfo_is_term_family(term, "tmux")) { + return unibi_from_mem((const char *)tmux_256colour_terminfo, sizeof tmux_256colour_terminfo); + } else if (terminfo_is_term_family(term, "rxvt")) { + return unibi_from_mem((const char *)rxvt_256colour_terminfo, sizeof rxvt_256colour_terminfo); + } else if (terminfo_is_term_family(term, "putty")) { + return unibi_from_mem((const char *)putty_256colour_terminfo, sizeof putty_256colour_terminfo); + } else if (terminfo_is_term_family(term, "linux")) { + return unibi_from_mem((const char *)linux_16colour_terminfo, sizeof linux_16colour_terminfo); + } else if (terminfo_is_term_family(term, "interix")) { + return unibi_from_mem((const char *)interix_8colour_terminfo, sizeof interix_8colour_terminfo); + } else if (terminfo_is_term_family(term, "iterm") || terminfo_is_term_family(term, "iTerm.app")) { + return unibi_from_mem((const char *)iterm_256colour_terminfo, sizeof iterm_256colour_terminfo); + } else if (terminfo_is_term_family(term, "st")) { + return unibi_from_mem((const char *)st_256colour_terminfo, sizeof st_256colour_terminfo); + } else if (terminfo_is_term_family(term, "gnome") || terminfo_is_term_family(term, "vte")) { + return unibi_from_mem((const char *)vte_256colour_terminfo, sizeof vte_256colour_terminfo); + } else { + return unibi_from_mem((const char *)ansi_terminfo, sizeof ansi_terminfo); + } +} diff --git a/src/nvim/tui/terminfo.h b/src/nvim/tui/terminfo.h new file mode 100644 index 0000000000..78f6b9c245 --- /dev/null +++ b/src/nvim/tui/terminfo.h @@ -0,0 +1,8 @@ +#ifndef NVIM_TUI_TERMINFO_H +#define NVIM_TUI_TERMINFO_H + +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "tui/terminfo.h.generated.h" +#endif + +#endif // NVIM_TUI_TERMINFO_H diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index e3612b5c06..3ef2e2967b 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -34,6 +34,7 @@ #include "nvim/ugrid.h" #include "nvim/tui/input.h" #include "nvim/tui/tui.h" +#include "nvim/tui/terminfo.h" #include "nvim/cursor_shape.h" #include "nvim/syntax.h" #include "nvim/macros.h" @@ -51,10 +52,15 @@ // Per the commentary in terminfo, only a minus sign is a true suffix // separator. -#define TERMINAL_FAMILY(term, prefix) ((term) \ - && strlen(term) >= (sizeof(prefix) - 1) \ - && 0 == memcmp((term), (prefix), sizeof(prefix) - 1) \ - && ('\0' == (term)[sizeof(prefix) - 1] || '-' == (term)[sizeof(prefix) - 1])) +bool terminfo_is_term_family(const char *term, const char *family) +{ + if (!term) return false; + size_t tlen = strlen(term); + size_t flen = strlen(family); + return tlen >= flen + && 0 == memcmp(term, family, flen) \ + && ('\0' == term[flen] || '-' == term[flen]); +} typedef struct { int top, bot, left, right; @@ -196,9 +202,9 @@ static void terminfo_start(UI *ui) !!unibi_get_str(data->ut, unibi_set_left_margin_parm) && !!unibi_get_str(data->ut, unibi_set_right_margin_parm); data->immediate_wrap_after_last_column = - TERMINAL_FAMILY(term, "iterm") - || TERMINAL_FAMILY(term, "interix") - || (TERMINAL_FAMILY(term, "xterm") && iterm_env); + terminfo_is_term_family(term, "iterm") + || terminfo_is_term_family(term, "interix") + || (terminfo_is_term_family(term, "xterm") && iterm_env); // Set 't_Co' from the result of unibilium & fix_terminfo. t_colors = unibi_get_num(data->ut, unibi_max_colors); // Enter alternate screen and clear @@ -1199,1356 +1205,6 @@ static int unibi_find_ext_str(unibi_term *ut, const char *name) return -1; } -// One creates the dumps from terminfo.src by using -// od -t d1 -w16 | cut -c9- | sed -e 's/\>/,/g' -// on the compiled files. - -// Taken from Dickey ncurses terminfo.src dated 2017-04-22. -// This is a 256-colour terminfo description that lacks true-colour and -// DECSTBM/DECSLRM/DECLRMM capabilities that xterm actually has. -static const signed char xterm_256colour_terminfo[] = { - 26, 1, 37, 0, 29, 0, 15, 0, 105, 1, -42, 5, 120, 116, 101, 114, - 109, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 120, 116, 101, 114, 109, - 32, 119, 105, 116, 104, 32, 50, 53, 54, 32, 99, 111, 108, 111, 114, 115, - 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 80, 0, - 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, 0, 0, 4, 0, - 6, 0, 8, 0, 25, 0, 30, 0, 38, 0, 42, 0, 46, 0, -1, -1, - 57, 0, 74, 0, 76, 0, 80, 0, 87, 0, -1, -1, 89, 0, 102, 0, - -1, -1, 106, 0, 110, 0, 120, 0, 124, 0, -1, -1, -1, -1,-128, 0, --124, 0,-119, 0,-114, 0, -1, -1,-105, 0,-100, 0, -95, 0, -1, -1, - -90, 0, -85, 0, -80, 0, -75, 0, -66, 0, -62, 0, -55, 0, -1, -1, - -46, 0, -41, 0, -35, 0, -29, 0, -1, -1, -1, -1, -1, -1, -11, 0, - -1, -1, -1, -1, -1, -1, 7, 1, -1, -1, 11, 1, -1, -1, -1, -1, - -1, -1, 13, 1, -1, -1, 18, 1, -1, -1, -1, -1, -1, -1, -1, -1, - 22, 1, 26, 1, 32, 1, 36, 1, 40, 1, 44, 1, 50, 1, 56, 1, - 62, 1, 68, 1, 74, 1, 78, 1, -1, -1, 83, 1, -1, -1, 87, 1, - 92, 1, 97, 1, 101, 1, 108, 1, -1, -1, 115, 1, 119, 1, 127, 1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1,-121, 1,-112, 1, -1, -1, -1, -1,-103, 1, - -94, 1, -85, 1, -76, 1, -67, 1, -58, 1, -49, 1, -40, 1, -31, 1, - -22, 1, -1, -1, -1, -1, -1, -1, -13, 1, -9, 1, -4, 1, -1, -1, - 1, 2, 10, 2, -1, -1, -1, -1, 28, 2, 31, 2, 42, 2, 45, 2, - 47, 2, 50, 2,-113, 2, -1, -1,-110, 2, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1,-108, 2, -1, -1, -1, -1, -1, -1, -1, -1, --104, 2, -1, -1, -51, 2, -1, -1, -1, -1, -47, 2, -41, 2, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -35, 2, -31, 2, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -27, 2, -1, -1, -1, -1, - -20, 2, -1, -1, -1, -1, -1, -1, -1, -1, -13, 2, -6, 2, 1, 3, - -1, -1, -1, -1, 8, 3, -1, -1, 15, 3, -1, -1, -1, -1, -1, -1, - 22, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 29, 3, 35, 3, - 41, 3, 48, 3, 55, 3, 62, 3, 69, 3, 77, 3, 85, 3, 93, 3, - 101, 3, 109, 3, 117, 3, 125, 3,-123, 3,-116, 3,-109, 3,-102, 3, - -95, 3, -87, 3, -79, 3, -71, 3, -63, 3, -55, 3, -47, 3, -39, 3, - -31, 3, -24, 3, -17, 3, -10, 3, -3, 3, 5, 4, 13, 4, 21, 4, - 29, 4, 37, 4, 45, 4, 53, 4, 61, 4, 68, 4, 75, 4, 82, 4, - 89, 4, 97, 4, 105, 4, 113, 4, 121, 4,-127, 4,-119, 4,-111, 4, --103, 4, -96, 4, -89, 4, -82, 4, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -77, 4, -66, 4, -61, 4, -42, 4, -38, 4, - -29, 4, -22, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 72, 5, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 77, 5, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 83, 5, -1, -1, -1, -1, -1, -1, 87, 5,-106, 5, 27, 91, - 90, 0, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, - 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, - 91, 50, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, - 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, - 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, - 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, 49, 50, 108, 27, 91, 63, - 50, 53, 104, 0, 27, 91, 67, 0, 27, 91, 65, 0, 27, 91, 63, 49, - 50, 59, 50, 53, 104, 0, 27, 91, 80, 0, 27, 91, 77, 0, 27, 40, - 48, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 63, 49, - 48, 52, 57, 104, 0, 27, 91, 50, 109, 0, 27, 91, 52, 104, 0, 27, - 91, 56, 109, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, - 52, 109, 0, 27, 91, 37, 112, 49, 37, 100, 88, 0, 27, 40, 66, 0, - 27, 40, 66, 27, 91, 109, 0, 27, 91, 63, 49, 48, 52, 57, 108, 0, - 27, 91, 52, 108, 0, 27, 91, 50, 55, 109, 0, 27, 91, 50, 52, 109, - 0, 27, 91, 63, 53, 104, 36, 60, 49, 48, 48, 47, 62, 27, 91, 63, - 53, 108, 0, 27, 91, 33, 112, 27, 91, 63, 51, 59, 52, 108, 27, 91, - 52, 108, 27, 62, 0, 27, 91, 76, 0, 8, 0, 27, 91, 51, 126, 0, - 27, 79, 66, 0, 27, 79, 80, 0, 27, 91, 50, 49, 126, 0, 27, 79, - 81, 0, 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, 49, 53, 126, 0, - 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, - 126, 0, 27, 91, 50, 48, 126, 0, 27, 79, 72, 0, 27, 91, 50, 126, - 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, - 79, 67, 0, 27, 91, 49, 59, 50, 66, 0, 27, 91, 49, 59, 50, 65, - 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, 63, - 49, 104, 27, 61, 0, 27, 91, 63, 49, 48, 51, 52, 108, 0, 27, 91, - 63, 49, 48, 51, 52, 104, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, - 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, - 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, - 37, 100, 83, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, - 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, - 91, 37, 112, 49, 37, 100, 84, 0, 27, 91, 37, 112, 49, 37, 100, 65, - 0, 27, 91, 105, 0, 27, 91, 52, 105, 0, 27, 91, 53, 105, 0, 27, - 99, 27, 93, 49, 48, 52, 7, 0, 27, 91, 33, 112, 27, 91, 63, 51, - 59, 52, 108, 27, 91, 52, 108, 27, 62, 0, 27, 56, 0, 27, 91, 37, - 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, - 37, 63, 37, 112, 57, 37, 116, 27, 40, 48, 37, 101, 27, 40, 66, 37, - 59, 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, - 63, 37, 112, 53, 37, 116, 59, 50, 37, 59, 37, 63, 37, 112, 50, 37, - 116, 59, 52, 37, 59, 37, 63, 37, 112, 49, 37, 112, 51, 37, 124, 37, - 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, - 37, 63, 37, 112, 55, 37, 116, 59, 56, 37, 59, 109, 0, 27, 72, 0, - 9, 0, 27, 79, 69, 0, 96, 96, 97, 97, 102, 102, 103, 103, 105, 105, - 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, - 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, - 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, - 91, 63, 55, 104, 0, 27, 91, 63, 55, 108, 0, 27, 79, 70, 0, 27, - 79, 77, 0, 27, 91, 51, 59, 50, 126, 0, 27, 91, 49, 59, 50, 70, - 0, 27, 91, 49, 59, 50, 72, 0, 27, 91, 50, 59, 50, 126, 0, 27, - 91, 49, 59, 50, 68, 0, 27, 91, 54, 59, 50, 126, 0, 27, 91, 53, - 59, 50, 126, 0, 27, 91, 49, 59, 50, 67, 0, 27, 91, 50, 51, 126, - 0, 27, 91, 50, 52, 126, 0, 27, 91, 49, 59, 50, 80, 0, 27, 91, - 49, 59, 50, 81, 0, 27, 91, 49, 59, 50, 82, 0, 27, 91, 49, 59, - 50, 83, 0, 27, 91, 49, 53, 59, 50, 126, 0, 27, 91, 49, 55, 59, - 50, 126, 0, 27, 91, 49, 56, 59, 50, 126, 0, 27, 91, 49, 57, 59, - 50, 126, 0, 27, 91, 50, 48, 59, 50, 126, 0, 27, 91, 50, 49, 59, - 50, 126, 0, 27, 91, 50, 51, 59, 50, 126, 0, 27, 91, 50, 52, 59, - 50, 126, 0, 27, 91, 49, 59, 53, 80, 0, 27, 91, 49, 59, 53, 81, - 0, 27, 91, 49, 59, 53, 82, 0, 27, 91, 49, 59, 53, 83, 0, 27, - 91, 49, 53, 59, 53, 126, 0, 27, 91, 49, 55, 59, 53, 126, 0, 27, - 91, 49, 56, 59, 53, 126, 0, 27, 91, 49, 57, 59, 53, 126, 0, 27, - 91, 50, 48, 59, 53, 126, 0, 27, 91, 50, 49, 59, 53, 126, 0, 27, - 91, 50, 51, 59, 53, 126, 0, 27, 91, 50, 52, 59, 53, 126, 0, 27, - 91, 49, 59, 54, 80, 0, 27, 91, 49, 59, 54, 81, 0, 27, 91, 49, - 59, 54, 82, 0, 27, 91, 49, 59, 54, 83, 0, 27, 91, 49, 53, 59, - 54, 126, 0, 27, 91, 49, 55, 59, 54, 126, 0, 27, 91, 49, 56, 59, - 54, 126, 0, 27, 91, 49, 57, 59, 54, 126, 0, 27, 91, 50, 48, 59, - 54, 126, 0, 27, 91, 50, 49, 59, 54, 126, 0, 27, 91, 50, 51, 59, - 54, 126, 0, 27, 91, 50, 52, 59, 54, 126, 0, 27, 91, 49, 59, 51, - 80, 0, 27, 91, 49, 59, 51, 81, 0, 27, 91, 49, 59, 51, 82, 0, - 27, 91, 49, 59, 51, 83, 0, 27, 91, 49, 53, 59, 51, 126, 0, 27, - 91, 49, 55, 59, 51, 126, 0, 27, 91, 49, 56, 59, 51, 126, 0, 27, - 91, 49, 57, 59, 51, 126, 0, 27, 91, 50, 48, 59, 51, 126, 0, 27, - 91, 50, 49, 59, 51, 126, 0, 27, 91, 50, 51, 59, 51, 126, 0, 27, - 91, 50, 52, 59, 51, 126, 0, 27, 91, 49, 59, 52, 80, 0, 27, 91, - 49, 59, 52, 81, 0, 27, 91, 49, 59, 52, 82, 0, 27, 91, 49, 75, - 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, - 0, 27, 91, 63, 37, 91, 59, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 93, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, 52, 57, 109, - 0, 27, 93, 49, 48, 52, 7, 0, 27, 93, 52, 59, 37, 112, 49, 37, - 100, 59, 114, 103, 98, 58, 37, 112, 50, 37, 123, 50, 53, 53, 125, 37, - 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 50, 46, 50, 88, 47, - 37, 112, 51, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, - 48, 125, 37, 47, 37, 50, 46, 50, 88, 47, 37, 112, 52, 37, 123, 50, - 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 50, - 46, 50, 88, 27, 92, 0, 27, 91, 51, 109, 0, 27, 91, 50, 51, 109, - 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, - 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, - 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, 125, - 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, 49, 37, 100, - 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, - 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, - 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, 125, - 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, - 37, 59, 109, 0 -}; -// Taken from unibilium/t/static_tmux.c as of 2015-08-14. -// This is an 256-colour terminfo description that lacks -// status line capabilities that tmux actually has. -static const signed char tmux_256colour_terminfo[] = { - 26, 1, 56, 0, 15, 0, 15, 0, 105, 1, -48, 2, 116, 109, 117, 120, 124, 86, 84, 32, - 49, 48, 48, 47, 65, 78, 83, 73, 32, 88, 51, 46, 54, 52, 32, 118, 105, 114, 116, 117, - 97, 108, 32, 116, 101, 114, 109, 105, 110, 97, 108, 32, 119, 105, 116, 104, 32, 50, 53, 54, - 32, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, - 0, 1, 1, 0, 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, 0, 0, 4, 0, 6, 0, - 8, 0, 25, 0, 30, 0, 37, 0, 41, 0, -1, -1, -1, -1, 45, 0, 62, 0, 64, 0, - 68, 0, 75, 0, -1, -1, 77, 0, 89, 0, -1, -1, 93, 0, 96, 0, 102, 0, 106, 0, - -1, -1, -1, -1, 110, 0, 112, 0, 117, 0, 122, 0, -1, -1, -1, -1, 123, 0, -1, -1, - -1, -1, -128, 0, -123, 0, -118, 0, -1, -1, -113, 0, -111, 0, -106, 0, -1, -1, -105, 0, - -100, 0, -94, 0, -88, 0, -1, -1, -1, -1, -1, -1, -85, 0, -1, -1, -1, -1, -1, -1, - -81, 0, -1, -1, -77, 0, -1, -1, -1, -1, -1, -1, -75, 0, -1, -1, -70, 0, -1, -1, - -1, -1, -1, -1, -1, -1, -66, 0, -62, 0, -56, 0, -52, 0, -48, 0, -44, 0, -38, 0, - -32, 0, -26, 0, -20, 0, -14, 0, -9, 0, -1, -1, -4, 0, -1, -1, 0, 1, 5, 1, - 10, 1, -1, -1, -1, -1, -1, -1, 14, 1, 18, 1, 26, 1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 34, 1, -1, -1, 37, 1, 46, 1, 55, 1, 64, 1, -1, -1, 73, 1, 82, 1, 91, 1, - -1, -1, 100, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 109, 1, -1, -1, -1, -1, 126, 1, -1, -1, -127, 1, -124, 1, -122, 1, -119, 1, -46, 1, - -1, -1, -43, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -41, 1, -1, -1, 24, 2, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 28, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 35, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 40, 2, 46, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, 2, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 57, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 66, 2, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 71, 2, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 77, 2, -1, -1, -1, -1, -1, -1, 81, 2, -112, 2, 27, 91, 90, 0, - 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, - 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, 74, - 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, - 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 51, 52, 104, 27, 91, - 63, 50, 53, 104, 0, 27, 91, 67, 0, 27, 77, 0, 27, 91, 51, 52, 108, 0, 27, 91, - 80, 0, 27, 91, 77, 0, 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 0, 27, - 91, 52, 104, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 15, - 0, 27, 91, 109, 15, 0, 0, 27, 91, 52, 108, 0, 27, 91, 50, 55, 109, 0, 27, 91, - 50, 52, 109, 0, 27, 103, 0, 27, 41, 48, 0, 27, 91, 76, 0, 8, 0, 27, 91, 51, - 126, 0, 27, 79, 66, 0, 27, 79, 80, 0, 27, 91, 50, 49, 126, 0, 27, 79, 81, 0, - 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, - 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 91, - 49, 126, 0, 27, 91, 50, 126, 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, - 126, 0, 27, 79, 67, 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, - 63, 49, 104, 27, 61, 0, 27, 69, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, - 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, - 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, - 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, - 0, 27, 99, 27, 91, 63, 49, 48, 48, 48, 108, 27, 91, 63, 50, 53, 104, 0, 27, 56, - 0, 27, 55, 0, 10, 0, 27, 77, 0, 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, - 49, 37, 59, 37, 63, 37, 112, 49, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 50, 37, - 116, 59, 52, 37, 59, 37, 63, 37, 112, 51, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, - 52, 37, 116, 59, 53, 37, 59, 109, 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, - 59, 0, 27, 72, 0, 9, 0, 43, 43, 44, 44, 45, 45, 46, 46, 48, 48, 96, 96, 97, - 97, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, - 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, - 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 40, 66, 27, - 41, 48, 0, 27, 91, 52, 126, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, - 27, 91, 49, 75, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 91, 51, 109, 0, 27, - 91, 50, 51, 109, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, - 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, - 37, 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, - 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, - 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, - 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, - 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0 -}; -// Taken from unibilium/t/static_screen-256color.c as of 2015-08-14. -// This is an 256-colour terminfo description that lacks -// status line capabilities that screen actually has. -static const signed char screen_256colour_terminfo[] = { - 26, 1, 43, 0, 43, 0, 15, 0, 105, 1, -43, 2, 115, 99, 114, 101, 101, 110, 45, 50, - 53, 54, 99, 111, 108, 111, 114, 124, 71, 78, 85, 32, 83, 99, 114, 101, 101, 110, 32, 119, - 105, 116, 104, 32, 50, 53, 54, 32, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, - 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 80, 0, - 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 0, 1, -1, 127, 0, 0, 4, 0, 6, 0, 8, 0, 25, 0, 30, 0, - 37, 0, 41, 0, -1, -1, -1, -1, 45, 0, 62, 0, 64, 0, 68, 0, 75, 0, -1, -1, - 77, 0, 89, 0, -1, -1, 93, 0, 96, 0, 102, 0, 106, 0, -1, -1, -1, -1, 110, 0, - 112, 0, 117, 0, 122, 0, -1, -1, -1, -1, -125, 0, -1, -1, -1, -1, -120, 0, -115, 0, - -110, 0, -1, -1, -105, 0, -103, 0, -98, 0, -1, -1, -89, 0, -84, 0, -78, 0, -72, 0, - -1, -1, -1, -1, -1, -1, -69, 0, -1, -1, -1, -1, -1, -1, -65, 0, -1, -1, -61, 0, - -1, -1, -1, -1, -1, -1, -59, 0, -1, -1, -54, 0, -1, -1, -1, -1, -1, -1, -1, -1, - -50, 0, -46, 0, -40, 0, -36, 0, -32, 0, -28, 0, -22, 0, -16, 0, -10, 0, -4, 0, - 2, 1, 7, 1, -1, -1, 12, 1, -1, -1, 16, 1, 21, 1, 26, 1, -1, -1, -1, -1, - -1, -1, 30, 1, 34, 1, 42, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 1, -1, -1, 53, 1, - 62, 1, 71, 1, 80, 1, -1, -1, 89, 1, 98, 1, 107, 1, -1, -1, 116, 1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 125, 1, -1, -1, -1, -1, - -114, 1, -1, -1, -111, 1, -108, 1, -106, 1, -103, 1, -30, 1, -1, -1, -27, 1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -25, 1, -1, -1, 40, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 44, 2, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 2, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 56, 2, 62, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 68, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 73, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, 2, - -1, -1, -1, -1, -1, -1, 86, 2, -107, 2, 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, - 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, - 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, - 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, - 63, 50, 53, 108, 0, 8, 0, 27, 91, 51, 52, 104, 27, 91, 63, 50, 53, 104, 0, 27, - 91, 67, 0, 27, 77, 0, 27, 91, 51, 52, 108, 0, 27, 91, 80, 0, 27, 91, 77, 0, - 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 63, 49, 48, 52, 57, 104, - 0, 27, 91, 52, 104, 0, 27, 91, 55, 109, 0, 27, 91, 51, 109, 0, 27, 91, 52, 109, - 0, 15, 0, 27, 91, 109, 15, 0, 27, 91, 63, 49, 48, 52, 57, 108, 0, 27, 91, 52, - 108, 0, 27, 91, 50, 51, 109, 0, 27, 91, 50, 52, 109, 0, 27, 103, 0, 27, 41, 48, - 0, 27, 91, 76, 0, 8, 0, 27, 91, 51, 126, 0, 27, 79, 66, 0, 27, 79, 80, 0, - 27, 91, 50, 49, 126, 0, 27, 79, 81, 0, 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, - 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, - 126, 0, 27, 91, 50, 48, 126, 0, 27, 91, 49, 126, 0, 27, 91, 50, 126, 0, 27, 79, - 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 79, 67, 0, 27, 79, 65, 0, - 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, 63, 49, 104, 27, 61, 0, 27, 69, 0, 27, - 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, - 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, - 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, - 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 99, 27, 91, 63, 49, 48, 48, 48, - 108, 27, 91, 63, 50, 53, 104, 0, 27, 56, 0, 27, 55, 0, 10, 0, 27, 77, 0, 27, - 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 49, 37, 116, - 59, 51, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 51, - 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 109, 37, 63, - 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, 9, 0, 43, 43, 44, - 44, 45, 45, 46, 46, 48, 48, 96, 96, 97, 97, 102, 102, 103, 103, 104, 104, 105, 105, 106, - 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, - 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, - 126, 0, 27, 91, 90, 0, 27, 40, 66, 27, 41, 48, 0, 27, 91, 52, 126, 0, 27, 91, - 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 49, 75, 0, 27, 91, 51, 57, 59, - 52, 57, 109, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, - 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, - 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, - 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, - 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, - 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, - 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 0, 3, 0, 1, 0, - 24, 0, 52, 0, -112, 0, 1, 1, 0, 0, 1, 0, 0, 0, 4, 0, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 0, 0, 3, 0, 6, 0, 9, 0, 12, 0, 15, 0, 18, 0, 23, 0, 28, 0, 32, 0, - 37, 0, 43, 0, 49, 0, 55, 0, 61, 0, 66, 0, 71, 0, 77, 0, 83, 0, 89, 0, - 95, 0, 101, 0, 107, 0, 111, 0, 116, 0, 120, 0, 124, 0, -128, 0, 27, 40, 66, 0, - 27, 40, 37, 112, 49, 37, 99, 0, 65, 88, 0, 71, 48, 0, 88, 84, 0, 85, 56, 0, - 69, 48, 0, 83, 48, 0, 107, 68, 67, 53, 0, 107, 68, 67, 54, 0, 107, 68, 78, 0, - 107, 68, 78, 53, 0, 107, 69, 78, 68, 53, 0, 107, 69, 78, 68, 54, 0, 107, 72, 79, - 77, 53, 0, 107, 72, 79, 77, 54, 0, 107, 73, 67, 53, 0, 107, 73, 67, 54, 0, 107, - 76, 70, 84, 53, 0, 107, 78, 88, 84, 53, 0, 107, 78, 88, 84, 54, 0, 107, 80, 82, - 86, 53, 0, 107, 80, 82, 86, 54, 0, 107, 82, 73, 84, 53, 0, 107, 85, 80, 0, 107, - 85, 80, 53, 0, 107, 97, 50, 0, 107, 98, 49, 0, 107, 98, 51, 0, 107, 99, 50, 0 -}; -// Taken from Dickey ncurses terminfo.src dated 2017-04-22. -static const signed char iterm_256colour_terminfo[] = { - 26, 1, 57, 0, 29, 0, 15, 0, 105, 1, 73, 3, 105, 84, 101, 114, - 109, 46, 97, 112, 112, 124, 105, 116, 101, 114, 109, 124, 105, 84, 101, 114, - 109, 46, 97, 112, 112, 32, 116, 101, 114, 109, 105, 110, 97, 108, 32, 101, - 109, 117, 108, 97, 116, 111, 114, 32, 102, 111, 114, 32, 77, 97, 99, 32, - 79, 83, 32, 88, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, - 50, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, - -1, -1, 0, 0, 2, 0, -2, -1, 4, 0, 9, 0, 16, 0, 20, 0, - 24, 0, -1, -1, 35, 0, 52, 0, 54, 0, 58, 0, 65, 0, -1, -1, - 67, 0, 74, 0, -1, -1, 78, 0, -1, -1, 82, 0, 86, 0, 90, 0, - -1, -1, 96, 0, 98, 0, 103, 0, 108, 0, -1, -1, -2, -1, 117, 0, - 122, 0, -1, -1, 127, 0,-124, 0,-119, 0, -1, -1,-114, 0,-112, 0, --107, 0, -1, -1, -94, 0, -89, 0, -85, 0, -81, 0, -1, -1, -63, 0, - -1, -1, -1, -1, -1, -1, -1, -1, -61, 0, -57, 0, -1, -1, -53, 0, - -1, -1, -1, -1, -1, -1, -51, 0, -1, -1, -46, 0, -1, -1, -1, -1, - -1, -1, -1, -1, -42, 0, -38, 0, -32, 0, -28, 0, -24, 0, -20, 0, - -14, 0, -8, 0, -2, 0, 4, 1, 10, 1, -1, -1, -1, -1, 14, 1, - -1, -1, 18, 1, 23, 1, 28, 1, -1, -1, -1, -1, -1, -1, 32, 1, - 36, 1, 44, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 52, 1, 61, 1, 70, 1, 79, 1, -1, -1, 88, 1, 97, 1, - 106, 1, -1, -1, 115, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 124, 1, -1, -1, -1, -1,-104, 1,-101, 1, - -90, 1, -87, 1, -85, 1, -82, 1, -4, 1, -1, -1, -1, 1, 1, 2, - -1, -1, -1, -1, -1, -1, 6, 2, 10, 2, 14, 2, 18, 2, 22, 2, - -1, -1, -1, -1, 26, 2, -1, -1, -1, -1, -1, -1, -1, -1, 77, 2, - 83, 2, -1, -1, -1, -1, 89, 2, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 96, 2, 100, 2, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 104, 2, 110, 2, 116, 2, 122, 2,-128, 2,-122, 2,-116, 2,-110, 2, - 104, 2, -98, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -92, 2, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -87, 2, -76, 2, -71, 2, - -63, 2, -59, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -54, 2, - 9, 3, 7, 0, 13, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, - 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, - 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, - 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, - 53, 108, 0, 8, 0, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, - 27, 91, 65, 0, 27, 91, 80, 0, 27, 91, 77, 0, 27, 93, 50, 59, - 7, 0, 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 55, - 27, 91, 63, 52, 55, 104, 0, 27, 91, 52, 104, 0, 27, 91, 56, 109, - 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, - 15, 0, 27, 91, 109, 15, 0, 27, 91, 50, 74, 27, 91, 63, 52, 55, - 108, 27, 56, 0, 27, 91, 52, 108, 0, 27, 91, 109, 0, 27, 91, 109, - 0, 27, 91, 63, 53, 104, 36, 60, 50, 48, 48, 47, 62, 27, 91, 63, - 53, 108, 0, 7, 0, 27, 91, 64, 0, 27, 91, 76, 0, 127, 0, 27, - 91, 51, 126, 0, 27, 79, 66, 0, 27, 79, 80, 0, 27, 91, 50, 49, - 126, 0, 27, 79, 81, 0, 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, - 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, - 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 79, 72, 0, - 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 79, - 67, 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, - 63, 49, 104, 27, 61, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, - 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, - 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, - 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, - 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 62, - 27, 91, 63, 51, 108, 27, 91, 63, 52, 108, 27, 91, 63, 53, 108, 27, - 91, 63, 55, 104, 27, 91, 63, 56, 104, 0, 27, 56, 0, 27, 91, 37, - 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, - 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, - 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 49, 37, 112, - 51, 37, 124, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, - 59, 53, 37, 59, 37, 63, 37, 112, 55, 37, 116, 59, 56, 37, 59, 109, - 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, - 0, 9, 0, 27, 93, 50, 59, 0, 27, 79, 113, 0, 27, 79, 115, 0, - 27, 79, 114, 0, 27, 79, 112, 0, 27, 79, 110, 0, 96, 96, 97, 97, - 102, 102, 103, 103, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, - 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, - 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, - 91, 63, 55, 104, 0, 27, 91, 63, 55, 108, 0, 27, 40, 66, 27, 41, - 48, 0, 27, 79, 70, 0, 27, 79, 77, 0, 27, 91, 50, 51, 126, 0, - 27, 91, 50, 52, 126, 0, 27, 91, 50, 53, 126, 0, 27, 91, 50, 54, - 126, 0, 27, 91, 50, 56, 126, 0, 27, 91, 50, 57, 126, 0, 27, 91, - 51, 49, 126, 0, 27, 91, 50, 50, 126, 0, 27, 91, 51, 51, 126, 0, - 27, 91, 51, 52, 126, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, - 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 49, 59, - 50, 99, 0, 27, 91, 99, 0, 27, 91, 48, 109, 0, 27, 91, 37, 63, - 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, - 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, - 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, - 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, - 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, - 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, - 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, - 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0 -}; -// Taken from Dickey ncurses terminfo.src dated 2017-04-22. -// This is a 256-colour terminfo description that lacks true-colour -// capabilities that rxvt actually has. -static const signed char rxvt_256colour_terminfo[] = { - 26, 1, 47, 0, 29, 0, 15, 0, 110, 1, -31, 4, 114, 120, 118, 116, - 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 114, 120, 118, 116, 32, 50, - 46, 55, 46, 57, 32, 119, 105, 116, 104, 32, 120, 116, 101, 114, 109, 32, - 50, 53, 54, 45, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, - 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 1, 1, 80, 0, 8, 0, 24, 0, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 0, 1, -1, 127, -1, -1, 0, 0, 2, 0, 4, 0, 21, 0, - 26, 0, 34, 0, 38, 0, 42, 0, -1, -1, 53, 0, 70, 0, 72, 0, - 76, 0, 83, 0, -1, -1, 85, 0, 92, 0, -1, -1, 96, 0, -1, -1, - -1, -1, 100, 0, -1, -1, -1, -1, 104, 0, 106, 0, 111, 0, 116, 0, - -1, -1, -1, -1, 125, 0, -1, -1, -1, -1,-126, 0,-121, 0,-116, 0, - -1, -1,-111, 0,-109, 0,-104, 0, -1, -1, -91, 0, -86, 0, -80, 0, - -74, 0, -1, -1, -1, -1, -56, 0, -42, 0, -1, -1, -1, -1, -8, 0, - -4, 0, -1, -1, 0, 1, -1, -1, -1, -1, -1, -1, 2, 1, -1, -1, - 7, 1, -1, -1, 11, 1, -1, -1, 16, 1, 22, 1, 28, 1, 34, 1, - 40, 1, 46, 1, 52, 1, 58, 1, 64, 1, 70, 1, 76, 1, 82, 1, - 87, 1, -1, -1, 92, 1, -1, -1, 96, 1, 101, 1, 106, 1, 110, 1, - 114, 1, -1, -1, 118, 1, 122, 1, 125, 1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,-128, 1,-119, 1,-110, 1, - -1, -1,-101, 1, -92, 1, -83, 1, -1, -1, -74, 1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -65, 1, -32, 1, -1, -1, - -1, -1, 18, 2, 21, 2, 32, 2, 35, 2, 37, 2, 40, 2, 107, 2, - -1, -1, 110, 2, -1, -1, -1, -1, -1, -1, -1, -1, 112, 2, 116, 2, - 120, 2, 124, 2,-128, 2, -1, -1, -1, -1,-124, 2, -1, -1, -73, 2, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -69, 2, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -62, 2, - -57, 2, -1, -1, -53, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -48, 2, -1, -1, -43, 2, -38, 2, -1, -1, -1, -1, - -1, -1, -1, -1, -33, 2, -28, 2, -23, 2, -1, -1, -1, -1, -19, 2, - -1, -1, -14, 2, -1, -1, -1, -1, -1, -1, -9, 2, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -5, 2, 1, 3, 7, 3, 13, 3, 19, 3, - 25, 3, 31, 3, 37, 3, 43, 3, 49, 3, 55, 3, 61, 3, 67, 3, - 73, 3, 79, 3, 85, 3, 91, 3, 97, 3, 103, 3, 109, 3, 115, 3, - 121, 3, 127, 3,-123, 3,-117, 3,-111, 3,-105, 3, -99, 3, -93, 3, - -87, 3, -81, 3, -75, 3, -69, 3, -63, 3, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -57, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -52, 3, -41, 3, -36, 3, -28, 3, -24, 3, -15, 3, -8, 3, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 86, 4, -1, -1, - -1, -1, -1, -1, 90, 4,-103, 4, -1, -1, -1, -1, -1, -1, -39, 4, - -35, 4, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, - 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, - 91, 50, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, - 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, - 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, - 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, 50, 53, 104, 0, 27, 91, - 67, 0, 27, 91, 65, 0, 27, 91, 77, 0, 14, 0, 27, 91, 53, 109, - 0, 27, 91, 49, 109, 0, 27, 55, 27, 91, 63, 52, 55, 104, 0, 27, - 91, 52, 104, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, - 52, 109, 0, 15, 0, 27, 91, 109, 15, 0, 27, 91, 50, 74, 27, 91, - 63, 52, 55, 108, 27, 56, 0, 27, 91, 52, 108, 0, 27, 91, 50, 55, - 109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, 104, 36, 60, 49, - 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 27, 91, 63, 52, 55, 108, - 27, 61, 27, 91, 63, 49, 108, 0, 27, 91, 114, 27, 91, 109, 27, 91, - 50, 74, 27, 91, 72, 27, 91, 63, 55, 104, 27, 91, 63, 49, 59, 51, - 59, 52, 59, 54, 108, 27, 91, 52, 108, 0, 27, 91, 64, 0, 27, 91, - 76, 0, 8, 0, 27, 91, 51, 126, 0, 27, 91, 66, 0, 27, 91, 56, - 94, 0, 27, 91, 50, 49, 126, 0, 27, 91, 49, 49, 126, 0, 27, 91, - 50, 49, 126, 0, 27, 91, 49, 50, 126, 0, 27, 91, 49, 51, 126, 0, - 27, 91, 49, 52, 126, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, - 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, - 50, 48, 126, 0, 27, 91, 55, 126, 0, 27, 91, 50, 126, 0, 27, 91, - 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 91, 67, 0, - 27, 91, 97, 0, 27, 91, 98, 0, 27, 91, 65, 0, 27, 62, 0, 27, - 61, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, - 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, - 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, - 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, - 0, 27, 62, 27, 91, 49, 59, 51, 59, 52, 59, 53, 59, 54, 108, 27, - 91, 63, 55, 104, 27, 91, 109, 27, 91, 114, 27, 91, 50, 74, 27, 91, - 72, 0, 27, 91, 114, 27, 91, 109, 27, 91, 50, 74, 27, 91, 72, 27, - 91, 63, 55, 104, 27, 91, 63, 49, 59, 51, 59, 52, 59, 54, 108, 27, - 91, 52, 108, 27, 62, 27, 91, 63, 49, 48, 48, 48, 108, 27, 91, 63, - 50, 53, 104, 0, 27, 56, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, - 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, 27, 91, 48, 37, 63, 37, - 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, - 52, 37, 59, 37, 63, 37, 112, 49, 37, 112, 51, 37, 124, 37, 116, 59, - 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 109, 37, - 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, - 9, 0, 27, 79, 119, 0, 27, 79, 121, 0, 27, 79, 117, 0, 27, 79, - 113, 0, 27, 79, 115, 0, 96, 96, 97, 97, 102, 102, 103, 103, 106, 106, - 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, - 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, - 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 40, 66, - 27, 41, 48, 0, 27, 91, 56, 126, 0, 27, 79, 77, 0, 27, 91, 49, - 126, 0, 27, 91, 51, 36, 0, 27, 91, 52, 126, 0, 27, 91, 56, 36, - 0, 27, 91, 55, 36, 0, 27, 91, 50, 36, 0, 27, 91, 100, 0, 27, - 91, 54, 36, 0, 27, 91, 53, 36, 0, 27, 91, 99, 0, 27, 91, 50, - 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 50, 53, 126, 0, 27, - 91, 50, 54, 126, 0, 27, 91, 50, 56, 126, 0, 27, 91, 50, 57, 126, - 0, 27, 91, 51, 49, 126, 0, 27, 91, 51, 50, 126, 0, 27, 91, 51, - 51, 126, 0, 27, 91, 51, 52, 126, 0, 27, 91, 50, 51, 36, 0, 27, - 91, 50, 52, 36, 0, 27, 91, 49, 49, 94, 0, 27, 91, 49, 50, 94, - 0, 27, 91, 49, 51, 94, 0, 27, 91, 49, 52, 94, 0, 27, 91, 49, - 53, 94, 0, 27, 91, 49, 55, 94, 0, 27, 91, 49, 56, 94, 0, 27, - 91, 49, 57, 94, 0, 27, 91, 50, 48, 94, 0, 27, 91, 50, 49, 94, - 0, 27, 91, 50, 51, 94, 0, 27, 91, 50, 52, 94, 0, 27, 91, 50, - 53, 94, 0, 27, 91, 50, 54, 94, 0, 27, 91, 50, 56, 94, 0, 27, - 91, 50, 57, 94, 0, 27, 91, 51, 49, 94, 0, 27, 91, 51, 50, 94, - 0, 27, 91, 51, 51, 94, 0, 27, 91, 51, 52, 94, 0, 27, 91, 50, - 51, 64, 0, 27, 91, 50, 52, 64, 0, 27, 91, 49, 75, 0, 27, 91, - 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, - 63, 49, 59, 50, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, 52, - 57, 109, 0, 27, 93, 49, 48, 52, 7, 0, 27, 93, 52, 59, 37, 112, - 49, 37, 100, 59, 114, 103, 98, 58, 37, 112, 50, 37, 123, 50, 53, 53, - 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 50, 46, 50, - 88, 47, 37, 112, 51, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, - 48, 48, 48, 125, 37, 47, 37, 50, 46, 50, 88, 47, 37, 112, 52, 37, - 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, - 37, 50, 46, 50, 88, 27, 92, 0, 27, 91, 77, 0, 27, 91, 37, 63, - 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, - 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, - 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, - 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, - 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, - 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, - 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, - 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 40, 66, 0, 27, - 40, 48, 0 -}; -// Taken from Dickey ncurses terminfo.src dated 2017-04-22. -// This is a 16-colour terminfo description that lacks true-colour -// and 256-colour capabilities that linux (4.8+) actually has. -static const signed char linux_16colour_terminfo[] = { - 26, 1, 43, 0, 29, 0, 16, 0, 125, 1, 125, 3, 108, 105, 110, 117, - 120, 45, 49, 54, 99, 111, 108, 111, 114, 124, 108, 105, 110, 117, 120, 32, - 99, 111, 110, 115, 111, 108, 101, 32, 119, 105, 116, 104, 32, 49, 54, 32, - 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 1, -1, -1, 8, 0, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 16, 0, - 0, 1, 42, 0, -1, -1, 0, 0, 2, 0, 4, 0, 21, 0, 26, 0, - 33, 0, 37, 0, 41, 0, -1, -1, 52, 0, 69, 0, 71, 0, 75, 0, - 87, 0, -1, -1, 89, 0, 101, 0, -1, -1, 105, 0, 109, 0, 121, 0, - 125, 0, -1, -1, -1, -1,-127, 0,-125, 0,-120, 0, -1, -1, -1, -1, --115, 0,-110, 0, -1, -1, -1, -1,-105, 0,-100, 0, -95, 0, -90, 0, - -81, 0, -79, 0, -1, -1, -1, -1, -74, 0, -69, 0, -63, 0, -57, 0, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -39, 0, -35, 0, - -1, -1, -31, 0, -1, -1, -1, -1, -1, -1, -29, 0, -1, -1, -24, 0, - -1, -1, -1, -1, -1, -1, -1, -1, -20, 0, -15, 0, -9, 0, -4, 0, - 1, 1, 6, 1, 11, 1, 17, 1, 23, 1, 29, 1, 35, 1, 40, 1, - -1, -1, 45, 1, -1, -1, 49, 1, 54, 1, 59, 1, -1, -1, -1, -1, - -1, -1, 63, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 67, 1, -1, -1, 70, 1, 79, 1, 88, 1, 97, 1, -1, -1, - 106, 1, 115, 1, 124, 1, -1, -1,-123, 1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1,-114, 1, -1, -1, -1, -1, -1, -1, --108, 1,-105, 1, -94, 1, -91, 1, -89, 1, -86, 1, 1, 2, -1, -1, - 4, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6, 2, - -1, -1, -1, -1, -1, -1, -1, -1, 10, 2, -1, -1, 77, 2, -1, -1, - -1, -1, 81, 2, 87, 2, -1, -1, -1, -1, 93, 2, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 97, 2, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 102, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 104, 2, 110, 2, 116, 2, 122, 2,-128, 2,-122, 2, --116, 2,-110, 2,-104, 2, -98, 2, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -92, 2, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -87, 2, - -76, 2, -71, 2, -65, 2, -61, 2, -52, 2, -48, 2, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, 3, -1, -1, -1, -1, - -1, -1, 37, 3, 75, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 113, 3, 119, 3, 7, 0, - 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, - 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, - 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, - 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, - 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 27, - 91, 63, 49, 99, 0, 8, 0, 27, 91, 63, 50, 53, 104, 27, 91, 63, - 48, 99, 0, 27, 91, 67, 0, 27, 91, 65, 0, 27, 91, 63, 50, 53, - 104, 27, 91, 63, 56, 99, 0, 27, 91, 80, 0, 27, 91, 77, 0, 14, - 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 50, 109, 0, - 27, 91, 52, 104, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, - 91, 52, 109, 0, 27, 91, 37, 112, 49, 37, 100, 88, 0, 15, 0, 27, - 91, 109, 15, 0, 27, 91, 52, 108, 0, 27, 91, 50, 55, 109, 0, 27, - 91, 50, 52, 109, 0, 27, 91, 63, 53, 104, 36, 60, 50, 48, 48, 47, - 62, 27, 91, 63, 53, 108, 0, 27, 91, 64, 0, 27, 91, 76, 0, 127, - 0, 27, 91, 51, 126, 0, 27, 91, 66, 0, 27, 91, 91, 65, 0, 27, - 91, 50, 49, 126, 0, 27, 91, 91, 66, 0, 27, 91, 91, 67, 0, 27, - 91, 91, 68, 0, 27, 91, 91, 69, 0, 27, 91, 49, 55, 126, 0, 27, - 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, - 0, 27, 91, 49, 126, 0, 27, 91, 50, 126, 0, 27, 91, 68, 0, 27, - 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 91, 67, 0, 27, 91, 65, - 0, 13, 10, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, - 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, - 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 76, - 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, - 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 99, 27, 93, - 82, 0, 27, 56, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, - 27, 55, 0, 10, 0, 27, 77, 0, 27, 91, 48, 59, 49, 48, 37, 63, - 37, 112, 49, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 50, 37, 116, - 59, 52, 37, 59, 37, 63, 37, 112, 51, 37, 116, 59, 55, 37, 59, 37, - 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 37, 63, 37, 112, 53, 37, - 116, 59, 50, 37, 59, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, - 109, 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, - 72, 0, 9, 0, 27, 91, 71, 0, 43, 43, 44, 44, 45, 45, 46, 46, - 48, 48, 95, 95, 96, 96, 97, 97, 102, 102, 103, 103, 104, 104, 105, 105, - 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, - 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, - 122, 122, 123, 123, 124, 124, 125, 99, 126, 126, 0, 27, 91, 90, 0, 27, - 91, 63, 55, 104, 0, 27, 91, 63, 55, 108, 0, 27, 41, 48, 0, 27, - 91, 52, 126, 0, 26, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, - 126, 0, 27, 91, 50, 53, 126, 0, 27, 91, 50, 54, 126, 0, 27, 91, - 50, 56, 126, 0, 27, 91, 50, 57, 126, 0, 27, 91, 51, 49, 126, 0, - 27, 91, 51, 50, 126, 0, 27, 91, 51, 51, 126, 0, 27, 91, 51, 52, - 126, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, - 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 54, 99, 0, 27, 91, 99, - 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 93, 82, 0, 27, 93, - 80, 37, 112, 49, 37, 120, 37, 112, 50, 37, 123, 50, 53, 53, 125, 37, - 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 48, 50, 120, 37, 112, - 51, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, - 37, 47, 37, 48, 50, 120, 37, 112, 52, 37, 123, 50, 53, 53, 125, 37, - 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 48, 50, 120, 0, 27, - 91, 77, 0, 27, 91, 51, 37, 112, 49, 37, 123, 56, 125, 37, 109, 37, - 100, 37, 63, 37, 112, 49, 37, 123, 55, 125, 37, 62, 37, 116, 59, 49, - 37, 101, 59, 50, 49, 37, 59, 109, 0, 27, 91, 52, 37, 112, 49, 37, - 123, 56, 125, 37, 109, 37, 100, 37, 63, 37, 112, 49, 37, 123, 55, 125, - 37, 62, 37, 116, 59, 53, 37, 101, 59, 50, 53, 37, 59, 109, 0, 27, - 91, 49, 49, 109, 0, 27, 91, 49, 48, 109, 0 -}; -// Taken from Dickey ncurses terminfo.src dated 2017-04-22. -static const signed char putty_256colour_terminfo[] = { - 26, 1, 48, 0, 29, 0, 16, 0, 125, 1,-106, 4, 112, 117, 116, 116, - 121, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 80, 117, 84, 84, 89, - 32, 48, 46, 53, 56, 32, 119, 105, 116, 104, 32, 120, 116, 101, 114, 109, - 32, 50, 53, 54, 45, 99, 111, 108, 111, 114, 115, 0, 1, 1, 0, 0, - 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, -1, 8, 0, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 0, 1, -1, 127, 22, 0, 0, 0, 4, 0, 6, 0, - 8, 0, 25, 0, 30, 0, 37, 0, 41, 0, 45, 0, -1, -1, 56, 0, - 73, 0, 76, 0, 80, 0, 87, 0, -1, -1, 89, 0, 96, 0, -1, -1, - 100, 0, -1, -1, 103, 0, 107, 0, 111, 0, -1, -1, 117, 0, 119, 0, - 124, 0,-127, 0, -1, -1, -1, -1,-120, 0, -1, -1, -1, -1,-115, 0, --110, 0,-105, 0,-100, 0, -91, 0, -89, 0, -84, 0, -1, -1, -73, 0, - -68, 0, -62, 0, -56, 0, -1, -1, -38, 0, -1, -1, -36, 0, -1, -1, - -1, -1, -1, -1, -2, 0, -1, -1, 2, 1, -1, -1, -1, -1, -1, -1, - 4, 1, -1, -1, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, 13, 1, - 19, 1, 25, 1, 31, 1, 37, 1, 43, 1, 49, 1, 55, 1, 61, 1, - 67, 1, 73, 1, 78, 1, -1, -1, 83, 1, -1, -1, 87, 1, 92, 1, - 97, 1, 101, 1, 105, 1, -1, -1, 109, 1, 113, 1, 121, 1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1,-127, 1, -1, -1,-124, 1,-115, 1, --106, 1, -1, -1, -97, 1, -88, 1, -79, 1, -70, 1, -61, 1, -52, 1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -43, 1, -1, -1, -1, -1, -10, 1, -7, 1, 4, 2, 7, 2, 9, 2, - 12, 2, 84, 2, -1, -1, 87, 2, 89, 2, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 94, 2, -1, -1, -1, -1, -1, -1, -1, -1, 98, 2, - -1, -1,-107, 2, -1, -1, -1, -1,-103, 2, -97, 2, -1, -1, -1, -1, - -91, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -84, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -79, 2, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -77, 2, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -73, 2, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -69, 2, -63, 2, -57, 2, - -51, 2, -45, 2, -39, 2, -33, 2, -27, 2, -21, 2, -15, 2, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -4, 2, 7, 3, 12, 3, 18, 3, 22, 3, 31, 3, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 35, 3, -1, -1, -1, -1, -1, -1, 39, 3, 102, 3, -1, -1, -1, -1, - -1, -1, -90, 3, -84, 3, -78, 3, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -72, 3, --118, 4,-112, 4, 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, 37, 105, - 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, - 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, 74, - 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, - 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 27, 68, 0, - 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, - 50, 53, 104, 0, 27, 91, 67, 0, 27, 77, 0, 27, 91, 80, 0, 27, - 91, 77, 0, 27, 93, 48, 59, 7, 0, 14, 0, 27, 91, 53, 109, 0, - 27, 91, 49, 109, 0, 27, 91, 63, 52, 55, 104, 0, 27, 91, 52, 104, - 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, - 27, 91, 37, 112, 49, 37, 100, 88, 0, 15, 0, 27, 91, 109, 15, 0, - 27, 91, 50, 74, 27, 91, 63, 52, 55, 108, 0, 27, 91, 52, 108, 0, - 27, 91, 50, 55, 109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, - 104, 36, 60, 49, 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 7, 0, - 27, 55, 27, 91, 114, 27, 91, 109, 27, 91, 63, 55, 104, 27, 91, 63, - 49, 59, 52, 59, 54, 108, 27, 91, 52, 108, 27, 56, 27, 62, 27, 93, - 82, 0, 27, 91, 76, 0, 127, 0, 27, 91, 51, 126, 0, 27, 79, 66, - 0, 27, 91, 49, 49, 126, 0, 27, 91, 50, 49, 126, 0, 27, 91, 49, - 50, 126, 0, 27, 91, 49, 51, 126, 0, 27, 91, 49, 52, 126, 0, 27, - 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, - 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 91, 49, - 126, 0, 27, 91, 50, 126, 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, - 27, 91, 53, 126, 0, 27, 79, 67, 0, 27, 91, 66, 0, 27, 91, 65, - 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, 63, - 49, 104, 27, 61, 0, 13, 10, 0, 27, 91, 37, 112, 49, 37, 100, 80, - 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, - 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 83, 0, 27, 91, 37, 112, - 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, - 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 84, 0, - 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 60, 27, 91, 34, 112, 27, - 91, 53, 48, 59, 54, 34, 112, 27, 99, 27, 91, 63, 51, 108, 27, 93, - 82, 27, 91, 63, 49, 48, 48, 48, 108, 0, 27, 56, 0, 27, 91, 37, - 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, - 27, 91, 48, 37, 63, 37, 112, 49, 37, 112, 54, 37, 124, 37, 116, 59, - 49, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, - 37, 112, 49, 37, 112, 51, 37, 124, 37, 116, 59, 55, 37, 59, 37, 63, - 37, 112, 52, 37, 116, 59, 53, 37, 59, 109, 37, 63, 37, 112, 57, 37, - 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, 9, 0, 27, 93, 48, - 59, 0, 27, 91, 71, 0, 96, 96, 97, 97, 102, 102, 103, 103, 106, 106, - 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, - 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, - 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 91, 63, - 55, 104, 0, 27, 91, 63, 55, 108, 0, 27, 40, 66, 27, 41, 48, 0, - 27, 91, 52, 126, 0, 26, 0, 27, 91, 68, 0, 27, 91, 67, 0, 27, - 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 50, 53, 126, - 0, 27, 91, 50, 54, 126, 0, 27, 91, 50, 56, 126, 0, 27, 91, 50, - 57, 126, 0, 27, 91, 51, 49, 126, 0, 27, 91, 51, 50, 126, 0, 27, - 91, 51, 51, 126, 0, 27, 91, 51, 52, 126, 0, 27, 91, 49, 75, 0, - 27, 91, 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, - 27, 91, 63, 54, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, 52, - 57, 109, 0, 27, 93, 82, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, - 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, - 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, - 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, - 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, - 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, - 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, - 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, - 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 49, 48, 109, 0, - 27, 91, 49, 49, 109, 0, 27, 91, 49, 50, 109, 0, 37, 63, 37, 112, - 49, 37, 123, 56, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30,-105,-104, - 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 123, 49, 48, 125, 37, 61, - 37, 116, 27, 37, 37, 71, -30,-105,-103, 27, 37, 37, 64, 37, 101, 37, - 112, 49, 37, 123, 49, 50, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30, --103,-128, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 123, 49, 51, 125, - 37, 61, 37, 116, 27, 37, 37, 71, -30,-103, -86, 27, 37, 37, 64, 37, - 101, 37, 112, 49, 37, 123, 49, 52, 125, 37, 61, 37, 116, 27, 37, 37, - 71, -30,-103, -85, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 123, 49, - 53, 125, 37, 61, 37, 116, 27, 37, 37, 71, -30,-104, -68, 27, 37, 37, - 64, 37, 101, 37, 112, 49, 37, 123, 50, 55, 125, 37, 61, 37, 116, 27, - 37, 37, 71, -30,-122,-112, 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, - 123, 49, 53, 53, 125, 37, 61, 37, 116, 27, 37, 37, 71, -32,-126, -94, - 27, 37, 37, 64, 37, 101, 37, 112, 49, 37, 99, 37, 59, 0, 27, 91, - 49, 49, 109, 0, 27, 91, 49, 48, 109, 0 -}; -// Taken from Dickey ncurses terminfo.src dated 2017-04-22. -static const signed char interix_8colour_terminfo[] = { - 26, 1, 82, 0, 15, 0, 16, 0, 105, 1, 123, 2, 105, 110, 116, 101, - 114, 105, 120, 124, 111, 112, 101, 110, 110, 116, 124, 111, 112, 101, 110, 110, - 116, 45, 50, 53, 124, 110, 116, 99, 111, 110, 115, 111, 108, 101, 124, 110, - 116, 99, 111, 110, 115, 111, 108, 101, 45, 50, 53, 124, 79, 112, 101, 110, - 78, 84, 45, 116, 101, 114, 109, 32, 99, 111, 109, 112, 97, 116, 105, 98, - 108, 101, 32, 119, 105, 116, 104, 32, 99, 111, 108, 111, 114, 0, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 80, 0, - -1, -1, 25, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 8, 0, 64, 0, 3, 0, 0, 0, - 4, 0, -1, -1, -1, -1, -1, -1, 6, 0, 11, 0, 15, 0, -1, -1, - -1, -1, 19, 0, 36, 0, 38, 0, -1, -1, 42, 0, -1, -1, -1, -1, - 46, 0, 50, 0, 54, 0, -1, -1, -1, -1, 58, 0, -1, -1, -1, -1, - -1, -1, -1, -1, 62, 0, 67, 0, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 75, 0, 80, 0, 85, 0, -1, -1, -1, -1, 90, 0, 95, 0, - -1, -1, -1, -1, 107, 0, 111, 0, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 115, 0, -1, -1, 119, 0, -1, -1, - -1, -1, -1, -1, 121, 0, -1, -1, 125, 0, -1, -1, -1, -1, -1, -1, --127, 0,-123, 0,-119, 0,-115, 0,-111, 0,-107, 0,-103, 0, -99, 0, - -95, 0, -91, 0, -87, 0, -1, -1, -83, 0, -1, -1, -79, 0, -75, 0, - -71, 0, -67, 0, -63, 0, -1, -1, -1, -1, -1, -1, -59, 0, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -55, 0, -1, -1, - -1, -1, -52, 0, -43, 0, -1, -1, -34, 0, -25, 0, -16, 0, -7, 0, - 2, 1, 11, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 20, 1, -1, -1, -1, -1, -1, -1, 23, 1, -1, -1, 27, 1, - 31, 1, 35, 1, -1, -1, -1, -1, -1, -1, 39, 1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 41, 1, -1, -1, 104, 1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 108, 1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 112, 1, - 116, 1, 120, 1, 124, 1,-128, 1,-124, 1,-120, 1,-116, 1,-112, 1, --108, 1,-104, 1,-100, 1, -96, 1, -92, 1, -88, 1, -84, 1, -80, 1, - -76, 1, -72, 1, -68, 1, -64, 1, -60, 1, -56, 1, -52, 1, -48, 1, - -44, 1, -40, 1, -36, 1, -32, 1, -28, 1, -24, 1, -20, 1, -16, 1, - -12, 1, -8, 1, -4, 1, 0, 2, 4, 2, 8, 2, 12, 2, 16, 2, - 20, 2, 24, 2, 28, 2, 32, 2, 36, 2, 40, 2, 44, 2, 48, 2, - 52, 2, 56, 2, 60, 2, 64, 2, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 68, 2, -1, -1, -1, -1, -1, -1, -1, -1, 72, 2, 88, 2, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, 2, 113, 2, - 27, 91, 90, 0, 7, 0, 27, 91, 50, 74, 0, 27, 91, 75, 0, 27, - 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, - 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 68, 0, 27, 91, - 67, 0, 27, 91, 85, 0, 27, 91, 65, 0, 27, 91, 77, 0, 27, 91, - 49, 109, 0, 27, 91, 115, 27, 91, 49, 98, 0, 27, 91, 55, 109, 0, - 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, 48, 109, 0, 27, - 91, 50, 98, 27, 91, 117, 13, 27, 91, 75, 0, 27, 91, 109, 0, 27, - 91, 109, 0, 27, 91, 76, 0, 8, 0, 27, 91, 77, 0, 27, 91, 66, - 0, 27, 70, 65, 0, 27, 70, 49, 0, 27, 70, 65, 0, 27, 70, 50, - 0, 27, 70, 51, 0, 27, 70, 52, 0, 27, 70, 53, 0, 27, 70, 54, - 0, 27, 70, 55, 0, 27, 70, 56, 0, 27, 70, 57, 0, 27, 91, 76, - 0, 27, 91, 68, 0, 27, 91, 85, 0, 27, 91, 84, 0, 27, 91, 83, - 0, 27, 91, 67, 0, 27, 91, 65, 0, 13, 10, 0, 27, 91, 37, 112, - 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, - 37, 112, 49, 37, 100, 83, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, - 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, - 67, 0, 27, 91, 37, 112, 49, 37, 100, 84, 0, 27, 91, 37, 112, 49, - 37, 100, 65, 0, 27, 99, 0, 27, 91, 117, 0, 27, 91, 115, 0, 27, - 91, 83, 0, 27, 91, 84, 0, 9, 0, 43, 16, 44, 17, 45, 24, 46, - 25, 48, -37, 96, 4, 97, -79, 102, -8, 103, -15, 104, -80, 106, -39, 107, - -65, 108, -38, 109, -64, 110, -59, 111, 126, 112, -60, 113, -60, 114, -60, 115, - 95, 116, -61, 117, -76, 118, -63, 119, -62, 120, -77, 121, -13, 122, -14, 123, - -29, 124, -40, 125,-100, 126, -2, 0, 27, 91, 90, 0, 27, 91, 85, 0, - 27, 70, 66, 0, 27, 70, 67, 0, 27, 70, 68, 0, 27, 70, 69, 0, - 27, 70, 70, 0, 27, 70, 71, 0, 27, 70, 72, 0, 27, 70, 73, 0, - 27, 70, 74, 0, 27, 70, 75, 0, 27, 70, 76, 0, 27, 70, 77, 0, - 27, 70, 78, 0, 27, 70, 79, 0, 27, 70, 80, 0, 27, 70, 81, 0, - 27, 70, 82, 0, 27, 70, 83, 0, 27, 70, 84, 0, 27, 70, 85, 0, - 27, 70, 86, 0, 27, 70, 87, 0, 27, 70, 88, 0, 27, 70, 89, 0, - 27, 70, 90, 0, 27, 70, 97, 0, 27, 70, 98, 0, 27, 70, 99, 0, - 27, 70, 100, 0, 27, 70, 101, 0, 27, 70, 102, 0, 27, 70, 103, 0, - 27, 70, 104, 0, 27, 70, 105, 0, 27, 70, 106, 0, 27, 70, 107, 0, - 27, 70, 109, 0, 27, 70, 110, 0, 27, 70, 111, 0, 27, 70, 112, 0, - 27, 70, 113, 0, 27, 70, 114, 0, 27, 70, 115, 0, 27, 70, 116, 0, - 27, 70, 117, 0, 27, 70, 118, 0, 27, 70, 119, 0, 27, 70, 120, 0, - 27, 70, 121, 0, 27, 70, 122, 0, 27, 70, 43, 0, 27, 70, 45, 0, - 27, 70, 12, 0, 27, 91, 109, 0, 27, 91, 37, 112, 49, 37, 123, 51, - 48, 125, 37, 43, 37, 100, 109, 0, 27, 91, 37, 112, 49, 37, 39, 40, - 39, 37, 43, 37, 100, 109, 0, 27, 91, 51, 37, 112, 49, 37, 100, 109, - 0, 27, 91, 52, 37, 112, 49, 37, 100, 109, 0 -}; -// Taken from Dickey ncurses terminfo.src dated 2017-04-22. -// This is a 256-colour terminfo description that lacks true-colour -// capabilities that stterm actually has. -static const signed char st_256colour_terminfo[] = { - 26, 1, 55, 0, 29, 0, 15, 0, 105, 1, 117, 5, 115, 116, 45, 50, - 53, 54, 99, 111, 108, 111, 114, 124, 115, 116, 116, 101, 114, 109, 45, 50, - 53, 54, 99, 111, 108, 111, 114, 124, 115, 105, 109, 112, 108, 101, 116, 101, - 114, 109, 32, 119, 105, 116, 104, 32, 50, 53, 54, 32, 99, 111, 108, 111, - 114, 115, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, - 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, 0, 0, - 4, 0, 6, 0, 8, 0, 25, 0, 30, 0, 38, 0, 42, 0, 46, 0, - -1, -1, 57, 0, 74, 0, 76, 0, 80, 0, 87, 0, -1, -1, 89, 0, - 102, 0, -1, -1, 106, 0, 110, 0, 117, 0, 121, 0, -1, -1, -1, -1, - 125, 0,-127, 0,-122, 0,-117, 0, -1, -1, -1, -1,-108, 0,-103, 0, - -1, -1, -98, 0, -93, 0, -88, 0, -83, 0, -74, 0, -70, 0, -65, 0, - -1, -1, -56, 0, -51, 0, -45, 0, -39, 0, -1, -1, -21, 0, -1, -1, - -19, 0, -1, -1, -1, -1, -1, -1, -4, 0, -1, -1, 0, 1, -1, -1, - 2, 1, -1, -1, 9, 1, 14, 1, 21, 1, 25, 1, 32, 1, 39, 1, - -1, -1, 46, 1, 50, 1, 56, 1, 60, 1, 64, 1, 68, 1, 74, 1, - 80, 1, 86, 1, 92, 1, 98, 1, 103, 1, 108, 1, 115, 1, -1, -1, - 119, 1, 124, 1,-127, 1,-123, 1,-116, 1, -1, -1,-109, 1,-105, 1, - -97, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -89, 1, -80, 1, -71, 1, -62, 1, -53, 1, -44, 1, -35, 1, -26, 1, - -1, -1, -17, 1, -1, -1, -1, -1, -1, -1, -8, 1, -4, 1, 1, 2, - -1, -1, 6, 2, 9, 2, -1, -1, -1, -1, 24, 2, 27, 2, 38, 2, - 41, 2, 43, 2, 46, 2,-128, 2, -1, -1,-125, 2,-123, 2, -1, -1, - -1, -1, -1, -1,-118, 2,-113, 2,-108, 2,-104, 2, -99, 2, -1, -1, - -1, -1, -94, 2, -1, -1, -29, 2, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -25, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -21, 2, -16, 2, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -12, 2, -1, -1, - -1, -1, -5, 2, -1, -1, -1, -1, -1, -1, -1, -1, 2, 3, 9, 3, - 16, 3, -1, -1, -1, -1, 23, 3, -1, -1, 30, 3, -1, -1, -1, -1, - -1, -1, 37, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 44, 3, - 50, 3, 56, 3, 63, 3, 70, 3, 77, 3, 84, 3, 92, 3, 100, 3, - 108, 3, 116, 3, 124, 3,-124, 3,-116, 3,-108, 3,-101, 3, -94, 3, - -87, 3, -80, 3, -72, 3, -64, 3, -56, 3, -48, 3, -40, 3, -32, 3, - -24, 3, -16, 3, -9, 3, -2, 3, 5, 4, 12, 4, 20, 4, 28, 4, - 36, 4, 44, 4, 52, 4, 60, 4, 68, 4, 76, 4, 83, 4, 90, 4, - 97, 4, 104, 4, 112, 4, 120, 4,-128, 4,-120, 4,-112, 4,-104, 4, - -96, 4, -88, 4, -81, 4, -74, 4, -67, 4, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -62, 4, -51, 4, -46, 4, -38, 4, - -34, 4, -2, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -25, 4, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -20, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -14, 4, -1, -1, -1, -1, -1, -1, -10, 4, 53, 5, - 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, - 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, - 72, 27, 91, 50, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, - 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, - 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, - 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, 49, 50, 108, 27, - 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, 27, 91, 65, 0, 27, 91, - 63, 50, 53, 104, 0, 27, 91, 80, 0, 27, 91, 77, 0, 27, 40, 48, - 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 63, 49, 48, - 52, 57, 104, 0, 27, 91, 52, 104, 0, 27, 91, 56, 109, 0, 27, 91, - 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, 37, - 112, 49, 37, 100, 88, 0, 27, 40, 66, 0, 27, 91, 48, 109, 0, 27, - 91, 63, 49, 48, 52, 57, 108, 0, 27, 91, 52, 108, 0, 27, 91, 50, - 55, 109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, 104, 36, 60, - 49, 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 7, 0, 27, 91, 52, - 108, 27, 62, 27, 91, 63, 49, 48, 51, 52, 108, 0, 27, 91, 76, 0, - 127, 0, 27, 91, 51, 59, 53, 126, 0, 27, 91, 51, 126, 0, 27, 91, - 51, 59, 50, 126, 0, 27, 79, 66, 0, 27, 91, 50, 59, 50, 126, 0, - 27, 91, 49, 59, 50, 70, 0, 27, 91, 49, 59, 53, 70, 0, 27, 79, - 80, 0, 27, 91, 50, 49, 126, 0, 27, 79, 81, 0, 27, 79, 82, 0, - 27, 79, 83, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, - 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, - 126, 0, 27, 91, 49, 126, 0, 27, 91, 50, 126, 0, 27, 91, 50, 59, - 53, 126, 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, - 0, 27, 79, 67, 0, 27, 91, 49, 59, 50, 66, 0, 27, 91, 49, 59, - 50, 65, 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, - 91, 63, 49, 104, 27, 61, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, - 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, - 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, - 37, 100, 83, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, - 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, - 91, 37, 112, 49, 37, 100, 65, 0, 27, 91, 105, 0, 27, 91, 52, 105, - 0, 27, 91, 53, 105, 0, 27, 99, 0, 27, 91, 52, 108, 27, 62, 27, - 91, 63, 49, 48, 51, 52, 108, 0, 27, 56, 0, 27, 91, 37, 105, 37, - 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, 0, 27, 77, 0, 37, 63, - 37, 112, 57, 37, 116, 27, 40, 48, 37, 101, 27, 40, 66, 37, 59, 27, - 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, - 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 49, 37, 112, 51, - 37, 124, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, - 53, 37, 59, 37, 63, 37, 112, 55, 37, 116, 59, 56, 37, 59, 109, 0, - 27, 72, 0, 9, 0, 27, 93, 48, 59, 0, 27, 91, 49, 126, 0, 27, - 91, 53, 126, 0, 27, 79, 117, 0, 27, 91, 52, 126, 0, 27, 91, 54, - 126, 0, 43, 67, 44, 68, 45, 65, 46, 66, 48, 69, 96, 96, 97, 97, - 102, 102, 103, 103, 104, 70, 105, 71, 106, 106, 107, 107, 108, 108, 109, 109, - 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, - 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, - 126, 126, 0, 27, 91, 90, 0, 27, 41, 48, 0, 27, 91, 52, 126, 0, - 27, 79, 77, 0, 27, 91, 51, 59, 50, 126, 0, 27, 91, 49, 59, 50, - 70, 0, 27, 91, 49, 59, 50, 72, 0, 27, 91, 50, 59, 50, 126, 0, - 27, 91, 49, 59, 50, 68, 0, 27, 91, 54, 59, 50, 126, 0, 27, 91, - 53, 59, 50, 126, 0, 27, 91, 49, 59, 50, 67, 0, 27, 91, 50, 51, - 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 49, 59, 50, 80, 0, 27, - 91, 49, 59, 50, 81, 0, 27, 91, 49, 59, 50, 82, 0, 27, 91, 49, - 59, 50, 83, 0, 27, 91, 49, 53, 59, 50, 126, 0, 27, 91, 49, 55, - 59, 50, 126, 0, 27, 91, 49, 56, 59, 50, 126, 0, 27, 91, 49, 57, - 59, 50, 126, 0, 27, 91, 50, 48, 59, 50, 126, 0, 27, 91, 50, 49, - 59, 50, 126, 0, 27, 91, 50, 51, 59, 50, 126, 0, 27, 91, 50, 52, - 59, 50, 126, 0, 27, 91, 49, 59, 53, 80, 0, 27, 91, 49, 59, 53, - 81, 0, 27, 91, 49, 59, 53, 82, 0, 27, 91, 49, 59, 53, 83, 0, - 27, 91, 49, 53, 59, 53, 126, 0, 27, 91, 49, 55, 59, 53, 126, 0, - 27, 91, 49, 56, 59, 53, 126, 0, 27, 91, 49, 57, 59, 53, 126, 0, - 27, 91, 50, 48, 59, 53, 126, 0, 27, 91, 50, 49, 59, 53, 126, 0, - 27, 91, 50, 51, 59, 53, 126, 0, 27, 91, 50, 52, 59, 53, 126, 0, - 27, 91, 49, 59, 54, 80, 0, 27, 91, 49, 59, 54, 81, 0, 27, 91, - 49, 59, 54, 82, 0, 27, 91, 49, 59, 54, 83, 0, 27, 91, 49, 53, - 59, 54, 126, 0, 27, 91, 49, 55, 59, 54, 126, 0, 27, 91, 49, 56, - 59, 54, 126, 0, 27, 91, 49, 57, 59, 54, 126, 0, 27, 91, 50, 48, - 59, 54, 126, 0, 27, 91, 50, 49, 59, 54, 126, 0, 27, 91, 50, 51, - 59, 54, 126, 0, 27, 91, 50, 52, 59, 54, 126, 0, 27, 91, 49, 59, - 51, 80, 0, 27, 91, 49, 59, 51, 81, 0, 27, 91, 49, 59, 51, 82, - 0, 27, 91, 49, 59, 51, 83, 0, 27, 91, 49, 53, 59, 51, 126, 0, - 27, 91, 49, 55, 59, 51, 126, 0, 27, 91, 49, 56, 59, 51, 126, 0, - 27, 91, 49, 57, 59, 51, 126, 0, 27, 91, 50, 48, 59, 51, 126, 0, - 27, 91, 50, 49, 59, 51, 126, 0, 27, 91, 50, 51, 59, 51, 126, 0, - 27, 91, 50, 52, 59, 51, 126, 0, 27, 91, 49, 59, 52, 80, 0, 27, - 91, 49, 59, 52, 81, 0, 27, 91, 49, 59, 52, 82, 0, 27, 91, 49, - 75, 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, 91, 54, - 110, 0, 27, 91, 63, 49, 59, 50, 99, 0, 27, 91, 99, 0, 27, 91, - 51, 57, 59, 52, 57, 109, 0, 27, 91, 51, 109, 0, 27, 91, 50, 51, - 109, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, - 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, - 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, - 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, 49, 37, - 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, - 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, - 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, - 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, - 100, 37, 59, 109, 0 -}; -// Taken from Dickey ncurses terminfo.src dated 2017-04-22. -// This is a 256-colour terminfo description that lacks true-colour -// capabilities that gnome actually has. -static const signed char vte_256colour_terminfo[] = { - 26, 1, 52, 0, 29, 0, 15, 0, 105, 1, -55, 5, 103, 110, 111, 109, - 101, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 71, 78, 79, 77, 69, - 32, 84, 101, 114, 109, 105, 110, 97, 108, 32, 119, 105, 116, 104, 32, 120, - 116, 101, 114, 109, 32, 50, 53, 54, 45, 99, 111, 108, 111, 114, 115, 0, - 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 80, 0, - 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, 0, 0, 4, 0, - 6, 0, 8, 0, 25, 0, 30, 0, 38, 0, 42, 0, 46, 0, -1, -1, - 57, 0, 74, 0, 76, 0, 80, 0, 87, 0, -1, -1, 89, 0, 96, 0, - -1, -1, 100, 0, -1, -1, 104, 0, 108, 0, -1, -1, -1, -1, 112, 0, - -1, -1, 114, 0, 119, 0, -1, -1, -128, 0, -123, 0, -118, 0, -1, -1, --113, 0, -108, 0, -103, 0, -98, 0, -89, 0, -87, 0, -81, 0, -1, -1, - -68, 0, -63, 0, -57, 0, -51, 0, -1, -1, -1, -1, -1, -1, -33, 0, - -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, 4, 1, -1, -1, -1, -1, - -1, -1, 6, 1, -1, -1, 11, 1, -1, -1, -1, -1, -1, -1, -1, -1, - 15, 1, 19, 1, 25, 1, 29, 1, 33, 1, 37, 1, 43, 1, 49, 1, - 55, 1, 61, 1, 67, 1, 71, 1, -1, -1, 76, 1, -1, -1, 80, 1, - 85, 1, 90, 1, 94, 1, 101, 1, -1, -1, 108, 1, 112, 1, 120, 1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -128, 1, --119, 1, -110, 1, -101, 1, -92, 1, -83, 1, -74, 1, -65, 1, -56, 1, - -47, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -38, 1, -35, 1, -1, -1, -1, -1, 16, 2, 19, 2, 30, 2, 33, 2, - 35, 2, 38, 2, 116, 2, -1, -1, 119, 2, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 121, 2, -1, -1, -1, -1, -1, -1, -1, -1, - 125, 2, -1, -1, -78, 2, -1, -1, -1, -1, -74, 2, -68, 2, -1, -1, - -1, -1, -62, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -58, 2, -54, 2, -1, -1, -50, 2, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -45, 2, -1, -1, -38, 2, - -33, 2, -1, -1, -1, -1, -1, -1, -1, -1, -26, 2, -19, 2, -12, 2, - -1, -1, -1, -1, -5, 2, -1, -1, 2, 3, -1, -1, -1, -1, -1, -1, - 9, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 16, 3, 22, 3, - 28, 3, 35, 3, 42, 3, 49, 3, 56, 3, 64, 3, 72, 3, 80, 3, - 88, 3, 96, 3, 104, 3, 112, 3, 120, 3, 127, 3, -122, 3, -115, 3, --108, 3, -100, 3, -92, 3, -84, 3, -76, 3, -68, 3, -60, 3, -52, 3, - -44, 3, -37, 3, -30, 3, -23, 3, -16, 3, -8, 3, 0, 4, 8, 4, - 16, 4, 24, 4, 32, 4, 40, 4, 48, 4, 55, 4, 62, 4, 69, 4, - 76, 4, 84, 4, 92, 4, 100, 4, 108, 4, 116, 4, 124, 4, -124, 4, --116, 4, -109, 4, -102, 4, -95, 4, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -90, 4, -79, 4, -74, 4, -55, 4, -51, 4, - -42, 4, -35, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, 5, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 64, 5, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 70, 5, -1, -1, -1, -1, -1, -1, 74, 5, -119, 5, 27, 91, - 90, 0, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, - 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, - 91, 50, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, - 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, - 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, - 63, 50, 53, 108, 0, 8, 0, 27, 91, 63, 50, 53, 104, 0, 27, 91, - 67, 0, 27, 91, 65, 0, 27, 91, 80, 0, 27, 91, 77, 0, 14, 0, - 27, 91, 49, 109, 0, 27, 55, 27, 91, 63, 52, 55, 104, 0, 27, 91, - 50, 109, 0, 27, 91, 52, 104, 0, 27, 91, 56, 109, 0, 27, 91, 55, - 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, 37, 112, - 49, 37, 100, 88, 0, 15, 0, 27, 91, 48, 109, 15, 0, 27, 91, 50, - 74, 27, 91, 63, 52, 55, 108, 27, 56, 0, 27, 91, 52, 108, 0, 27, - 91, 50, 55, 109, 0, 27, 91, 50, 52, 109, 0, 27, 91, 63, 53, 104, - 36, 60, 49, 48, 48, 47, 62, 27, 91, 63, 53, 108, 0, 27, 91, 109, - 27, 91, 63, 55, 104, 27, 91, 52, 108, 27, 62, 27, 55, 27, 91, 114, - 27, 91, 63, 49, 59, 51, 59, 52, 59, 54, 108, 27, 56, 0, 27, 91, - 76, 0, 127, 0, 27, 91, 51, 126, 0, 27, 79, 66, 0, 27, 79, 80, - 0, 27, 91, 50, 49, 126, 0, 27, 79, 81, 0, 27, 79, 82, 0, 27, - 79, 83, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, - 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, - 0, 27, 79, 72, 0, 27, 91, 50, 126, 0, 27, 79, 68, 0, 27, 91, - 54, 126, 0, 27, 91, 53, 126, 0, 27, 79, 67, 0, 27, 91, 49, 59, - 50, 66, 0, 27, 91, 49, 59, 50, 65, 0, 27, 79, 65, 0, 27, 91, - 63, 49, 108, 27, 62, 0, 27, 91, 63, 49, 104, 27, 61, 0, 27, 91, - 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, - 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, - 64, 0, 27, 91, 37, 112, 49, 37, 100, 83, 0, 27, 91, 37, 112, 49, - 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, - 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 84, 0, 27, - 91, 37, 112, 49, 37, 100, 65, 0, 27, 99, 0, 27, 55, 27, 91, 114, - 27, 56, 27, 91, 109, 27, 91, 63, 55, 104, 27, 91, 33, 112, 27, 91, - 63, 49, 59, 51, 59, 52, 59, 54, 108, 27, 91, 52, 108, 27, 62, 27, - 91, 63, 49, 48, 48, 48, 108, 27, 91, 63, 50, 53, 104, 0, 27, 56, - 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 100, 0, 27, 55, 0, 10, - 0, 27, 77, 0, 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, - 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, - 112, 53, 37, 116, 59, 50, 37, 59, 37, 63, 37, 112, 55, 37, 116, 59, - 56, 37, 59, 37, 63, 37, 112, 49, 37, 112, 51, 37, 124, 37, 116, 59, - 55, 37, 59, 109, 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, - 59, 0, 27, 72, 0, 9, 0, 27, 91, 69, 0, 96, 96, 97, 97, 102, - 102, 103, 103, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, - 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, - 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, - 27, 91, 90, 0, 27, 91, 63, 55, 104, 0, 27, 91, 63, 55, 108, 0, - 27, 41, 48, 0, 27, 79, 70, 0, 27, 79, 77, 0, 27, 91, 49, 126, - 0, 27, 91, 51, 59, 50, 126, 0, 27, 91, 52, 126, 0, 27, 91, 49, - 59, 50, 70, 0, 27, 91, 49, 59, 50, 72, 0, 27, 91, 50, 59, 50, - 126, 0, 27, 91, 49, 59, 50, 68, 0, 27, 91, 54, 59, 50, 126, 0, - 27, 91, 53, 59, 50, 126, 0, 27, 91, 49, 59, 50, 67, 0, 27, 91, - 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 49, 59, 50, 80, - 0, 27, 91, 49, 59, 50, 81, 0, 27, 91, 49, 59, 50, 82, 0, 27, - 91, 49, 59, 50, 83, 0, 27, 91, 49, 53, 59, 50, 126, 0, 27, 91, - 49, 55, 59, 50, 126, 0, 27, 91, 49, 56, 59, 50, 126, 0, 27, 91, - 49, 57, 59, 50, 126, 0, 27, 91, 50, 48, 59, 50, 126, 0, 27, 91, - 50, 49, 59, 50, 126, 0, 27, 91, 50, 51, 59, 50, 126, 0, 27, 91, - 50, 52, 59, 50, 126, 0, 27, 91, 49, 59, 53, 80, 0, 27, 91, 49, - 59, 53, 81, 0, 27, 91, 49, 59, 53, 82, 0, 27, 91, 49, 59, 53, - 83, 0, 27, 91, 49, 53, 59, 53, 126, 0, 27, 91, 49, 55, 59, 53, - 126, 0, 27, 91, 49, 56, 59, 53, 126, 0, 27, 91, 49, 57, 59, 53, - 126, 0, 27, 91, 50, 48, 59, 53, 126, 0, 27, 91, 50, 49, 59, 53, - 126, 0, 27, 91, 50, 51, 59, 53, 126, 0, 27, 91, 50, 52, 59, 53, - 126, 0, 27, 91, 49, 59, 54, 80, 0, 27, 91, 49, 59, 54, 81, 0, - 27, 91, 49, 59, 54, 82, 0, 27, 91, 49, 59, 54, 83, 0, 27, 91, - 49, 53, 59, 54, 126, 0, 27, 91, 49, 55, 59, 54, 126, 0, 27, 91, - 49, 56, 59, 54, 126, 0, 27, 91, 49, 57, 59, 54, 126, 0, 27, 91, - 50, 48, 59, 54, 126, 0, 27, 91, 50, 49, 59, 54, 126, 0, 27, 91, - 50, 51, 59, 54, 126, 0, 27, 91, 50, 52, 59, 54, 126, 0, 27, 91, - 49, 59, 51, 80, 0, 27, 91, 49, 59, 51, 81, 0, 27, 91, 49, 59, - 51, 82, 0, 27, 91, 49, 59, 51, 83, 0, 27, 91, 49, 53, 59, 51, - 126, 0, 27, 91, 49, 55, 59, 51, 126, 0, 27, 91, 49, 56, 59, 51, - 126, 0, 27, 91, 49, 57, 59, 51, 126, 0, 27, 91, 50, 48, 59, 51, - 126, 0, 27, 91, 50, 49, 59, 51, 126, 0, 27, 91, 50, 51, 59, 51, - 126, 0, 27, 91, 50, 52, 59, 51, 126, 0, 27, 91, 49, 59, 52, 80, - 0, 27, 91, 49, 59, 52, 81, 0, 27, 91, 49, 59, 52, 82, 0, 27, - 91, 49, 75, 0, 27, 91, 37, 105, 37, 100, 59, 37, 100, 82, 0, 27, - 91, 54, 110, 0, 27, 91, 63, 37, 91, 59, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 93, 99, 0, 27, 91, 99, 0, 27, 91, 51, 57, 59, - 52, 57, 109, 0, 27, 93, 49, 48, 52, 7, 0, 27, 93, 52, 59, 37, - 112, 49, 37, 100, 59, 114, 103, 98, 58, 37, 112, 50, 37, 123, 50, 53, - 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, 47, 37, 50, 46, - 50, 88, 47, 37, 112, 51, 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, - 49, 48, 48, 48, 125, 37, 47, 37, 50, 46, 50, 88, 47, 37, 112, 52, - 37, 123, 50, 53, 53, 125, 37, 42, 37, 123, 49, 48, 48, 48, 125, 37, - 47, 37, 50, 46, 50, 88, 27, 92, 0, 27, 91, 51, 109, 0, 27, 91, - 50, 51, 109, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, - 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, - 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, 112, 49, 37, - 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, - 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, - 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, - 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, - 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, - 49, 37, 100, 37, 59, 109, 0 -}; -// Taken from Dickey ncurses terminfo.src dated 2017-04-22. -static const signed char ansi_terminfo[] = { - 26, 1, 40, 0, 23, 0, 16, 0, 125, 1, 68, 2, 97, 110, 115, 105, - 124, 97, 110, 115, 105, 47, 112, 99, 45, 116, 101, 114, 109, 32, 99, 111, - 109, 112, 97, 116, 105, 98, 108, 101, 32, 119, 105, 116, 104, 32, 99, 111, - 108, 111, 114, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 80, 0, 8, 0, - 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 8, 0, 64, 0, 3, 0, 0, 0, 4, 0, - 6, 0, -1, -1, 8, 0, 13, 0, 20, 0, 24, 0, 28, 0, -1, -1, - 39, 0, 56, 0, 60, 0, -1, -1, 64, 0, -1, -1, -1, -1, 68, 0, - -1, -1, 72, 0, -1, -1, 76, 0, 80, 0, -1, -1, -1, -1, 84, 0, - 90, 0, 95, 0, -1, -1, -1, -1, -1, -1, -1, -1, 100, 0, -1, -1, - 105, 0, 110, 0, 115, 0, 120, 0,-127, 0,-121, 0, -1, -1, -1, -1, - -1, -1,-113, 0,-109, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1,-105, 0, -1, -1,-101, 0, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -99, 0, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -95, 0, -91, 0, -1, -1, -87, 0, -1, -1, -1, -1, - -1, -1, -83, 0, -1, -1, -1, -1, -1, -1, -79, 0, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -75, 0, -1, -1, -70, 0, - -61, 0, -52, 0, -43, 0, -34, 0, -25, 0, -16, 0, -7, 0, 2, 1, - 11, 1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 1, 25, 1, 30, 1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 1, -1, -1, 61, 1, - -1, -1, 63, 1,-107, 1, -1, -1,-104, 1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, --100, 1, -1, -1, -37, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -33, 1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -28, 1, -17, 1, -12, 1, 7, 2, 11, 2, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 2, 30, 2, -1, -1, - -1, -1, -1, -1, 40, 2, 44, 2, 48, 2, 52, 2, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 56, 2, 62, 2, 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, - 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, - 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 71, 0, 27, 91, 37, - 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 27, 91, - 66, 0, 27, 91, 72, 0, 27, 91, 68, 0, 27, 91, 67, 0, 27, 91, - 65, 0, 27, 91, 80, 0, 27, 91, 77, 0, 27, 91, 49, 49, 109, 0, - 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 56, 109, 0, 27, - 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 27, 91, - 37, 112, 49, 37, 100, 88, 0, 27, 91, 49, 48, 109, 0, 27, 91, 48, - 59, 49, 48, 109, 0, 27, 91, 109, 0, 27, 91, 109, 0, 27, 91, 76, - 0, 8, 0, 27, 91, 66, 0, 27, 91, 72, 0, 27, 91, 76, 0, 27, - 91, 68, 0, 27, 91, 67, 0, 27, 91, 65, 0, 13, 27, 91, 83, 0, - 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, - 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, - 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 83, 0, 27, 91, 37, - 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, - 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 84, - 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 91, 52, 105, 0, 27, - 91, 53, 105, 0, 37, 112, 49, 37, 99, 27, 91, 37, 112, 50, 37, 123, - 49, 125, 37, 45, 37, 100, 98, 0, 27, 91, 37, 105, 37, 112, 49, 37, - 100, 100, 0, 10, 0, 27, 91, 48, 59, 49, 48, 37, 63, 37, 112, 49, - 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, - 59, 37, 63, 37, 112, 51, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, - 52, 37, 116, 59, 53, 37, 59, 37, 63, 37, 112, 54, 37, 116, 59, 49, - 37, 59, 37, 63, 37, 112, 55, 37, 116, 59, 56, 37, 59, 37, 63, 37, - 112, 57, 37, 116, 59, 49, 49, 37, 59, 109, 0, 27, 72, 0, 27, 91, - 73, 0, 43, 16, 44, 17, 45, 24, 46, 25, 48, -37, 96, 4, 97, -79, - 102, -8, 103, -15, 104, -80, 106, -39, 107, -65, 108, -38, 109, -64, 110, -59, - 111, 126, 112, -60, 113, -60, 114, -60, 115, 95, 116, -61, 117, -76, 118, -63, - 119, -62, 120, -77, 121, -13, 122, -14, 123, -29, 124, -40, 125,-100, 126, -2, - 0, 27, 91, 90, 0, 27, 91, 49, 75, 0, 27, 91, 37, 105, 37, 100, - 59, 37, 100, 82, 0, 27, 91, 54, 110, 0, 27, 91, 63, 37, 91, 59, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 93, 99, 0, 27, 91, 99, - 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 91, 51, 37, 112, 49, - 37, 100, 109, 0, 27, 91, 52, 37, 112, 49, 37, 100, 109, 0, 27, 40, - 66, 0, 27, 41, 66, 0, 27, 42, 66, 0, 27, 43, 66, 0, 27, 91, - 49, 49, 109, 0, 27, 91, 49, 48, 109, 0 -}; - -/// Load one of the built-in terminfo entries when unibilium has failed to -/// load a terminfo record from an external database, as it does on termcap- -/// -only systems. We do not do any fancy recognition of xterm pretenders -/// here. An external terminfo database would not do that, and we want to -/// behave as much like an external terminfo database as possible. -static unibi_term *load_builtin_terminfo(const char * term) -{ - if (TERMINAL_FAMILY(term, "xterm")) { - return unibi_from_mem((const char *)xterm_256colour_terminfo, sizeof xterm_256colour_terminfo); - } else if (TERMINAL_FAMILY(term, "screen")) { - return unibi_from_mem((const char *)screen_256colour_terminfo, sizeof screen_256colour_terminfo); - } else if (TERMINAL_FAMILY(term, "tmux")) { - return unibi_from_mem((const char *)tmux_256colour_terminfo, sizeof tmux_256colour_terminfo); - } else if (TERMINAL_FAMILY(term, "rxvt")) { - return unibi_from_mem((const char *)rxvt_256colour_terminfo, sizeof rxvt_256colour_terminfo); - } else if (TERMINAL_FAMILY(term, "putty")) { - return unibi_from_mem((const char *)putty_256colour_terminfo, sizeof putty_256colour_terminfo); - } else if (TERMINAL_FAMILY(term, "linux")) { - return unibi_from_mem((const char *)linux_16colour_terminfo, sizeof linux_16colour_terminfo); - } else if (TERMINAL_FAMILY(term, "interix")) { - return unibi_from_mem((const char *)interix_8colour_terminfo, sizeof interix_8colour_terminfo); - } else if (TERMINAL_FAMILY(term, "iterm") || TERMINAL_FAMILY(term, "iTerm.app")) { - return unibi_from_mem((const char *)iterm_256colour_terminfo, sizeof iterm_256colour_terminfo); - } else if (TERMINAL_FAMILY(term, "st")) { - return unibi_from_mem((const char *)st_256colour_terminfo, sizeof st_256colour_terminfo); - } else if (TERMINAL_FAMILY(term, "gnome") || TERMINAL_FAMILY(term, "vte")) { - return unibi_from_mem((const char *)vte_256colour_terminfo, sizeof vte_256colour_terminfo); - } else { - return unibi_from_mem((const char *)ansi_terminfo, sizeof ansi_terminfo); - } -} - /// Several entries in terminfo are known to be deficient or outright wrong, /// unfortunately; and several terminal emulators falsely announce incorrect /// terminal types. So patch the terminfo records after loading from an @@ -2559,15 +1215,15 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, { unibi_term *ut = data->ut; const char * xterm_version = os_getenv("XTERM_VERSION"); - bool xterm = TERMINAL_FAMILY(term, "xterm"); - bool linuxvt = TERMINAL_FAMILY(term, "linux"); - bool rxvt = TERMINAL_FAMILY(term, "rxvt"); - bool teraterm = TERMINAL_FAMILY(term, "teraterm"); - bool putty = TERMINAL_FAMILY(term, "putty"); - bool screen = TERMINAL_FAMILY(term, "screen"); - bool st = TERMINAL_FAMILY(term, "st"); - bool gnome = TERMINAL_FAMILY(term, "gnome") || TERMINAL_FAMILY(term, "vte"); - bool iterm = TERMINAL_FAMILY(term, "iterm") || TERMINAL_FAMILY(term, "iTerm.app"); + bool xterm = terminfo_is_term_family(term, "xterm"); + bool linuxvt = terminfo_is_term_family(term, "linux"); + bool rxvt = terminfo_is_term_family(term, "rxvt"); + bool teraterm = terminfo_is_term_family(term, "teraterm"); + bool putty = terminfo_is_term_family(term, "putty"); + bool screen = terminfo_is_term_family(term, "screen"); + bool st = terminfo_is_term_family(term, "st"); + bool gnome = terminfo_is_term_family(term, "gnome") || terminfo_is_term_family(term, "vte"); + bool iterm = terminfo_is_term_family(term, "iterm") || terminfo_is_term_family(term, "iTerm.app"); // None of the following work over SSH; see :help TERM . bool iterm_pretending_xterm = xterm && iterm_env; bool gnome_pretending_xterm = xterm && colorterm && strstr(colorterm, "gnome-terminal"); @@ -2621,10 +1277,10 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, // per the screen manual; 2017-04 terminfo.src lacks these. unibi_set_if_empty(ut, unibi_to_status_line, "\x1b_"); unibi_set_if_empty(ut, unibi_from_status_line, "\x1b\\"); - } else if (TERMINAL_FAMILY(term, "tmux")) { + } else if (terminfo_is_term_family(term, "tmux")) { unibi_set_if_empty(ut, unibi_to_status_line, "\x1b_"); unibi_set_if_empty(ut, unibi_from_status_line, "\x1b\\"); - } else if (TERMINAL_FAMILY(term, "interix")) { + } else if (terminfo_is_term_family(term, "interix")) { unibi_set_if_empty(ut, unibi_carriage_return, "\x0d"); } else if (linuxvt) { // No bugs in the vanilla terminfo for our purposes. @@ -2779,15 +1435,15 @@ static void augment_terminfo(TUIData *data, const char *term, { unibi_term *ut = data->ut; const char * xterm_version = os_getenv("XTERM_VERSION"); - bool xterm = TERMINAL_FAMILY(term, "xterm"); - bool dtterm = TERMINAL_FAMILY(term, "dtterm"); - bool linuxvt = TERMINAL_FAMILY(term, "linux"); - bool rxvt = TERMINAL_FAMILY(term, "rxvt"); - bool teraterm = TERMINAL_FAMILY(term, "teraterm"); - bool putty = TERMINAL_FAMILY(term, "putty"); - bool screen = TERMINAL_FAMILY(term, "screen"); - bool st = TERMINAL_FAMILY(term, "st"); - bool iterm = TERMINAL_FAMILY(term, "iterm") || TERMINAL_FAMILY(term, "iTerm.app"); + bool xterm = terminfo_is_term_family(term, "xterm"); + bool dtterm = terminfo_is_term_family(term, "dtterm"); + bool linuxvt = terminfo_is_term_family(term, "linux"); + bool rxvt = terminfo_is_term_family(term, "rxvt"); + bool teraterm = terminfo_is_term_family(term, "teraterm"); + bool putty = terminfo_is_term_family(term, "putty"); + bool screen = terminfo_is_term_family(term, "screen"); + bool st = terminfo_is_term_family(term, "st"); + bool iterm = terminfo_is_term_family(term, "iterm") || terminfo_is_term_family(term, "iTerm.app"); // None of the following work over SSH; see :help TERM . bool iterm_pretending_xterm = xterm && iterm_env; bool true_xterm = xterm && !!xterm_version; From b672035ff56d0068b8ff217dd8e59dfbaff8f445 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Wed, 31 May 2017 13:18:24 +0100 Subject: [PATCH 053/161] tui: Coding style changes only --- src/nvim/tui/tui.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 3ef2e2967b..7ad8dbe6aa 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -431,7 +431,7 @@ static void print_cell(UI *ui, UCell *ptr) } update_attrs(ui, ptr->attrs); out(ui, ptr->data, strlen(ptr->data)); - ++grid->col; + grid->col++; } static bool cheap_to_print(UI *ui, int row, int col, int next) @@ -440,7 +440,7 @@ static bool cheap_to_print(UI *ui, int row, int col, int next) UGrid *grid = &data->grid; UCell *cell = grid->cells[row] + col; while (next) { - --next; + next--; if (attrs_differ(cell->attrs, data->print_attrs)) { if (data->default_attr) { return false; @@ -449,7 +449,7 @@ static bool cheap_to_print(UI *ui, int row, int col, int next) if (strlen(cell->data) > 1) { return false; } - ++cell; + cell++; } return true; } @@ -468,7 +468,7 @@ static void check_final_column_wrap(UI *ui) if (grid->col == ui->width) { grid->col = 0; if (grid->row < ui->height) { - ++grid->row; + grid->row++; } } } @@ -522,7 +522,7 @@ static void cursor_goto(UI *ui, int row, int col) } } else { if (!data->immediate_wrap_after_last_column && grid->col >= ui->width) { - --n; // We have calculated one too many columns because of delayed wrap. + n--; // We have calculated one too many columns because of delayed wrap. } data->params[0].i = n; unibi_out(ui, unibi_parm_left_cursor); @@ -938,7 +938,7 @@ static void tui_put(UI *ui, String text) // ugrid_put does not advance the cursor correctly, as the actual terminal // will when we print. Its cursor motion model is simplistic and wrong. So // we have to undo what it has just done before doing it right. - --grid->col; + grid->col--; print_cell(ui, cell); check_final_column_wrap(ui); } From 98907c57aedb449bfa96a6425608c1987d4defdf Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Wed, 31 May 2017 21:17:50 +0100 Subject: [PATCH 054/161] tui: Several minor tweaks per commentary and 256-colourize PuTTY. * Don't use &data->grid when we already have grid . * Consolidate into a single assignment to the default_attr flag. --- src/nvim/tui/tui.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 7ad8dbe6aa..1f44710a12 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -370,13 +370,16 @@ static void update_attrs(UI *ui, HlAttrs attrs) int fg = attrs.foreground != -1 ? attrs.foreground : grid->fg; int bg = attrs.background != -1 ? attrs.background : grid->bg; + data->default_attr = fg == -1 && bg == -1 + && !attrs.bold && !attrs.italic && !attrs.underline && !attrs.undercurl + && !attrs.reverse; + if (ui->rgb) { if (fg != -1) { data->params[0].i = (fg >> 16) & 0xff; // red data->params[1].i = (fg >> 8) & 0xff; // green data->params[2].i = fg & 0xff; // blue unibi_out(ui, data->unibi_ext.set_rgb_foreground); - data->default_attr = false; } if (bg != -1) { @@ -384,37 +387,30 @@ static void update_attrs(UI *ui, HlAttrs attrs) data->params[1].i = (bg >> 8) & 0xff; // green data->params[2].i = bg & 0xff; // blue unibi_out(ui, data->unibi_ext.set_rgb_background); - data->default_attr = false; } } else { if (fg != -1) { data->params[0].i = fg; unibi_out(ui, unibi_set_a_foreground); - data->default_attr = false; } if (bg != -1) { data->params[0].i = bg; unibi_out(ui, unibi_set_a_background); - data->default_attr = false; } } if (attrs.bold) { unibi_out(ui, unibi_enter_bold_mode); - data->default_attr = false; } if (attrs.italic) { unibi_out(ui, unibi_enter_italics_mode); - data->default_attr = false; } if (attrs.underline || attrs.undercurl) { unibi_out(ui, unibi_enter_underline_mode); - data->default_attr = false; } if (attrs.reverse) { unibi_out(ui, unibi_enter_reverse_mode); - data->default_attr = false; } } @@ -491,17 +487,18 @@ static void cursor_goto(UI *ui, int row, int col) } if (0 == row && 0 == col) { unibi_out(ui, unibi_cursor_home); - ugrid_goto(&data->grid, row, col); + ugrid_goto(grid, row, col); return; } if (0 == col ? col != grid->col : + row != grid->row ? false : 1 == col ? 2 < grid->col && cheap_to_print(ui, grid->row, 0, col) : 2 == col ? 5 < grid->col && cheap_to_print(ui, grid->row, 0, col) : false) { // Motion to left margin from anywhere else, or CR + printing chars is // even less expensive than using BSes or CUB. unibi_out(ui, unibi_carriage_return); - ugrid_goto(&data->grid, grid->row, 0); + ugrid_goto(grid, grid->row, 0); } else if (col > grid->col) { int n = col - grid->col; if (n <= (row == grid->row ? 4 : 2) @@ -527,7 +524,7 @@ static void cursor_goto(UI *ui, int row, int col) data->params[0].i = n; unibi_out(ui, unibi_parm_left_cursor); } - ugrid_goto(&data->grid, row, col); + ugrid_goto(grid, row, col); return; } else if (col > grid->col) { int n = col - grid->col; @@ -539,7 +536,7 @@ static void cursor_goto(UI *ui, int row, int col) data->params[0].i = n; unibi_out(ui, unibi_parm_right_cursor); } - ugrid_goto(&data->grid, row, col); + ugrid_goto(grid, row, col); return; } } @@ -554,7 +551,7 @@ static void cursor_goto(UI *ui, int row, int col) data->params[0].i = n; unibi_out(ui, unibi_parm_down_cursor); } - ugrid_goto(&data->grid, row, col); + ugrid_goto(grid, row, col); return; } else if (row < grid->row) { int n = grid->row - row; @@ -566,12 +563,12 @@ static void cursor_goto(UI *ui, int row, int col) data->params[0].i = n; unibi_out(ui, unibi_parm_up_cursor); } - ugrid_goto(&data->grid, row, col); + ugrid_goto(grid, row, col); return; } } unibi_goto(ui, row, col); - ugrid_goto(&data->grid, row, col); + ugrid_goto(grid, row, col); } static void clear_region(UI *ui, int top, int bot, int left, int right) @@ -1315,7 +1312,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, unibi_set_num(ut, unibi_max_colors, 256); unibi_set_str(ut, unibi_set_a_foreground, XTERM_SETAF_256); unibi_set_str(ut, unibi_set_a_background, XTERM_SETAB_256); - } else if (konsole || xterm || gnome || rxvt || st + } else if (konsole || xterm || gnome || rxvt || st || putty || linuxvt // Linux 4.8+ supports 256-colour SGR. || mate_pretending_xterm || gnome_pretending_xterm || (colorterm && strstr(colorterm, "256")) From 9475cf2cc6bd5594b00e7ee6755122f346940ebc Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Fri, 2 Jun 2017 21:45:28 +0100 Subject: [PATCH 055/161] screen: Correct commentary. This "trick" is not conditional upon the type of UI. --- src/nvim/screen.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 4f4363d121..61d0169226 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -4236,7 +4236,6 @@ win_line ( * (regardless of the xn,am settings). * Only do this if the cursor is on the current line * (something has been written in it). - * Don't do this for the GUI. * Don't do this for double-width characters. * Don't do this for a window not at the right screen border. */ From 6fe839a6884e77230f81c6e5a76766e67d7dc3a3 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sat, 3 Jun 2017 08:39:56 +0100 Subject: [PATCH 056/161] tui: Do some deferred wrap on iTerm2. Partly undo 8ab08a65ba3bc9a44741a2ec9aa81fbcc77467fb. Further testing by Enrico Ghirardi suggests limiting the non-deferred automatic wrap to only the bottom line, whose rightmost column is not printed for iTerm. --- src/nvim/tui/tui.c | 65 +++++++++++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 1f44710a12..80ace17160 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -91,6 +91,7 @@ typedef struct { bool can_set_lr_margin; bool can_set_left_right_margin; bool immediate_wrap_after_last_column; + bool no_bottom_right_corner; bool mouse_enabled; bool busy; cursorentry_T cursor_shapes[SHAPE_IDX_COUNT]; @@ -201,10 +202,11 @@ static void terminfo_start(UI *ui) data->can_set_left_right_margin = !!unibi_get_str(data->ut, unibi_set_left_margin_parm) && !!unibi_get_str(data->ut, unibi_set_right_margin_parm); - data->immediate_wrap_after_last_column = + data->no_bottom_right_corner = terminfo_is_term_family(term, "iterm") - || terminfo_is_term_family(term, "interix") || (terminfo_is_term_family(term, "xterm") && iterm_env); + data->immediate_wrap_after_last_column = + terminfo_is_term_family(term, "interix"); // Set 't_Co' from the result of unibilium & fix_terminfo. t_colors = unibi_get_num(data->ut, unibi_max_colors); // Enter alternate screen and clear @@ -414,20 +416,43 @@ static void update_attrs(UI *ui, HlAttrs attrs) } } +static void final_column_wrap(UI *ui) +{ + TUIData *data = ui->data; + UGrid *grid = &data->grid; + if (grid->col == ui->width) { + grid->col = 0; + if (grid->row < ui->height) { + grid->row++; + } + } +} + +/// It is undocumented, but in the majority of terminals and terminal emulators +/// printing at the right margin does not cause an automatic wrap until the +/// next character is printed, holding the cursor in place until then. static void print_cell(UI *ui, UCell *ptr) { TUIData *data = ui->data; UGrid *grid = &data->grid; - if (data->immediate_wrap_after_last_column + if (data->no_bottom_right_corner && grid->row >= ui->height - 1 && grid->col >= ui->width - 1) { // This (rare) kind of terminal simply cannot print in this corner without // scrolling the entire screen up a line, which we do not want to happen. return; } + if (!data->immediate_wrap_after_last_column) { + // Printing the next character finally advances the cursor. + final_column_wrap(ui); + } update_attrs(ui, ptr->attrs); out(ui, ptr->data, strlen(ptr->data)); grid->col++; + if (data->immediate_wrap_after_last_column) { + // Printing at the right margin immediately advances the cursor. + final_column_wrap(ui); + } } static bool cheap_to_print(UI *ui, int row, int col, int next) @@ -450,25 +475,6 @@ static bool cheap_to_print(UI *ui, int row, int col, int next) return true; } -/// The behaviour that this is checking for the absence of is undocumented, -/// but is implemented in the majority of terminals and terminal emulators. -/// Printing at the right margin does not cause an automatic wrap until the -/// next character is printed, holding the cursor in place until then. -static void check_final_column_wrap(UI *ui) -{ - TUIData *data = ui->data; - if (!data->immediate_wrap_after_last_column) { - return; - } - UGrid *grid = &data->grid; - if (grid->col == ui->width) { - grid->col = 0; - if (grid->row < ui->height) { - grid->row++; - } - } -} - /// This optimizes several cases where it is cheaper to do something other /// than send a full cursor positioning control sequence. However, there are /// some further optimizations that may seem obvious but that will not work. @@ -506,7 +512,6 @@ static void cursor_goto(UI *ui, int row, int col) UGRID_FOREACH_CELL(grid, grid->row, grid->row, grid->col, col - 1, { print_cell(ui, cell); - check_final_column_wrap(ui); }); } } @@ -614,7 +619,6 @@ static void clear_region(UI *ui, int top, int bot, int left, int right) UGRID_FOREACH_CELL(grid, top, bot, left, right, { cursor_goto(ui, row, col); print_cell(ui, cell); - check_final_column_wrap(ui); }); } @@ -937,7 +941,6 @@ static void tui_put(UI *ui, String text) // we have to undo what it has just done before doing it right. grid->col--; print_cell(ui, cell); - check_final_column_wrap(ui); } static void tui_bell(UI *ui) @@ -990,7 +993,6 @@ static void tui_flush(UI *ui) UGRID_FOREACH_CELL(grid, r.top, r.bot, r.left, r.right, { cursor_goto(ui, row, col); print_cell(ui, cell); - check_final_column_wrap(ui); }); } @@ -1265,6 +1267,9 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, unibi_set_if_empty(ut, unibi_set_left_margin_parm, "\x1b[%i%p1%ds"); unibi_set_if_empty(ut, unibi_set_right_margin_parm, "\x1b[%i;%p2%ds"); } + if (iterm_pretending_xterm) { + unibi_set_if_empty(ut, unibi_enter_italics_mode, "\x1b[3m"); + } } else if (rxvt) { unibi_set_if_empty(ut, unibi_enter_italics_mode, "\x1b[3m"); unibi_set_if_empty(ut, unibi_to_status_line, "\x1b]2"); @@ -1284,7 +1289,15 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, } else if (putty) { // No bugs in the vanilla terminfo for our purposes. } else if (iterm) { + unibi_set_str(ut, unibi_enter_ca_mode, "\x1b[?1049h"); + unibi_set_str(ut, unibi_exit_ca_mode, "\x1b[?1049l"); + unibi_set_if_empty(ut, unibi_set_tb_margin, "\x1b[%i%p1%d;%p2%dr"); + unibi_set_if_empty(ut, unibi_orig_pair, "\x1b[39;49m"); + unibi_set_if_empty(ut, unibi_enter_dim_mode, "\x1b[2m"); unibi_set_if_empty(ut, unibi_enter_italics_mode, "\x1b[3m"); + unibi_set_if_empty(ut, unibi_exit_italics_mode, "\x1b[23m"); + unibi_set_if_empty(ut, unibi_exit_underline_mode, "\x1b[24m"); + unibi_set_if_empty(ut, unibi_exit_standout_mode, "\x1b[27m"); } else if (st) { // No bugs in the vanilla terminfo for our purposes. } From ae7bb47b4f5587f8ac1118becc4e8f75eaa2c2f8 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sat, 3 Jun 2017 13:50:46 +0100 Subject: [PATCH 057/161] tui: Coding style changes only. --- src/nvim/tui/tui.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 80ace17160..e68fb813ab 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1221,12 +1221,16 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, bool putty = terminfo_is_term_family(term, "putty"); bool screen = terminfo_is_term_family(term, "screen"); bool st = terminfo_is_term_family(term, "st"); - bool gnome = terminfo_is_term_family(term, "gnome") || terminfo_is_term_family(term, "vte"); - bool iterm = terminfo_is_term_family(term, "iterm") || terminfo_is_term_family(term, "iTerm.app"); + bool gnome = terminfo_is_term_family(term, "gnome") + || terminfo_is_term_family(term, "vte"); + bool iterm = terminfo_is_term_family(term, "iterm") + || terminfo_is_term_family(term, "iTerm.app"); // None of the following work over SSH; see :help TERM . bool iterm_pretending_xterm = xterm && iterm_env; - bool gnome_pretending_xterm = xterm && colorterm && strstr(colorterm, "gnome-terminal"); - bool mate_pretending_xterm = xterm && colorterm && strstr(colorterm, "mate-terminal"); + bool gnome_pretending_xterm = xterm && colorterm + && strstr(colorterm, "gnome-terminal"); + bool mate_pretending_xterm = xterm && colorterm + && strstr(colorterm, "mate-terminal"); bool true_xterm = xterm && !!xterm_version; char *fix_normal = (char *)unibi_get_str(ut, unibi_cursor_normal); @@ -1453,7 +1457,8 @@ static void augment_terminfo(TUIData *data, const char *term, bool putty = terminfo_is_term_family(term, "putty"); bool screen = terminfo_is_term_family(term, "screen"); bool st = terminfo_is_term_family(term, "st"); - bool iterm = terminfo_is_term_family(term, "iterm") || terminfo_is_term_family(term, "iTerm.app"); + bool iterm = terminfo_is_term_family(term, "iterm") + || terminfo_is_term_family(term, "iTerm.app"); // None of the following work over SSH; see :help TERM . bool iterm_pretending_xterm = xterm && iterm_env; bool true_xterm = xterm && !!xterm_version; From b604e3a086be8abff18c37203bfe6ac2f49d7e81 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sat, 3 Jun 2017 14:08:31 +0100 Subject: [PATCH 058/161] tui: Add terminfo patches for linux on MacOS. Also enable italics on Konsole when it is falsely claiming to be xterm. Also note the reasons for some of the patcher terminfo patches. --- src/nvim/tui/tui.c | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index e68fb813ab..ca8270ac22 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1214,6 +1214,9 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, { unibi_term *ut = data->ut; const char * xterm_version = os_getenv("XTERM_VERSION"); +#if 0 // We don't need to identify this specifically, for now. + bool roxterm = !!os_getenv("ROXTERM_ID"); +#endif bool xterm = terminfo_is_term_family(term, "xterm"); bool linuxvt = terminfo_is_term_family(term, "linux"); bool rxvt = terminfo_is_term_family(term, "rxvt"); @@ -1227,6 +1230,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, || terminfo_is_term_family(term, "iTerm.app"); // None of the following work over SSH; see :help TERM . bool iterm_pretending_xterm = xterm && iterm_env; + bool konsole_pretending_xterm = xterm && konsole; bool gnome_pretending_xterm = xterm && colorterm && strstr(colorterm, "gnome-terminal"); bool mate_pretending_xterm = xterm && colorterm @@ -1260,25 +1264,37 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, // their own terminal types and terminfo entries, like PuTTY does, and not // claim to be xterm. Or they would mimic xterm properly enough to be // treatable as xterm. -#if 0 // We don't need to identify this specifically, for now. - bool roxterm = !!os_getenv("ROXTERM_ID"); -#endif + + // 2017-04 terminfo.src lacks these. genuine Xterm has them, as have + // the false claimants. unibi_set_if_empty(ut, unibi_to_status_line, "\x1b]0;"); unibi_set_if_empty(ut, unibi_from_status_line, "\x07"); unibi_set_if_empty(ut, unibi_set_tb_margin, "\x1b[%i%p1%d;%p2%dr"); + if (true_xterm) { + // 2017-04 terminfo.src lacks these. genuine Xterm has them. unibi_set_if_empty(ut, unibi_set_lr_margin, "\x1b[%i%p1%d;%p2%ds"); unibi_set_if_empty(ut, unibi_set_left_margin_parm, "\x1b[%i%p1%ds"); unibi_set_if_empty(ut, unibi_set_right_margin_parm, "\x1b[%i;%p2%ds"); } - if (iterm_pretending_xterm) { + if (true_xterm + || iterm_pretending_xterm + || gnome_pretending_xterm + || konsole_pretending_xterm) { + // Apple's outdated copy of terminfo.src for MacOS lacks these. + // genuine Xterm and three false claimants have them. unibi_set_if_empty(ut, unibi_enter_italics_mode, "\x1b[3m"); + unibi_set_if_empty(ut, unibi_exit_italics_mode, "\x1b[23m"); } } else if (rxvt) { + // 2017-04 terminfo.src lacks these. Unicode rxvt has them. unibi_set_if_empty(ut, unibi_enter_italics_mode, "\x1b[3m"); + unibi_set_if_empty(ut, unibi_exit_italics_mode, "\x1b[23m"); unibi_set_if_empty(ut, unibi_to_status_line, "\x1b]2"); unibi_set_if_empty(ut, unibi_from_status_line, "\x07"); - unibi_set_if_empty(ut, unibi_set_tb_margin, "\x1b[%i%p1%d;%p2%dr"); + // 2017-04 terminfo.src has older control sequences. + unibi_set_str(ut, unibi_enter_ca_mode, "\x1b[?1049h"); + unibi_set_str(ut, unibi_exit_ca_mode, "\x1b[?1049l"); } else if (screen) { // per the screen manual; 2017-04 terminfo.src lacks these. unibi_set_if_empty(ut, unibi_to_status_line, "\x1b_"); @@ -1287,14 +1303,21 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, unibi_set_if_empty(ut, unibi_to_status_line, "\x1b_"); unibi_set_if_empty(ut, unibi_from_status_line, "\x1b\\"); } else if (terminfo_is_term_family(term, "interix")) { + // 2017-04 terminfo.src lacks this. unibi_set_if_empty(ut, unibi_carriage_return, "\x0d"); } else if (linuxvt) { - // No bugs in the vanilla terminfo for our purposes. + // Apple's outdated copy of terminfo.src for MacOS lacks these. + unibi_set_if_empty(ut, unibi_parm_up_cursor, "\x1b[%p1%dA"); + unibi_set_if_empty(ut, unibi_parm_down_cursor, "\x1b[%p1%dB"); + unibi_set_if_empty(ut, unibi_parm_right_cursor, "\x1b[%p1%dC"); + unibi_set_if_empty(ut, unibi_parm_left_cursor, "\x1b[%p1%dD"); } else if (putty) { // No bugs in the vanilla terminfo for our purposes. } else if (iterm) { + // 2017-04 terminfo.src has older control sequences. unibi_set_str(ut, unibi_enter_ca_mode, "\x1b[?1049h"); unibi_set_str(ut, unibi_exit_ca_mode, "\x1b[?1049l"); + // 2017-04 terminfo.src lacks these. unibi_set_if_empty(ut, unibi_set_tb_margin, "\x1b[%i%p1%d;%p2%dr"); unibi_set_if_empty(ut, unibi_orig_pair, "\x1b[39;49m"); unibi_set_if_empty(ut, unibi_enter_dim_mode, "\x1b[2m"); From f6116eeaa389e6c6af8091cfdf9cb1a5acfd7f00 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sat, 3 Jun 2017 15:03:03 +0100 Subject: [PATCH 059/161] tui: Add tmux to the always 256-colour capable list. --- src/nvim/tui/tui.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index ca8270ac22..ba9356b7ca 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1223,6 +1223,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, bool teraterm = terminfo_is_term_family(term, "teraterm"); bool putty = terminfo_is_term_family(term, "putty"); bool screen = terminfo_is_term_family(term, "screen"); + bool tmux = terminfo_is_term_family(term, "tmux"); bool st = terminfo_is_term_family(term, "st"); bool gnome = terminfo_is_term_family(term, "gnome") || terminfo_is_term_family(term, "vte"); @@ -1236,6 +1237,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, bool mate_pretending_xterm = xterm && colorterm && strstr(colorterm, "mate-terminal"); bool true_xterm = xterm && !!xterm_version; + bool tmux_pretending_screen = screen && !!os_getenv("TMUX"); char *fix_normal = (char *)unibi_get_str(ut, unibi_cursor_normal); if (fix_normal) { @@ -1355,6 +1357,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, } else if (konsole || xterm || gnome || rxvt || st || putty || linuxvt // Linux 4.8+ supports 256-colour SGR. || mate_pretending_xterm || gnome_pretending_xterm + || tmux || tmux_pretending_screen || (colorterm && strstr(colorterm, "256")) || (term && strstr(term, "256")) ) { From 86d796656ca84e9f672b1f899b8211c47561db5c Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sat, 3 Jun 2017 15:16:40 +0100 Subject: [PATCH 060/161] tui: Correct commentary on tmux colour tests. --- test/functional/terminal/tui_spec.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index d27e93c9f9..cb436dbeea 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -403,7 +403,7 @@ describe("tui 't_Co' (terminal colors)", function() assert_term_colors("linux-256color", nil, 256) end) - -- screen and tmux: + -- screen: -- -- FreeBSD falls back to the built-in screen-256colour entry. -- Linux and MacOS have a screen entry in external terminfo with 8 colours, @@ -433,6 +433,12 @@ describe("tui 't_Co' (terminal colors)", function() assert_term_colors("screen-256color", nil, 256) end) + -- tmux: + -- + -- FreeBSD and MacOS fall back to the built-in tmux-256colour entry. + -- Linux has a tmux entry in external terminfo with 8 colours, + -- which is raised to 256. + it("TERM=tmux no COLORTERM uses 256 colors", function() assert_term_colors("tmux", nil, 256) end) From 15500dbd8fa8365d36e5d1eed1d2b222c261dddd Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sat, 3 Jun 2017 15:20:07 +0100 Subject: [PATCH 061/161] tui: Treat cygwin as an immediate-wrap terminal. Alongside interix. --- src/nvim/tui/tui.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index ba9356b7ca..54893014e9 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -206,7 +206,8 @@ static void terminfo_start(UI *ui) terminfo_is_term_family(term, "iterm") || (terminfo_is_term_family(term, "xterm") && iterm_env); data->immediate_wrap_after_last_column = - terminfo_is_term_family(term, "interix"); + terminfo_is_term_family(term, "cygwin") + || terminfo_is_term_family(term, "interix"); // Set 't_Co' from the result of unibilium & fix_terminfo. t_colors = unibi_get_num(data->ut, unibi_max_colors); // Enter alternate screen and clear From 997411b6357b90d9c01935091713fdd7884e1395 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sun, 4 Jun 2017 21:18:44 +0100 Subject: [PATCH 062/161] tui: Do not optimize left motion at the right margin. From observation, there are several different possible behaviours: 1. Deferred wrap like a real DEC VT. The cursor stays visible in the last column, and CUB is calculated relative to that column. Examples: xterm, Unicode rxvt, PuTTY, nosh console-terminal-emulator, FreeBSD kernel's built-in emulator, Linux's built-in emulator 2. Deferred wrap like a real DEC VT. CUB is calculated relative to the last column. But the cursor is invisible. Examples: emulators using newer libvte 3. Non-deferred wrap. The cursor has already wrapped to the next line and CUB does not wrap back. Examples: cygwin, Interix 4. Non-deferred wrap that acts like deferred wrap. The cursor has already visibly wrapped to the next line, but CUB can wrap back around the left margin. Examples: Konsole 5. Deferred wrap with visibly out of bounds cursor. The cursor visibly moves outwith the screen boundaries. CUB is calculated relative to a cursor column that has overflowed the end of the screen grid array. Examples: iTerm2 6. Deferred wrap with invisibly out of bounds cursor. CUB is calculated relative to a cursor column that has overflowed the end of the screen grid array. And the cursor is invisible. Examples: emulators using older libvte In many cases, nvim does not have enough information to know which behaviour the terminal will exhibit, and thus the correct amount of CUB to issue. --- src/nvim/tui/tui.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 54893014e9..55ada08663 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -517,16 +517,19 @@ static void cursor_goto(UI *ui, int row, int col) } } if (row == grid->row) { - if (col < grid->col) { + if (col < grid->col + // Deferred right margin wrap terminals have inconsistent ideas about + // where the cursor actually is during a deferred wrap. Relative + // motion calculations have OBOEs that cannot be compensated for, + // because two terminals that claim to be the same will implement + // different cursor positioning rules. + && (data->immediate_wrap_after_last_column || grid->col < ui->width)) { int n = grid->col - col; if (n <= 4) { // This might be just BS, so it is considered really cheap. while (n--) { unibi_out(ui, unibi_cursor_left); } } else { - if (!data->immediate_wrap_after_last_column && grid->col >= ui->width) { - n--; // We have calculated one too many columns because of delayed wrap. - } data->params[0].i = n; unibi_out(ui, unibi_parm_left_cursor); } From 239b0aaf2e59327454bc313da25dcfdfcee6a4cd Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sun, 4 Jun 2017 22:44:24 +0100 Subject: [PATCH 063/161] tui: Remove the iTerm2 corner case. --- src/nvim/screen.c | 3 ++- src/nvim/tui/tui.c | 11 ----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 61d0169226..e8cd6b4e9c 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -5825,7 +5825,8 @@ static void screen_char(unsigned off, int row, int col) return; /* Outputting the last character on the screen may scrollup the screen. - * Don't to it! Mark the character invalid (update it when scrolled up) */ + * Don't to it! Mark the character invalid (update it when scrolled up) + * FIXME: The premise here is not actually true. c.f. deferred wrap */ if (row == screen_Rows - 1 && col == screen_Columns - 1 /* account for first command-line character in rightleft mode */ && !cmdmsg_rl diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 55ada08663..949a24db89 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -91,7 +91,6 @@ typedef struct { bool can_set_lr_margin; bool can_set_left_right_margin; bool immediate_wrap_after_last_column; - bool no_bottom_right_corner; bool mouse_enabled; bool busy; cursorentry_T cursor_shapes[SHAPE_IDX_COUNT]; @@ -202,9 +201,6 @@ static void terminfo_start(UI *ui) data->can_set_left_right_margin = !!unibi_get_str(data->ut, unibi_set_left_margin_parm) && !!unibi_get_str(data->ut, unibi_set_right_margin_parm); - data->no_bottom_right_corner = - terminfo_is_term_family(term, "iterm") - || (terminfo_is_term_family(term, "xterm") && iterm_env); data->immediate_wrap_after_last_column = terminfo_is_term_family(term, "cygwin") || terminfo_is_term_family(term, "interix"); @@ -436,13 +432,6 @@ static void print_cell(UI *ui, UCell *ptr) { TUIData *data = ui->data; UGrid *grid = &data->grid; - if (data->no_bottom_right_corner - && grid->row >= ui->height - 1 - && grid->col >= ui->width - 1) { - // This (rare) kind of terminal simply cannot print in this corner without - // scrolling the entire screen up a line, which we do not want to happen. - return; - } if (!data->immediate_wrap_after_last_column) { // Printing the next character finally advances the cursor. final_column_wrap(ui); From 054b03e07ac8c27f49afba7225a20214697a3720 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Mon, 5 Jun 2017 22:12:53 +0100 Subject: [PATCH 064/161] tui: Combine multiple attribute changes. Use the terminfo set_attribute capability to set multiple attributes in one control sequence, if it is available. --- src/nvim/tui/tui.c | 55 +++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 949a24db89..387a340588 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -360,19 +360,43 @@ static void update_attrs(UI *ui, HlAttrs attrs) } data->print_attrs = attrs; - if (!data->default_attr) { - data->default_attr = true; - unibi_out(ui, unibi_exit_attribute_mode); - } UGrid *grid = &data->grid; int fg = attrs.foreground != -1 ? attrs.foreground : grid->fg; int bg = attrs.background != -1 ? attrs.background : grid->bg; - data->default_attr = fg == -1 && bg == -1 - && !attrs.bold && !attrs.italic && !attrs.underline && !attrs.undercurl - && !attrs.reverse; - + if (unibi_get_str(data->ut, unibi_set_attributes)) { + if (attrs.bold || attrs.reverse || attrs.underline || attrs.undercurl) { + data->params[0].i = 0; // standout + data->params[1].i = attrs.underline || attrs.undercurl; + data->params[2].i = attrs.reverse; + data->params[3].i = 0; // blink + data->params[4].i = 0; // dim + data->params[5].i = attrs.bold; + data->params[6].i = 0; // blank + data->params[7].i = 0; // protect + data->params[8].i = 0; // alternate character set + unibi_out(ui, unibi_set_attributes); + } else if (!data->default_attr) { + unibi_out(ui, unibi_exit_attribute_mode); + } + } else { + if (!data->default_attr) { + unibi_out(ui, unibi_exit_attribute_mode); + } + if (attrs.bold) { + unibi_out(ui, unibi_enter_bold_mode); + } + if (attrs.underline || attrs.undercurl) { + unibi_out(ui, unibi_enter_underline_mode); + } + if (attrs.reverse) { + unibi_out(ui, unibi_enter_reverse_mode); + } + } + if (attrs.italic) { + unibi_out(ui, unibi_enter_italics_mode); + } if (ui->rgb) { if (fg != -1) { data->params[0].i = (fg >> 16) & 0xff; // red @@ -399,18 +423,9 @@ static void update_attrs(UI *ui, HlAttrs attrs) } } - if (attrs.bold) { - unibi_out(ui, unibi_enter_bold_mode); - } - if (attrs.italic) { - unibi_out(ui, unibi_enter_italics_mode); - } - if (attrs.underline || attrs.undercurl) { - unibi_out(ui, unibi_enter_underline_mode); - } - if (attrs.reverse) { - unibi_out(ui, unibi_enter_reverse_mode); - } + data->default_attr = fg == -1 && bg == -1 + && !attrs.bold && !attrs.italic && !attrs.underline && !attrs.undercurl + && !attrs.reverse; } static void final_column_wrap(UI *ui) From b22a61cdbba68ae88a58dd39f288a7bb13c5558d Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Mon, 5 Jun 2017 22:47:44 +0100 Subject: [PATCH 065/161] tui: Recognize "Tc" terminfo capability. This is a new convention pioneered by tmux. It does not do much for nvim; since nvim always looks to see whether it should be making up "setrgbf" and "setrgbb" capabilities. But it is a way for terminfo to force this, irrespective of the hardwired list in the code, for more terminal types. On the gripping hand, updating terminfo descriptions to actually have "setrgbf" and "setrgbb" capabilities so that nvim never has to try to invent them in the first place, is as good if not better an approach for overriding what is baked into the code. --- runtime/doc/term.txt | 24 +++++++++++++++++++----- src/nvim/tui/tui.c | 25 ++++++++++++++++++++----- 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index 2a6b09a9ff..951947d865 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -134,11 +134,25 @@ support it. It uses the same |terminfo| extensions that were proposed by Rüdiger Sonderfeld in 2013 for this: "setrgbf" and "setrgbb". If your terminfo definition specifies these, then nothing more is required. -If your terminfo definition is missing them, then Nvim will on a wide range of -terminals resort to using the ISO 8613-6:1994/ITU T.416:1993 control sequences -for setting RGB colours. This includes the "rxvt", "linux", "st", and "iterm" -terminal types, or when Konsole, genuine Xterm, or a terminal emulator that -sets the COLORTERM environment variable to "truecolor" is detected. +If your terminfo definition is missing them, then Nvim will decide whether to +add them to your terminfo definition, using the ISO 8613-6:1994/ITU T.416:1993 +control sequences for setting RGB colours, but modified to use semicolons +instead of colons unless the terminal is known to follow the standard. +(Semicolons cause ambiguities that the standard avoided by specifying colons +as a sub-parameter delimiter. A historical misunderstanding meant that many +terminal emulators ended up using semicolons for many years, though.) + +A new convention, pioneered in 2016 by tmux, is the "Tc" terminfo extension. +If your terminal's terminfo definition has this flag, Nvim will add +constructed "setrgbf" and "setrgbb" capabilities as if they had been in the +terminfo definition. + +If your terminal's terminfo definition does not (yet) have this flag, Nvim +will fall back to looking at the TERM and other environment variables. For +the "rxvt", "linux", "st", and "iterm" terminal types, or when Konsole, +genuine Xterm, or a terminal emulator that sets the COLORTERM environment +variable to "truecolor" is detected, it will also add constructed "setrgbf" +and "setrgbb" capabilities. *xterm-resize* Nvim can resize the terminal display on some terminals that implement an diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 387a340588..2996d634a2 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1212,6 +1212,18 @@ static int unibi_find_ext_str(unibi_term *ut, const char *name) return -1; } +static int unibi_find_ext_bool(unibi_term *ut, const char *name) + { + size_t max = unibi_count_ext_bool(ut); + for (size_t i = 0; i < max; ++i) { + const char * n = unibi_get_ext_bool_name(ut, i); + if (n && 0 == strcmp(n, name)) { + return (int)i; + } + } + return -1; +} + /// Several entries in terminfo are known to be deficient or outright wrong, /// unfortunately; and several terminal emulators falsely announce incorrect /// terminal types. So patch the terminfo records after loading from an @@ -1497,7 +1509,7 @@ static void augment_terminfo(TUIData *data, const char *term, bool iterm_pretending_xterm = xterm && iterm_env; bool true_xterm = xterm && !!xterm_version; bool tmux_wrap = screen && !!os_getenv("TMUX"); - bool truecolor = colorterm + bool old_truecolor_env = colorterm && (0 == strcmp(colorterm, "truecolor") || 0 == strcmp(colorterm, "24bit")); // Only define this capability for terminal types that we know understand it. @@ -1519,17 +1531,20 @@ static void augment_terminfo(TUIData *data, const char *term, // them to terminal types, that do actually have such control sequences but // lack the correct definitions in terminfo, is an augmentation, not a // fixup. See https://gist.github.com/XVilka/8346728 for more about this. + int Tc = unibi_find_ext_bool(ut, "Tc"); + // "standard" means using colons like ISO 8613-6:1994/ITU T.416:1993 says. bool has_standard_rgb = vte_version >= 3600 // per GNOME bug #685759 || iterm || iterm_pretending_xterm // per analysis of VT100Terminal.m || true_xterm; - // "standard" means using colons like ISO 8613-6:1994/ITU T.416:1993 says. - bool has_non_standard_rgb = - linuxvt // Linux 4.8+ supports true-colour SGR. + bool has_non_standard_rgb = -1 != Tc + // terminfo is definitive if it says something. + ? unibi_get_ext_bool(ut, (size_t)Tc) + : linuxvt // Linux 4.8+ supports true-colour SGR. || konsole // per commentary in VT102Emulation.cpp // per http://lists.schmorp.de/pipermail/rxvt-unicode/2016q2/002261.html || rxvt || st // per experimentation - || truecolor; + || old_truecolor_env; data->unibi_ext.set_rgb_foreground = unibi_find_ext_str(ut, "setrgbf"); if (-1 == data->unibi_ext.set_rgb_foreground) { if (has_standard_rgb) { From 2b35f40fc12dccd0f23c3f89f5f025207370196a Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Wed, 7 Jun 2017 14:21:53 +0100 Subject: [PATCH 066/161] doco: Adjust TERM and terminfo doco. Use a table and adjust cursor-shape a bit. --- runtime/doc/term.txt | 63 ++++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index 951947d865..db0bc81d72 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -40,20 +40,23 @@ If you experience terminal difficulties, first ensure that you have set the correct terminal type in your $TERM environment variable so that Nvim is pulling the correct entry from the terminfo database in the first place. -As noted in the commentary in the terminfo source file: - - The correct $TERM for GNOME Terminal has been "gnome" since 1999, or - "gnome-256color" since 2006. "vte" and "vte-256color" are equivalents. - "xterm" and "xterm-256color" are incorrect. - - The correct $TERM for iTerm.app is "iterm" or "iTerm.app". "xterm" and - "xterm-256color" are incorrect; for starters they do not include - iTerm.app's status line capability. - - The correct $TERM for Terminal.app is "nsterm". "vt100", "xterm", and - "xterm-256color" are incorrect; for starters they do not include - Terminal.app's status line capability or correctly describe its - cursor-addressed mode. - - The correct $TERM for tmux is "tmux" or "tmux-256color". "screen" is - incorrect; for starters it does not include tmux's italics and status line - capabilities or correctly describe how to set inverse video. +Per the terminfo source file from ncurses: + + For these terminals Set $TERM to |builtin-terms|? + + iTerm.app "iterm" or "iTerm.app" Y + anything libvte based "vte" or "vte-256color" Y + (e.g. GNOME Terminal) ("gnome" and "gnome-256color" are + available as aliases for these) + tmux "tmux" or "tmux-256color" Y + screen "screen" or "screen-256color" Y + PuTTY "putty" or "putty-256color" Y + Terminal.app "nsterm" N + Linux virtual terminal "linux" or "linux-256color" Y + +Describing any of these as "xterm" or "xterm-256colour" will not describe the +terminal correctly to Nvim, and will cause various kinds of problematic +behaviours. Setting your $TERM environment variable to the correct value also avoids the problem that SSH does not mirror arbitrary client-end environment variables @@ -167,24 +170,26 @@ it. It uses the same |terminfo| extensions that were pioneered by tmux for this: "Ss" and "Se". If your terminfo definition specifies these, as some (such as those based upon "xterm+tmux") do, then nothing more is required. -If your terminfo definition is missing them, then Nvim will on a wide range of -terminals resort to using the conventional DECSUSR control sequence for -adjusting the cursor shape. If Konsole is detected, Nvim will use the -idiosyncratic Konsole terminal control sequences for this. Similarly if the -Linux kernel's built-in terminal emulator is detected, with its idiosyncratic -control sequence. +If your terminfo definition is missing them, then Nvim will decide whether to +add them to your terminfo definition, by looking at the TERM and other +environment variables. For the "rxvt", "putty", "linux", "screen", +"teraterm", and "iterm" terminal types, or when Konsole, a libvte-based +terminal emulator, or genuine Xterm are detected, it will add constructed +"Ss" and "Se" capabilities. -Note: tmux itself accepts the conventional DECSUSR control sequence, the same -as many other terminals do. It has to translate this into whatever control -sequence is appropriate for the terminal that it is outputting to. Like Nvim, -it will use the "Ss" and "Se" capabilities from terminfo if they are present. +Note: Sometimes it will appear that Nvim when run within tmux is not changing +the cursor, but in fact it is tmux receiving instructions from Nvim to change +the cursor and not knowing what to do in turn. tmux has to translate what it +receives from Nvim into whatever control sequence is appropriate for the +terminal that it is outputting to. It shares a common mechanism with Nvim, of +using the "Ss" and "Se" capabilities from terminfo (for the output terminal) +if they are present. Unlike Nvim, if they are not present in terminfo you +will have to add them by setting the tmux "terminal-overrides" setting in +$HOME/.tmux.conf . -Unlike Nvim, if they are not present in terminfo you will have to add them by -setting the tmux "terminal-overrides" setting in $HOME/.tmux.conf . It will -appear that Nvim is not changing the cursor, but in fact it is tmux receiving -instructions from Nvim to change the cursor and not knowing what to do. See -the tmux(1) manual page for the details of how and what to do in the tmux +See the tmux(1) manual page for the details of how and what to do in the tmux configuration file. It will look something like: > + set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q' set -ga terminal-overrides \ From 6d35c5c7ec7ddd8ef0598565fbadb2d34551bd0d Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Fri, 9 Jun 2017 19:33:17 +0100 Subject: [PATCH 067/161] tui: Another linux terminfo capability fix For the linux terminal type apply the same fixup to the terminfo civis string that is applied to the cnorm string. --- src/nvim/tui/tui.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 2996d634a2..d017db3651 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -48,7 +48,8 @@ #define STARTS_WITH(str, prefix) (strlen(term) >= (sizeof(prefix) - 1) \ && 0 == memcmp((str), (prefix), sizeof(prefix) - 1)) #define TMUX_WRAP(is_tmux,seq) ((is_tmux) ? "\x1bPtmux;\x1b" seq "\x1b\\" : seq) -#define LINUXRESETC "\x1b[?0c" +#define LINUXSET0C "\x1b[?0c" +#define LINUXSET1C "\x1b[?1c" // Per the commentary in terminfo, only a minus sign is a true suffix // separator. @@ -1270,12 +1271,23 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, unibi_set_str(ut, unibi_cursor_normal, fix_normal); } if (linuxvt - && strlen(fix_normal) >= (sizeof LINUXRESETC - 1) - && !memcmp(strchr(fix_normal,0) - (sizeof LINUXRESETC - 1), LINUXRESETC, sizeof LINUXRESETC - 1)) { + && strlen(fix_normal) >= (sizeof LINUXSET0C - 1) + && !memcmp(strchr(fix_normal,0) - (sizeof LINUXSET0C - 1), LINUXSET0C, sizeof LINUXSET0C - 1)) { // The Linux terminfo entry similarly includes a Linux-idiosyncractic // cursor shape reset in cnorm, which similarly interferes with // set_cursor_style. - fix_normal[strlen(fix_normal) - (sizeof LINUXRESETC - 1)] = 0; + fix_normal[strlen(fix_normal) - (sizeof LINUXSET0C - 1)] = 0; + } + } + char *fix_invisible = (char *)unibi_get_str(ut, unibi_cursor_invisible); + if (fix_invisible) { + if (linuxvt + && strlen(fix_invisible) >= (sizeof LINUXSET1C - 1) + && !memcmp(strchr(fix_invisible,0) - (sizeof LINUXSET1C - 1), LINUXSET1C, sizeof LINUXSET1C - 1)) { + // The Linux terminfo entry similarly includes a Linux-idiosyncractic + // cursor shape reset in cinvis, which similarly interferes with + // set_cursor_style. + fix_invisible[strlen(fix_invisible) - (sizeof LINUXSET1C - 1)] = 0; } } From cdfaecb25f6a9a94f29a38d9f2d24a579b3dff5f Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Fri, 9 Jun 2017 19:50:13 +0100 Subject: [PATCH 068/161] tui: Eliminate more extraneous control sequences. When higher layers flush the TUI layer output buffer, but there is nothing in the buffer to flush, no longer does the TUI layer write out unnecessary cnorm/civis sequences surrounding that nothing. --- src/nvim/tui/tui.c | 64 +++++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 21 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index d017db3651..931f2738ab 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -39,8 +39,8 @@ #include "nvim/syntax.h" #include "nvim/macros.h" -// Space reserved in the output buffer to restore the cursor to normal when -// flushing. No existing terminal will require 32 bytes to do that. +// Space reserved in two output buffers to make the cursor normal or invisible +// when flushing. No existing terminal will require 32 bytes to do that. #define CNORM_COMMAND_MAX_SIZE 32 #define OUTBUF_SIZE 0xffff @@ -73,7 +73,10 @@ typedef struct { bool stop; unibi_var_t params[9]; char buf[OUTBUF_SIZE]; - size_t bufpos, bufsize; + size_t bufpos; + char norm[CNORM_COMMAND_MAX_SIZE]; + char invis[CNORM_COMMAND_MAX_SIZE]; + size_t normlen, invislen; TermInput input; uv_loop_t write_loop; unibi_term *ut; @@ -155,12 +158,20 @@ UI *tui_start(void) return ui_bridge_attach(ui, tui_main, tui_scheduler); } +static size_t unibi_pre_fmt_str(TUIData *data, unsigned int unibi_index, char * buf, size_t len) +{ + const char *str = unibi_get_str(data->ut, unibi_index); + if (!str) { + return 0U; + } + return unibi_run(str, data->params, buf, len); +} + static void terminfo_start(UI *ui) { TUIData *data = ui->data; data->scroll_region_is_full_screen = true; data->bufpos = 0; - data->bufsize = sizeof(data->buf) - CNORM_COMMAND_MAX_SIZE; data->default_attr = false; data->showing_mode = SHAPE_IDX_N; data->unibi_ext.enable_mouse = -1; @@ -205,6 +216,8 @@ static void terminfo_start(UI *ui) data->immediate_wrap_after_last_column = terminfo_is_term_family(term, "cygwin") || terminfo_is_term_family(term, "interix"); + data->normlen = unibi_pre_fmt_str(data, unibi_cursor_normal, data->norm, sizeof data->norm); + data->invislen = unibi_pre_fmt_str(data, unibi_cursor_invisible, data->invis, sizeof data->invis); // Set 't_Co' from the result of unibilium & fix_terminfo. t_colors = unibi_get_num(data->ut, unibi_max_colors); // Enter alternate screen and clear @@ -1183,7 +1196,7 @@ static void out(void *ctx, const char *str, size_t len) { UI *ui = ctx; TUIData *data = ui->data; - size_t available = data->bufsize - data->bufpos; + size_t available = sizeof(data->buf) - data->bufpos; if (len > available) { flush_buf(ui, false); @@ -1613,28 +1626,37 @@ static void augment_terminfo(TUIData *data, const char *term, static void flush_buf(UI *ui, bool toggle_cursor) { uv_write_t req; - uv_buf_t buf; + uv_buf_t bufs[3]; + uv_buf_t *bufp = bufs; TUIData *data = ui->data; - if (toggle_cursor && !data->busy) { - // not busy and the cursor is invisible(see below). Append a "cursor - // normal" command to the end of the buffer. - data->bufsize += CNORM_COMMAND_MAX_SIZE; - unibi_out(ui, unibi_cursor_normal); - data->bufsize -= CNORM_COMMAND_MAX_SIZE; + if (data->bufpos <= 0) { + return; } - buf.base = data->buf; - buf.len = data->bufpos; - uv_write(&req, STRUCT_CAST(uv_stream_t, &data->output_handle), &buf, 1, NULL); + if (toggle_cursor && !data->busy) { + // not busy and cursor is visible, write a "cursor invisible" command + // before writing the buffer. + bufp->base = data->invis; + bufp->len = data->invislen; + bufp++; + } + + bufp->base = data->buf; + bufp->len = data->bufpos; + bufp++; + + if (toggle_cursor && !data->busy) { + // not busy and the cursor is invisible. Write a "cursor normal" command + // after writing the buffer. + bufp->base = data->norm; + bufp->len = data->normlen; + bufp++; + } + + uv_write(&req, STRUCT_CAST(uv_stream_t, &data->output_handle), bufs, (unsigned)(bufp - bufs), NULL); uv_run(&data->write_loop, UV_RUN_DEFAULT); data->bufpos = 0; - - if (toggle_cursor && !data->busy) { - // not busy and cursor is visible(see above), append a "cursor invisible" - // command to the beginning of the buffer for the next flush - unibi_out(ui, unibi_cursor_invisible); - } } #if TERMKEY_VERSION_MAJOR > 0 || TERMKEY_VERSION_MINOR > 18 From 2c236fc67be22bceea87fd1ee1e2db5a9d3941c0 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sat, 10 Jun 2017 09:00:15 +0100 Subject: [PATCH 069/161] tui: Track cursor visibility. This fixes a test failure caused by dfaecb25f6a9a94f29a38d9f2d24a579b3dff5f not tracking what the current visibility is and whether it matches the current business state. --- src/nvim/tui/tui.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 931f2738ab..a85f119ef4 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -96,7 +96,7 @@ typedef struct { bool can_set_left_right_margin; bool immediate_wrap_after_last_column; bool mouse_enabled; - bool busy; + bool busy, is_invisible; cursorentry_T cursor_shapes[SHAPE_IDX_COUNT]; HlAttrs print_attrs; bool default_attr; @@ -173,6 +173,8 @@ static void terminfo_start(UI *ui) data->scroll_region_is_full_screen = true; data->bufpos = 0; data->default_attr = false; + data->is_invisible = true; + data->busy = false; data->showing_mode = SHAPE_IDX_N; data->unibi_ext.enable_mouse = -1; data->unibi_ext.disable_mouse = -1; @@ -1630,28 +1632,32 @@ static void flush_buf(UI *ui, bool toggle_cursor) uv_buf_t *bufp = bufs; TUIData *data = ui->data; - if (data->bufpos <= 0) { + if (data->bufpos <= 0 && data->busy == data->is_invisible) { return; } - if (toggle_cursor && !data->busy) { - // not busy and cursor is visible, write a "cursor invisible" command - // before writing the buffer. + if (toggle_cursor && !data->is_invisible) { + // cursor is visible. Write a "cursor invisible" command before writing the + // buffer. bufp->base = data->invis; bufp->len = data->invislen; bufp++; + data->is_invisible = true; } - bufp->base = data->buf; - bufp->len = data->bufpos; - bufp++; + if (data->bufpos > 0) { + bufp->base = data->buf; + bufp->len = data->bufpos; + bufp++; + } - if (toggle_cursor && !data->busy) { + if (toggle_cursor && !data->busy && data->is_invisible) { // not busy and the cursor is invisible. Write a "cursor normal" command // after writing the buffer. bufp->base = data->norm; bufp->len = data->normlen; bufp++; + data->is_invisible = data->busy; } uv_write(&req, STRUCT_CAST(uv_stream_t, &data->output_handle), bufs, (unsigned)(bufp - bufs), NULL); From 7955cf35158f56a207ece32127adece23fd0fba1 Mon Sep 17 00:00:00 2001 From: raichoo Date: Sat, 25 Mar 2017 14:09:31 +0100 Subject: [PATCH 070/161] vim-patch:7.4.2259 Problem: With 'incsearch' can only see the next match. Solution: Make CTRL-N/CTRL-P move to the previous/next match. (Christian Brabandt) https://github.com/vim/vim/commit/4d6f32cbfbaf324ac4a25c0206a5db0e9f7a48f7 --- runtime/doc/cmdline.txt | 9 ++ src/nvim/ex_getln.c | 140 ++++++++++++++---- src/nvim/testdir/test_search.vim | 243 +++++++++++++++++++++++++++++++ src/nvim/version.c | 2 +- 4 files changed, 367 insertions(+), 27 deletions(-) diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index 948c921431..ef8f4bc317 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -376,10 +376,18 @@ CTRL-D List names that match the pattern in front of the cursor. *c_CTRL-N* CTRL-N After using 'wildchar' which got multiple matches, go to next match. Otherwise recall more recent command-line from history. + */_CTRL-N* + When 'incsearch' is set, entering a search pattern for "/" or + "?" and the current match is displayed then CTRL-N will move + to the next match (does not take |search-offset| into account) *c_CTRL-P* *c_* CTRL-P After using 'wildchar' which got multiple matches, go to previous match. Otherwise recall older command-line from history. only works with the GUI. + */_CTRL-P* + When 'incsearch' is set, entering a search pattern for "/" or + "?" and the current match is displayed then CTRL-P will move + to the previous match (does not take |search-offset| into account). *c_CTRL-A* CTRL-A All names that match the pattern in front of the cursor are inserted. @@ -389,6 +397,7 @@ CTRL-L A match is done on the pattern in front of the cursor. If If there are multiple matches the longest common part is inserted in place of the pattern. If the result is shorter than the pattern, no completion is done. + */_CTRL-L* When 'incsearch' is set, entering a search pattern for "/" or "?" and the current match is displayed then CTRL-L will add one character from the end of the current match. If diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 858374c68e..efa8cd24bc 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -106,6 +106,9 @@ typedef struct command_line_state { linenr_T old_topline; int old_topfill; linenr_T old_botline; + pos_T cursor_start; + pos_T match_start; + pos_T match_end; int did_incsearch; int incsearch_postponed; int did_wild_list; // did wild_list() recently @@ -167,6 +170,7 @@ static uint8_t *command_line_enter(int firstc, long count, int indent) s->save_State = State; s->save_p_icm = vim_strsave(p_icm); s->ignore_drag_release = true; + s->match_start = curwin->w_cursor; if (s->firstc == -1) { s->firstc = NUL; @@ -179,7 +183,9 @@ static uint8_t *command_line_enter(int firstc, long count, int indent) } ccline.overstrike = false; // always start in insert mode + clearpos(&s->match_end); s->old_cursor = curwin->w_cursor; // needs to be restored later + s->cursor_start = s->old_cursor; s->old_curswant = curwin->w_curswant; s->old_leftcol = curwin->w_leftcol; s->old_topline = curwin->w_topline; @@ -283,6 +289,9 @@ static uint8_t *command_line_enter(int firstc, long count, int indent) if (s->did_incsearch) { curwin->w_cursor = s->old_cursor; + if (s->gotesc) { + curwin->w_cursor = s->cursor_start; + } curwin->w_curswant = s->old_curswant; curwin->w_leftcol = s->old_leftcol; curwin->w_topline = s->old_topline; @@ -929,6 +938,12 @@ static int command_line_handle_key(CommandLineState *s) // Truncate at the end, required for multi-byte chars. ccline.cmdbuff[ccline.cmdlen] = NUL; + if (ccline.cmdlen == 0) { + s->old_cursor = s->cursor_start; + } else { + s->old_cursor = s->match_start; + decl(&s->old_cursor); + } redrawcmd(); } else if (ccline.cmdlen == 0 && s->c != Ctrl_W && ccline.cmdprompt == NULL && s->indent == 0) { @@ -1001,6 +1016,9 @@ static int command_line_handle_key(CommandLineState *s) // Truncate at the end, required for multi-byte chars. ccline.cmdbuff[ccline.cmdlen] = NUL; + if (ccline.cmdlen == 0) { + s->old_cursor = s->cursor_start; + } redrawcmd(); return command_line_changed(s); @@ -1230,24 +1248,27 @@ static int command_line_handle_key(CommandLineState *s) case Ctrl_L: if (p_is && !cmd_silent && (s->firstc == '/' || s->firstc == '?')) { // Add a character from under the cursor for 'incsearch' - if (s->did_incsearch && !equalpos(curwin->w_cursor, s->old_cursor)) { - s->c = gchar_cursor(); - // If 'ignorecase' and 'smartcase' are set and the - // command line has no uppercase characters, convert - // the character to lowercase - if (p_ic && p_scs && !pat_has_uppercase(ccline.cmdbuff)) { - s->c = mb_tolower(s->c); - } - - if (s->c != NUL) { - if (s->c == s->firstc - || vim_strchr((char_u *)(p_magic ? "\\^$.*[" : "\\^$"), s->c) - != NULL) { - // put a backslash before special characters - stuffcharReadbuff(s->c); - s->c = '\\'; + if (s->did_incsearch) { + curwin->w_cursor = s->match_end; + if (!equalpos(curwin->w_cursor, s->old_cursor)) { + s->c = gchar_cursor(); + // If 'ignorecase' and 'smartcase' are set and the + // command line has no uppercase characters, convert + // the character to lowercase + if (p_ic && p_scs + && !pat_has_uppercase(ccline.cmdbuff)) { + s->c = mb_tolower(s->c); + } + if (s->c != NUL) { + if (s->c == s->firstc + || vim_strchr((char_u *)(p_magic ? "\\^$.*[" : "\\^$"), s->c) + != NULL) { + // put a backslash before special characters + stuffcharReadbuff(s->c); + s->c = '\\'; + } + break; } - break; } } return command_line_not_changed(s); @@ -1261,7 +1282,67 @@ static int command_line_handle_key(CommandLineState *s) case Ctrl_N: // next match case Ctrl_P: // previous match - if (s->xpc.xp_numfiles > 0) { + if (p_is && !cmd_silent && (s->firstc == '/' || s->firstc == '?')) { + pos_T t; + int search_flags = SEARCH_KEEP + SEARCH_NOOF + SEARCH_PEEK; + + if (char_avail()) { + return 1; + } + ui_busy_start(); + ui_flush(); + if (s->c == Ctrl_N) { + t = s->match_end; + search_flags += SEARCH_COL; + } else { + t = s->match_start; + } + emsg_off++; + s->i = searchit(curwin, curbuf, &t, + s->c == Ctrl_N ? FORWARD : BACKWARD, + ccline.cmdbuff, s->count, search_flags, + RE_SEARCH, 0, NULL); + emsg_off--; + ui_busy_stop(); + if (s->i) { + s->old_cursor = s->match_start; + s->match_end = t; + s->match_start = t; + if (s->c == Ctrl_P && s->firstc == '/') { + // move just before the current match, so that + // when nv_search finishes the cursor will be + // put back on the match + s->old_cursor = t; + (void)decl(&s->old_cursor); + } + if (lt(t, s->old_cursor) && s->c == Ctrl_N) { + // wrap around + s->old_cursor = t; + if (s->firstc == '?') { + (void)incl(&s->old_cursor); + } else { + (void)decl(&s->old_cursor); + } + } + + set_search_match(&s->match_end); + curwin->w_cursor = s->match_start; + changed_cline_bef_curs(); + update_topline(); + validate_cursor(); + highlight_match = true; + s->old_curswant = curwin->w_curswant; + s->old_leftcol = curwin->w_leftcol; + s->old_topline = curwin->w_topline; + s->old_topfill = curwin->w_topfill; + s->old_botline = curwin->w_botline; + update_screen(NOT_VALID); + redrawcmdline(); + } else { + vim_beep(BO_ERROR); + } + return command_line_not_changed(s); + } else if (s->xpc.xp_numfiles > 0) { if (nextwild(&s->xpc, (s->c == Ctrl_P) ? WILD_PREV : WILD_NEXT, 0, s->firstc != '@') == FAIL) { break; @@ -1566,16 +1647,11 @@ static int command_line_changed(CommandLineState *s) if (s->i != 0) { pos_T save_pos = curwin->w_cursor; - // First move cursor to end of match, then to the start. This - // moves the whole match onto the screen when 'nowrap' is set. - curwin->w_cursor.lnum += search_match_lines; - curwin->w_cursor.col = search_match_endcol; - if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count) { - curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; - coladvance((colnr_T)MAXCOL); - } + s->match_start = curwin->w_cursor; + set_search_match(&curwin->w_cursor); validate_cursor(); end_pos = curwin->w_cursor; + s->match_end = end_pos; curwin->w_cursor = save_pos; } else { end_pos = curwin->w_cursor; // shutup gcc 4 @@ -5519,3 +5595,15 @@ histentry_T *hist_get_array(const uint8_t history_type, int **const new_hisidx, *new_hisnum = &(hisnum[history_type]); return history[history_type]; } + +static void set_search_match(pos_T *t) +{ + // First move cursor to end of match, then to the start. This + // moves the whole match onto the screen when 'nowrap' is set. + t->lnum += search_match_lines; + t->col = search_match_endcol; + if (t->lnum > curbuf->b_ml.ml_line_count) { + t->lnum = curbuf->b_ml.ml_line_count; + coladvance((colnr_T)MAXCOL); + } +} diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim index e85525e663..9c29236ac9 100644 --- a/src/nvim/testdir/test_search.vim +++ b/src/nvim/testdir/test_search.vim @@ -1,5 +1,248 @@ " Test for the search command +func Test_search_cmdline() + throw 'skipped: Nvim does not support test_disable_char_avail()' + if !exists('+incsearch') + return + endif + " need to disable char_avail, + " so that expansion of commandline works + call test_disable_char_avail(1) + new + call setline(1, [' 1', ' 2 these', ' 3 the', ' 4 their', ' 5 there', ' 6 their', ' 7 the', ' 8 them', ' 9 these', ' 10 foobar']) + " Test 1 + " CTRL-N / CTRL-P skips through the previous search history + set noincsearch + :1 + call feedkeys("/foobar\", 'tx') + call feedkeys("/the\",'tx') + call assert_equal('the', @/) + call feedkeys("/thes\\\",'tx') + call assert_equal('foobar', @/) + + " Test 2 + " Ctrl-N goes from one match to the next + " until the end of the buffer + set incsearch nowrapscan + :1 + " first match + call feedkeys("/the\", 'tx') + call assert_equal(' 2 these', getline('.')) + :1 + " second match + call feedkeys("/the\\", 'tx') + call assert_equal(' 3 the', getline('.')) + :1 + " third match + call feedkeys("/the".repeat("\", 2)."\", 'tx') + call assert_equal(' 4 their', getline('.')) + :1 + " fourth match + call feedkeys("/the".repeat("\", 3)."\", 'tx') + call assert_equal(' 5 there', getline('.')) + :1 + " fifth match + call feedkeys("/the".repeat("\", 4)."\", 'tx') + call assert_equal(' 6 their', getline('.')) + :1 + " sixth match + call feedkeys("/the".repeat("\", 5)."\", 'tx') + call assert_equal(' 7 the', getline('.')) + :1 + " seventh match + call feedkeys("/the".repeat("\", 6)."\", 'tx') + call assert_equal(' 8 them', getline('.')) + :1 + " eigth match + call feedkeys("/the".repeat("\", 7)."\", 'tx') + call assert_equal(' 9 these', getline('.')) + :1 + " no further match + call feedkeys("/the".repeat("\", 8)."\", 'tx') + call assert_equal(' 9 these', getline('.')) + + " Test 3 + " Ctrl-N goes from one match to the next + " and continues back at the top + set incsearch wrapscan + :1 + " first match + call feedkeys("/the\", 'tx') + call assert_equal(' 2 these', getline('.')) + :1 + " second match + call feedkeys("/the\\", 'tx') + call assert_equal(' 3 the', getline('.')) + :1 + " third match + call feedkeys("/the".repeat("\", 2)."\", 'tx') + call assert_equal(' 4 their', getline('.')) + :1 + " fourth match + call feedkeys("/the".repeat("\", 3)."\", 'tx') + call assert_equal(' 5 there', getline('.')) + :1 + " fifth match + call feedkeys("/the".repeat("\", 4)."\", 'tx') + call assert_equal(' 6 their', getline('.')) + :1 + " sixth match + call feedkeys("/the".repeat("\", 5)."\", 'tx') + call assert_equal(' 7 the', getline('.')) + :1 + " seventh match + call feedkeys("/the".repeat("\", 6)."\", 'tx') + call assert_equal(' 8 them', getline('.')) + :1 + " eigth match + call feedkeys("/the".repeat("\", 7)."\", 'tx') + call assert_equal(' 9 these', getline('.')) + :1 + " back at first match + call feedkeys("/the".repeat("\", 8)."\", 'tx') + call assert_equal(' 2 these', getline('.')) + + " Test 4 + " CTRL-P goes to the previous match + set incsearch nowrapscan + $ + " first match + call feedkeys("?the\", 'tx') + call assert_equal(' 9 these', getline('.')) + $ + " first match + call feedkeys("?the\\", 'tx') + call assert_equal(' 9 these', getline('.')) + $ + " second match + call feedkeys("?the".repeat("\", 1)."\", 'tx') + call assert_equal(' 8 them', getline('.')) + $ + " last match + call feedkeys("?the".repeat("\", 7)."\", 'tx') + call assert_equal(' 2 these', getline('.')) + $ + " last match + call feedkeys("?the".repeat("\", 8)."\", 'tx') + call assert_equal(' 2 these', getline('.')) + + " Test 5 + " CTRL-P goes to the previous match + set incsearch wrapscan + $ + " first match + call feedkeys("?the\", 'tx') + call assert_equal(' 9 these', getline('.')) + $ + " first match at the top + call feedkeys("?the\\", 'tx') + call assert_equal(' 2 these', getline('.')) + $ + " second match + call feedkeys("?the".repeat("\", 1)."\", 'tx') + call assert_equal(' 8 them', getline('.')) + $ + " last match + call feedkeys("?the".repeat("\", 7)."\", 'tx') + call assert_equal(' 2 these', getline('.')) + $ + " back at the bottom of the buffer + call feedkeys("?the".repeat("\", 8)."\", 'tx') + call assert_equal(' 9 these', getline('.')) + + " Test 6 + " CTRL-L adds to the search pattern + set incsearch wrapscan + 1 + " first match + call feedkeys("/the\\", 'tx') + call assert_equal(' 2 these', getline('.')) + 1 + " go to next match of 'thes' + call feedkeys("/the\\\", 'tx') + call assert_equal(' 9 these', getline('.')) + 1 + " wrap around + call feedkeys("/the\\\\", 'tx') + call assert_equal(' 2 these', getline('.')) + 1 + " wrap around + set nowrapscan + call feedkeys("/the\\\\", 'tx') + call assert_equal(' 9 these', getline('.')) + + " Test 7 + " remove from match, but stay at current match + set incsearch wrapscan + 1 + " first match + call feedkeys("/thei\", 'tx') + call assert_equal(' 4 their', getline('.')) + 1 + " delete one char, add another + call feedkeys("/thei\s\", 'tx') + call assert_equal(' 9 these', getline('.')) + 1 + " delete one char, add another, go to previous match, add one char + call feedkeys("/thei\s\\\\", 'tx') + call assert_equal(' 8 them', getline('.')) + 1 + " delete all chars, start from the beginning again + call feedkeys("/them". repeat("\",4).'the\>'."\", 'tx') + call assert_equal(' 3 the', getline('.')) + + " clean up + call test_disable_char_avail(0) + bw! +endfunc + +func Test_search_cmdline2() + throw 'skipped: Nvim does not support test_disable_char_avail()' + if !exists('+incsearch') + return + endif + " need to disable char_avail, + " so that expansion of commandline works + call test_disable_char_avail(1) + new + call setline(1, [' 1', ' 2 these', ' 3 the theother']) + " Test 1 + " Ctrl-P goes correctly back and forth + set incsearch + 1 + " first match + call feedkeys("/the\", 'tx') + call assert_equal(' 2 these', getline('.')) + 1 + " go to next match (on next line) + call feedkeys("/the\\", 'tx') + call assert_equal(' 3 the theother', getline('.')) + 1 + " go to next match (still on line 3) + call feedkeys("/the\\\", 'tx') + call assert_equal(' 3 the theother', getline('.')) + 1 + " go to next match (still on line 3) + call feedkeys("/the\\\\", 'tx') + call assert_equal(' 3 the theother', getline('.')) + 1 + " go to previous match (on line 3) + call feedkeys("/the\\\\\", 'tx') + call assert_equal(' 3 the theother', getline('.')) + 1 + " go to previous match (on line 3) + call feedkeys("/the\\\\\\", 'tx') + call assert_equal(' 3 the theother', getline('.')) + 1 + " go to previous match (on line 2) + call feedkeys("/the\\\\\\\", 'tx') + call assert_equal(' 2 these', getline('.')) + + " clean up + call test_disable_char_avail(0) + bw! +endfunc + func Test_use_sub_pat() split let @/ = '' diff --git a/src/nvim/version.c b/src/nvim/version.c index a28dbcf061..dceceb46ad 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -185,7 +185,7 @@ static const int included_patches[] = { // 2262 NA // 2261 NA // 2260 NA - // 2259, + 2259, // 2258 NA // 2257 NA 2256, From 1ef2d768e71981e4429376a0cb25dbed14dfae52 Mon Sep 17 00:00:00 2001 From: David Galeano Date: Tue, 27 Jun 2017 01:09:49 +0100 Subject: [PATCH 071/161] socket.c: Disable Nagle's algorithm on TCP sockets (#6915) Reducing latency is more interesting than optimizing bandwidth for Nvim's typical use-cases. --- src/nvim/event/socket.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nvim/event/socket.c b/src/nvim/event/socket.c index 30a71a5586..a796f303ab 100644 --- a/src/nvim/event/socket.c +++ b/src/nvim/event/socket.c @@ -66,6 +66,7 @@ int socket_watcher_init(Loop *loop, SocketWatcher *watcher, watcher->uv.tcp.addrinfo = request.addrinfo; uv_tcp_init(&loop->uv, &watcher->uv.tcp.handle); + uv_tcp_nodelay(&watcher->uv.tcp.handle, true); watcher->stream = STRUCT_CAST(uv_stream_t, &watcher->uv.tcp.handle); } else { uv_pipe_init(&loop->uv, &watcher->uv.pipe.handle, 0); @@ -146,6 +147,7 @@ int socket_watcher_accept(SocketWatcher *watcher, Stream *stream) if (watcher->stream->type == UV_TCP) { client = STRUCT_CAST(uv_stream_t, &stream->uv.tcp); uv_tcp_init(watcher->uv.tcp.handle.loop, (uv_tcp_t *)client); + uv_tcp_nodelay((uv_tcp_t *)client, true); } else { client = STRUCT_CAST(uv_stream_t, &stream->uv.pipe); uv_pipe_init(watcher->uv.pipe.handle.loop, (uv_pipe_t *)client, 0); @@ -237,6 +239,7 @@ bool socket_connect(Loop *loop, Stream *stream, tcp_retry: uv_tcp_init(&loop->uv, tcp); + uv_tcp_nodelay(tcp, true); uv_tcp_connect(&req, tcp, addrinfo->ai_addr, connect_cb); uv_stream = (uv_stream_t *)tcp; From 518b42db916ccbb9057ca9361b48e83ea65bc3b9 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Wed, 14 Jun 2017 22:51:50 -0400 Subject: [PATCH 072/161] functests/legacy: Add lua version of test_search.vim --- src/nvim/testdir/test_search.vim | 2 + test/functional/legacy/search_spec.lua | 392 +++++++++++++++++++++++++ 2 files changed, 394 insertions(+) create mode 100644 test/functional/legacy/search_spec.lua diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim index 9c29236ac9..1398cc4d4e 100644 --- a/src/nvim/testdir/test_search.vim +++ b/src/nvim/testdir/test_search.vim @@ -1,6 +1,7 @@ " Test for the search command func Test_search_cmdline() + " See test/functional/legacy/search_spec.lua throw 'skipped: Nvim does not support test_disable_char_avail()' if !exists('+incsearch') return @@ -197,6 +198,7 @@ func Test_search_cmdline() endfunc func Test_search_cmdline2() + " See test/functional/legacy/search_spec.lua throw 'skipped: Nvim does not support test_disable_char_avail()' if !exists('+incsearch') return diff --git a/test/functional/legacy/search_spec.lua b/test/functional/legacy/search_spec.lua new file mode 100644 index 0000000000..4f03369269 --- /dev/null +++ b/test/functional/legacy/search_spec.lua @@ -0,0 +1,392 @@ +local helpers = require('test.functional.helpers')(after_each) +local Screen = require('test.functional.ui.screen') +local clear = helpers.clear +local command = helpers.command +local eq = helpers.eq +local eval = helpers.eval +local feed = helpers.feed +local funcs = helpers.funcs + +describe('search cmdline', function() + local screen + + before_each(function() + clear() + command('set nohlsearch') + screen = Screen.new(20, 3) + screen:attach() + screen:set_default_attr_ids({ + inc = {reverse = true} + }) + end) + + local function tenlines() + funcs.setline(1, { + ' 1', ' 2 these', ' 3 the', ' 4 their', ' 5 there', + ' 6 their', ' 7 the', ' 8 them', ' 9 these', ' 10 foobar' + }) + command('1') + end + + it('history can be navigated with /', function() + tenlines() + command('set noincsearch') + feed('/foobar') + feed('/the') + eq('the', eval('@/')) + feed('/thes') + eq('foobar', eval('@/')) + end) + + describe('can traverse matches', function() + before_each(tenlines) + local function forwarditer(wrapscan) + command('set incsearch '..wrapscan) + feed('/the') + screen:expect([[ + 1 | + 2 {inc:the}se | + /the^ | + ]]) + feed('') + screen:expect([[ + 2 these | + 3 {inc:the} | + /the^ | + ]]) + feed('') + screen:expect([[ + 3 the | + 4 {inc:the}ir | + /the^ | + ]]) + feed('') + screen:expect([[ + 4 their | + 5 {inc:the}re | + /the^ | + ]]) + feed('') + screen:expect([[ + 5 there | + 6 {inc:the}ir | + /the^ | + ]]) + feed('') + screen:expect([[ + 6 their | + 7 {inc:the} | + /the^ | + ]]) + feed('') + screen:expect([[ + 7 the | + 8 {inc:the}m | + /the^ | + ]]) + feed('') + screen:expect([[ + 8 them | + 9 {inc:the}se | + /the^ | + ]]) + feed('') + if wrapscan == 'wrapscan' then + screen:expect([[ + 2 {inc:the}se | + 3 the | + /the^ | + ]]) + else + screen:expect([[ + 8 them | + 9 {inc:the}se | + /the^ | + ]]) + end + end + + local function backiter(wrapscan) + command('set incsearch '..wrapscan) + command('$') + + feed('?the') + screen:expect([[ + 9 {inc:the}se | + 10 foobar | + ?the^ | + ]]) + if wrapscan == 'wrapscan' then + feed('') + screen:expect([[ + 2 {inc:the}se | + 3 the | + ?the^ | + ]]) + feed('') + screen:expect([[ + 2 ^these | + 3 the | + ?the | + ]]) + else + feed('') + screen:expect([[ + 9 {inc:the}se | + 10 foobar | + ?the^ | + ]]) + feed('') + screen:expect([[ + 9 ^these | + 10 foobar | + ?the | + ]]) + end + command('$') + feed('?the') + screen:expect([[ + 9 {inc:the}se | + 10 foobar | + ?the^ | + ]]) + feed('') + screen:expect([[ + 8 {inc:the}m | + 9 these | + ?the^ | + ]]) + for i = 1, 6 do + feed('') + -- Avoid sleep just before expect, otherwise expect will take the full + -- timeout + if i ~= 6 then + screen:sleep(1) + end + end + screen:expect([[ + 2 {inc:the}se | + 3 the | + ?the^ | + ]]) + feed('') + if wrapscan == 'wrapscan' then + screen:expect([[ + 9 {inc:the}se | + 10 foobar | + ?the^ | + ]]) + else + screen:expect([[ + 2 {inc:the}se | + 3 the | + ?the^ | + ]]) + end + end + + it("using and 'nowrapscan'", function() + forwarditer('nowrapscan') + end) + + it("using and 'wrapscan'", function() + forwarditer('wrapscan') + end) + + it("using and 'nowrapscan'", function() + backiter('nowrapscan') + end) + + it("using and 'wrapscan'", function() + backiter('wrapscan') + end) + end) + + it('expands pattern with ', function() + tenlines() + command('set incsearch wrapscan') + + feed('/the') + screen:expect([[ + 1 | + 2 {inc:the}se | + /the^ | + ]]) + feed('') + screen:expect([[ + 1 | + 2 {inc:thes}e | + /thes^ | + ]]) + feed('') + screen:expect([[ + 9 {inc:thes}e | + 10 foobar | + /thes^ | + ]]) + feed('') + screen:expect([[ + 2 {inc:thes}e | + 3 the | + /thes^ | + ]]) + feed('') + screen:expect([[ + 2 ^these | + 3 the | + /thes | + ]]) + + command('1') + command('set nowrapscan') + feed('/the') + screen:expect([[ + 1 | + 2 {inc:the}se | + /the^ | + ]]) + feed('') + screen:expect([[ + 1 | + 2 {inc:thes}e | + /thes^ | + ]]) + feed('') + screen:expect([[ + 9 {inc:thes}e | + 10 foobar | + /thes^ | + ]]) + feed('') + screen:expect([[ + 9 ^these | + 10 foobar | + /thes | + ]]) + end) + + it('reduces pattern with and keeps cursor position', function() + tenlines() + command('set incsearch wrapscan') + + -- First match + feed('/thei') + screen:expect([[ + 4 {inc:thei}r | + 5 there | + /thei^ | + ]]) + -- Stay on this match when deleting a character + feed('') + screen:expect([[ + 4 {inc:the}ir | + 5 there | + /the^ | + ]]) + -- New text advances to next match + feed('s') + screen:expect([[ + 9 {inc:thes}e | + 10 foobar | + /thes^ | + ]]) + -- Stay on this match when deleting a character + feed('') + screen:expect([[ + 9 {inc:the}se | + 10 foobar | + /the^ | + ]]) + -- Advance to previous match + feed('') + screen:expect([[ + 8 {inc:the}m | + 9 these | + /the^ | + ]]) + -- Extend search to include next character + feed('') + screen:expect([[ + 8 {inc:them} | + 9 these | + /them^ | + ]]) + -- Deleting all characters resets the cursor position + feed('') + screen:expect([[ + 1 | + 2 these | + /^ | + ]]) + feed('the') + screen:expect([[ + 2 {inc:the}se | + 3 the | + /the^ | + ]]) + feed('\\>') + screen:expect([[ + 3 {inc:the} | + 4 their | + /the\>^ | + ]]) + end) + + it('can traverse matches in the same line with /', function() + funcs.setline(1, { ' 1', ' 2 these', ' 3 the theother' }) + command('1') + command('set incsearch') + + -- First match + feed('/the') + screen:expect([[ + 1 | + 2 {inc:the}se | + /the^ | + ]]) + + -- Next match, different line + feed('') + screen:expect([[ + 2 these | + 3 {inc:the} theother | + /the^ | + ]]) + + -- Next match, same line + feed('') + screen:expect([[ + 2 these | + 3 the {inc:the}other | + /the^ | + ]]) + feed('') + screen:expect([[ + 2 these | + 3 the theo{inc:the}r | + /the^ | + ]]) + + -- Previous match, same line + feed('') + screen:expect([[ + 2 these | + 3 the {inc:the}other | + /the^ | + ]]) + feed('') + screen:expect([[ + 2 these | + 3 {inc:the} theother | + /the^ | + ]]) + + -- Previous match, different line + feed('') + screen:expect([[ + 2 {inc:the}se | + 3 the theother | + /the^ | + ]]) + end) +end) From 0dd64556590633b2cab7cd846b28bbf5f7ef35d4 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sun, 25 Jun 2017 11:01:16 -0400 Subject: [PATCH 073/161] vim-patch:7.4.2268 Problem: Using CTRL-N and CTRL-P for incsearch shadows completion keys. Solution: Use CTRL-T and CTRL-G instead. https://github.com/vim/vim/commit/1195669f9e434fa9ab8b57ee9470bf951e4990b8 --- runtime/doc/cmdline.txt | 21 ++-- src/nvim/ex_getln.c | 128 +++++++++++++------------ src/nvim/testdir/test_search.vim | 80 ++++++++-------- src/nvim/version.c | 2 +- test/functional/legacy/search_spec.lua | 58 +++++------ 5 files changed, 149 insertions(+), 140 deletions(-) diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index ef8f4bc317..d870a72600 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -376,18 +376,10 @@ CTRL-D List names that match the pattern in front of the cursor. *c_CTRL-N* CTRL-N After using 'wildchar' which got multiple matches, go to next match. Otherwise recall more recent command-line from history. - */_CTRL-N* - When 'incsearch' is set, entering a search pattern for "/" or - "?" and the current match is displayed then CTRL-N will move - to the next match (does not take |search-offset| into account) *c_CTRL-P* *c_* CTRL-P After using 'wildchar' which got multiple matches, go to previous match. Otherwise recall older command-line from history. only works with the GUI. - */_CTRL-P* - When 'incsearch' is set, entering a search pattern for "/" or - "?" and the current match is displayed then CTRL-P will move - to the previous match (does not take |search-offset| into account). *c_CTRL-A* CTRL-A All names that match the pattern in front of the cursor are inserted. @@ -404,6 +396,19 @@ CTRL-L A match is done on the pattern in front of the cursor. If 'ignorecase' and 'smartcase' are set and the command line has no uppercase characters, the added character is converted to lowercase. + *c_CTRL-G* */_CTRL-G* +CTRL-G When 'incsearch' is set, entering a search pattern for "/" or + "?" and the current match is displayed then CTRL-G will move + to the next match (does not take |search-offset| into account) + Use CTRL-T to move to the previous match. Hint: on a regular + keyboard T is above G. + *c_CTRL-T* */_CTRL-T* +CTRL-T When 'incsearch' is set, entering a search pattern for "/" or + "?" and the current match is displayed then CTRL-T will move + to the previous match (does not take |search-offset| into + account). + Use CTRL-G to move to the next match. Hint: on a regular + keyboard T is above G. The 'wildchar' option defaults to (CTRL-E when in Vi compatible mode; in a previous version was used). In the pattern standard wildcards '*' and diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index efa8cd24bc..62f802fb8f 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -1282,72 +1282,12 @@ static int command_line_handle_key(CommandLineState *s) case Ctrl_N: // next match case Ctrl_P: // previous match - if (p_is && !cmd_silent && (s->firstc == '/' || s->firstc == '?')) { - pos_T t; - int search_flags = SEARCH_KEEP + SEARCH_NOOF + SEARCH_PEEK; - - if (char_avail()) { - return 1; - } - ui_busy_start(); - ui_flush(); - if (s->c == Ctrl_N) { - t = s->match_end; - search_flags += SEARCH_COL; - } else { - t = s->match_start; - } - emsg_off++; - s->i = searchit(curwin, curbuf, &t, - s->c == Ctrl_N ? FORWARD : BACKWARD, - ccline.cmdbuff, s->count, search_flags, - RE_SEARCH, 0, NULL); - emsg_off--; - ui_busy_stop(); - if (s->i) { - s->old_cursor = s->match_start; - s->match_end = t; - s->match_start = t; - if (s->c == Ctrl_P && s->firstc == '/') { - // move just before the current match, so that - // when nv_search finishes the cursor will be - // put back on the match - s->old_cursor = t; - (void)decl(&s->old_cursor); - } - if (lt(t, s->old_cursor) && s->c == Ctrl_N) { - // wrap around - s->old_cursor = t; - if (s->firstc == '?') { - (void)incl(&s->old_cursor); - } else { - (void)decl(&s->old_cursor); - } - } - - set_search_match(&s->match_end); - curwin->w_cursor = s->match_start; - changed_cline_bef_curs(); - update_topline(); - validate_cursor(); - highlight_match = true; - s->old_curswant = curwin->w_curswant; - s->old_leftcol = curwin->w_leftcol; - s->old_topline = curwin->w_topline; - s->old_topfill = curwin->w_topfill; - s->old_botline = curwin->w_botline; - update_screen(NOT_VALID); - redrawcmdline(); - } else { - vim_beep(BO_ERROR); - } - return command_line_not_changed(s); - } else if (s->xpc.xp_numfiles > 0) { + if (s->xpc.xp_numfiles > 0) { if (nextwild(&s->xpc, (s->c == Ctrl_P) ? WILD_PREV : WILD_NEXT, 0, s->firstc != '@') == FAIL) { break; } - return command_line_changed(s); + return command_line_not_changed(s); } // fallthrough @@ -1488,6 +1428,70 @@ static int command_line_handle_key(CommandLineState *s) beep_flush(); return command_line_not_changed(s); + case Ctrl_G: // next match + case Ctrl_T: // previous match + if (p_is && !cmd_silent && (s->firstc == '/' || s->firstc == '?')) { + pos_T t; + int search_flags = SEARCH_KEEP + SEARCH_NOOF + SEARCH_PEEK; + + if (char_avail()) { + return 1; + } + ui_busy_start(); + ui_flush(); + if (s->c == Ctrl_G) { + t = s->match_end; + search_flags += SEARCH_COL; + } else { + t = s->match_start; + } + emsg_off++; + s->i = searchit(curwin, curbuf, &t, + s->c == Ctrl_G ? FORWARD : BACKWARD, + ccline.cmdbuff, s->count, search_flags, + RE_SEARCH, 0, NULL); + emsg_off--; + ui_busy_stop(); + if (s->i) { + s->old_cursor = s->match_start; + s->match_end = t; + s->match_start = t; + if (s->c == Ctrl_T && s->firstc == '/') { + // move just before the current match, so that + // when nv_search finishes the cursor will be + // put back on the match + s->old_cursor = t; + (void)decl(&s->old_cursor); + } + if (lt(t, s->old_cursor) && s->c == Ctrl_G) { + // wrap around + s->old_cursor = t; + if (s->firstc == '?') { + (void)incl(&s->old_cursor); + } else { + (void)decl(&s->old_cursor); + } + } + + set_search_match(&s->match_end); + curwin->w_cursor = s->match_start; + changed_cline_bef_curs(); + update_topline(); + validate_cursor(); + highlight_match = true; + s->old_curswant = curwin->w_curswant; + s->old_leftcol = curwin->w_leftcol; + s->old_topline = curwin->w_topline; + s->old_topfill = curwin->w_topfill; + s->old_botline = curwin->w_botline; + update_screen(NOT_VALID); + redrawcmdline(); + } else { + vim_beep(BO_ERROR); + } + } + return command_line_not_changed(s); + case Ctrl_V: case Ctrl_Q: s->ignore_drag_release = true; diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim index 1398cc4d4e..28e504a883 100644 --- a/src/nvim/testdir/test_search.vim +++ b/src/nvim/testdir/test_search.vim @@ -18,11 +18,11 @@ func Test_search_cmdline() call feedkeys("/foobar\", 'tx') call feedkeys("/the\",'tx') call assert_equal('the', @/) - call feedkeys("/thes\\\",'tx') + call feedkeys("/thes\\\",'tx') call assert_equal('foobar', @/) " Test 2 - " Ctrl-N goes from one match to the next + " Ctrl-G goes from one match to the next " until the end of the buffer set incsearch nowrapscan :1 @@ -31,39 +31,39 @@ func Test_search_cmdline() call assert_equal(' 2 these', getline('.')) :1 " second match - call feedkeys("/the\\", 'tx') + call feedkeys("/the\\", 'tx') call assert_equal(' 3 the', getline('.')) :1 " third match - call feedkeys("/the".repeat("\", 2)."\", 'tx') + call feedkeys("/the".repeat("\", 2)."\", 'tx') call assert_equal(' 4 their', getline('.')) :1 " fourth match - call feedkeys("/the".repeat("\", 3)."\", 'tx') + call feedkeys("/the".repeat("\", 3)."\", 'tx') call assert_equal(' 5 there', getline('.')) :1 " fifth match - call feedkeys("/the".repeat("\", 4)."\", 'tx') + call feedkeys("/the".repeat("\", 4)."\", 'tx') call assert_equal(' 6 their', getline('.')) :1 " sixth match - call feedkeys("/the".repeat("\", 5)."\", 'tx') + call feedkeys("/the".repeat("\", 5)."\", 'tx') call assert_equal(' 7 the', getline('.')) :1 " seventh match - call feedkeys("/the".repeat("\", 6)."\", 'tx') + call feedkeys("/the".repeat("\", 6)."\", 'tx') call assert_equal(' 8 them', getline('.')) :1 " eigth match - call feedkeys("/the".repeat("\", 7)."\", 'tx') + call feedkeys("/the".repeat("\", 7)."\", 'tx') call assert_equal(' 9 these', getline('.')) :1 " no further match - call feedkeys("/the".repeat("\", 8)."\", 'tx') + call feedkeys("/the".repeat("\", 8)."\", 'tx') call assert_equal(' 9 these', getline('.')) " Test 3 - " Ctrl-N goes from one match to the next + " Ctrl-G goes from one match to the next " and continues back at the top set incsearch wrapscan :1 @@ -72,39 +72,39 @@ func Test_search_cmdline() call assert_equal(' 2 these', getline('.')) :1 " second match - call feedkeys("/the\\", 'tx') + call feedkeys("/the\\", 'tx') call assert_equal(' 3 the', getline('.')) :1 " third match - call feedkeys("/the".repeat("\", 2)."\", 'tx') + call feedkeys("/the".repeat("\", 2)."\", 'tx') call assert_equal(' 4 their', getline('.')) :1 " fourth match - call feedkeys("/the".repeat("\", 3)."\", 'tx') + call feedkeys("/the".repeat("\", 3)."\", 'tx') call assert_equal(' 5 there', getline('.')) :1 " fifth match - call feedkeys("/the".repeat("\", 4)."\", 'tx') + call feedkeys("/the".repeat("\", 4)."\", 'tx') call assert_equal(' 6 their', getline('.')) :1 " sixth match - call feedkeys("/the".repeat("\", 5)."\", 'tx') + call feedkeys("/the".repeat("\", 5)."\", 'tx') call assert_equal(' 7 the', getline('.')) :1 " seventh match - call feedkeys("/the".repeat("\", 6)."\", 'tx') + call feedkeys("/the".repeat("\", 6)."\", 'tx') call assert_equal(' 8 them', getline('.')) :1 " eigth match - call feedkeys("/the".repeat("\", 7)."\", 'tx') + call feedkeys("/the".repeat("\", 7)."\", 'tx') call assert_equal(' 9 these', getline('.')) :1 " back at first match - call feedkeys("/the".repeat("\", 8)."\", 'tx') + call feedkeys("/the".repeat("\", 8)."\", 'tx') call assert_equal(' 2 these', getline('.')) " Test 4 - " CTRL-P goes to the previous match + " CTRL-T goes to the previous match set incsearch nowrapscan $ " first match @@ -112,23 +112,23 @@ func Test_search_cmdline() call assert_equal(' 9 these', getline('.')) $ " first match - call feedkeys("?the\\", 'tx') + call feedkeys("?the\\", 'tx') call assert_equal(' 9 these', getline('.')) $ " second match - call feedkeys("?the".repeat("\", 1)."\", 'tx') + call feedkeys("?the".repeat("\", 1)."\", 'tx') call assert_equal(' 8 them', getline('.')) $ " last match - call feedkeys("?the".repeat("\", 7)."\", 'tx') + call feedkeys("?the".repeat("\", 7)."\", 'tx') call assert_equal(' 2 these', getline('.')) $ " last match - call feedkeys("?the".repeat("\", 8)."\", 'tx') + call feedkeys("?the".repeat("\", 8)."\", 'tx') call assert_equal(' 2 these', getline('.')) " Test 5 - " CTRL-P goes to the previous match + " CTRL-T goes to the previous match set incsearch wrapscan $ " first match @@ -136,19 +136,19 @@ func Test_search_cmdline() call assert_equal(' 9 these', getline('.')) $ " first match at the top - call feedkeys("?the\\", 'tx') + call feedkeys("?the\\", 'tx') call assert_equal(' 2 these', getline('.')) $ " second match - call feedkeys("?the".repeat("\", 1)."\", 'tx') + call feedkeys("?the".repeat("\", 1)."\", 'tx') call assert_equal(' 8 them', getline('.')) $ " last match - call feedkeys("?the".repeat("\", 7)."\", 'tx') + call feedkeys("?the".repeat("\", 7)."\", 'tx') call assert_equal(' 2 these', getline('.')) $ " back at the bottom of the buffer - call feedkeys("?the".repeat("\", 8)."\", 'tx') + call feedkeys("?the".repeat("\", 8)."\", 'tx') call assert_equal(' 9 these', getline('.')) " Test 6 @@ -160,16 +160,16 @@ func Test_search_cmdline() call assert_equal(' 2 these', getline('.')) 1 " go to next match of 'thes' - call feedkeys("/the\\\", 'tx') + call feedkeys("/the\\\", 'tx') call assert_equal(' 9 these', getline('.')) 1 " wrap around - call feedkeys("/the\\\\", 'tx') + call feedkeys("/the\\\\", 'tx') call assert_equal(' 2 these', getline('.')) 1 " wrap around set nowrapscan - call feedkeys("/the\\\\", 'tx') + call feedkeys("/the\\\\", 'tx') call assert_equal(' 9 these', getline('.')) " Test 7 @@ -185,7 +185,7 @@ func Test_search_cmdline() call assert_equal(' 9 these', getline('.')) 1 " delete one char, add another, go to previous match, add one char - call feedkeys("/thei\s\\\\", 'tx') + call feedkeys("/thei\s\\\\", 'tx') call assert_equal(' 8 them', getline('.')) 1 " delete all chars, start from the beginning again @@ -209,7 +209,7 @@ func Test_search_cmdline2() new call setline(1, [' 1', ' 2 these', ' 3 the theother']) " Test 1 - " Ctrl-P goes correctly back and forth + " Ctrl-T goes correctly back and forth set incsearch 1 " first match @@ -217,27 +217,27 @@ func Test_search_cmdline2() call assert_equal(' 2 these', getline('.')) 1 " go to next match (on next line) - call feedkeys("/the\\", 'tx') + call feedkeys("/the\\", 'tx') call assert_equal(' 3 the theother', getline('.')) 1 " go to next match (still on line 3) - call feedkeys("/the\\\", 'tx') + call feedkeys("/the\\\", 'tx') call assert_equal(' 3 the theother', getline('.')) 1 " go to next match (still on line 3) - call feedkeys("/the\\\\", 'tx') + call feedkeys("/the\\\\", 'tx') call assert_equal(' 3 the theother', getline('.')) 1 " go to previous match (on line 3) - call feedkeys("/the\\\\\", 'tx') + call feedkeys("/the\\\\\", 'tx') call assert_equal(' 3 the theother', getline('.')) 1 " go to previous match (on line 3) - call feedkeys("/the\\\\\\", 'tx') + call feedkeys("/the\\\\\\", 'tx') call assert_equal(' 3 the theother', getline('.')) 1 " go to previous match (on line 2) - call feedkeys("/the\\\\\\\", 'tx') + call feedkeys("/the\\\\\\\", 'tx') call assert_equal(' 2 these', getline('.')) " clean up diff --git a/src/nvim/version.c b/src/nvim/version.c index dceceb46ad..23c2fac28a 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -176,7 +176,7 @@ static const int included_patches[] = { // 2271 NA // 2270 NA 2269, - // 2268, + 2268, // 2267 NA 2266, 2265, diff --git a/test/functional/legacy/search_spec.lua b/test/functional/legacy/search_spec.lua index 4f03369269..36c91accd6 100644 --- a/test/functional/legacy/search_spec.lua +++ b/test/functional/legacy/search_spec.lua @@ -48,49 +48,49 @@ describe('search cmdline', function() 2 {inc:the}se | /the^ | ]]) - feed('') + feed('') screen:expect([[ 2 these | 3 {inc:the} | /the^ | ]]) - feed('') + feed('') screen:expect([[ 3 the | 4 {inc:the}ir | /the^ | ]]) - feed('') + feed('') screen:expect([[ 4 their | 5 {inc:the}re | /the^ | ]]) - feed('') + feed('') screen:expect([[ 5 there | 6 {inc:the}ir | /the^ | ]]) - feed('') + feed('') screen:expect([[ 6 their | 7 {inc:the} | /the^ | ]]) - feed('') + feed('') screen:expect([[ 7 the | 8 {inc:the}m | /the^ | ]]) - feed('') + feed('') screen:expect([[ 8 them | 9 {inc:the}se | /the^ | ]]) - feed('') + feed('') if wrapscan == 'wrapscan' then screen:expect([[ 2 {inc:the}se | @@ -117,7 +117,7 @@ describe('search cmdline', function() ?the^ | ]]) if wrapscan == 'wrapscan' then - feed('') + feed('') screen:expect([[ 2 {inc:the}se | 3 the | @@ -130,7 +130,7 @@ describe('search cmdline', function() ?the | ]]) else - feed('') + feed('') screen:expect([[ 9 {inc:the}se | 10 foobar | @@ -150,14 +150,14 @@ describe('search cmdline', function() 10 foobar | ?the^ | ]]) - feed('') + feed('') screen:expect([[ 8 {inc:the}m | 9 these | ?the^ | ]]) for i = 1, 6 do - feed('') + feed('') -- Avoid sleep just before expect, otherwise expect will take the full -- timeout if i ~= 6 then @@ -169,7 +169,7 @@ describe('search cmdline', function() 3 the | ?the^ | ]]) - feed('') + feed('') if wrapscan == 'wrapscan' then screen:expect([[ 9 {inc:the}se | @@ -185,19 +185,19 @@ describe('search cmdline', function() end end - it("using and 'nowrapscan'", function() + it("using and 'nowrapscan'", function() forwarditer('nowrapscan') end) - it("using and 'wrapscan'", function() + it("using and 'wrapscan'", function() forwarditer('wrapscan') end) - it("using and 'nowrapscan'", function() + it("using and 'nowrapscan'", function() backiter('nowrapscan') end) - it("using and 'wrapscan'", function() + it("using and 'wrapscan'", function() backiter('wrapscan') end) end) @@ -218,13 +218,13 @@ describe('search cmdline', function() 2 {inc:thes}e | /thes^ | ]]) - feed('') + feed('') screen:expect([[ 9 {inc:thes}e | 10 foobar | /thes^ | ]]) - feed('') + feed('') screen:expect([[ 2 {inc:thes}e | 3 the | @@ -251,13 +251,13 @@ describe('search cmdline', function() 2 {inc:thes}e | /thes^ | ]]) - feed('') + feed('') screen:expect([[ 9 {inc:thes}e | 10 foobar | /thes^ | ]]) - feed('') + feed('') screen:expect([[ 9 ^these | 10 foobar | @@ -298,7 +298,7 @@ describe('search cmdline', function() /the^ | ]]) -- Advance to previous match - feed('') + feed('') screen:expect([[ 8 {inc:the}m | 9 these | @@ -332,7 +332,7 @@ describe('search cmdline', function() ]]) end) - it('can traverse matches in the same line with /', function() + it('can traverse matches in the same line with /', function() funcs.setline(1, { ' 1', ' 2 these', ' 3 the theother' }) command('1') command('set incsearch') @@ -346,7 +346,7 @@ describe('search cmdline', function() ]]) -- Next match, different line - feed('') + feed('') screen:expect([[ 2 these | 3 {inc:the} theother | @@ -354,13 +354,13 @@ describe('search cmdline', function() ]]) -- Next match, same line - feed('') + feed('') screen:expect([[ 2 these | 3 the {inc:the}other | /the^ | ]]) - feed('') + feed('') screen:expect([[ 2 these | 3 the theo{inc:the}r | @@ -368,13 +368,13 @@ describe('search cmdline', function() ]]) -- Previous match, same line - feed('') + feed('') screen:expect([[ 2 these | 3 the {inc:the}other | /the^ | ]]) - feed('') + feed('') screen:expect([[ 2 these | 3 {inc:the} theother | @@ -382,7 +382,7 @@ describe('search cmdline', function() ]]) -- Previous match, different line - feed('') + feed('') screen:expect([[ 2 {inc:the}se | 3 the theother | From 3679752dbd9191f4067a43143da637478cc389f1 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sun, 25 Jun 2017 12:11:22 -0400 Subject: [PATCH 074/161] vim-patch:7.4.2318 Problem: When 'incsearch' is not set CTRL-T and CTRL-G are not inserted as before. Solution: Move vim/vim#ifdef and don't use goto. https://github.com/vim/vim/commit/349e7d94e6bbb253bb87adad9039f095128ab543 --- src/nvim/ex_getln.c | 3 ++- src/nvim/version.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 62f802fb8f..45fff4f9d7 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -1489,8 +1489,9 @@ static int command_line_handle_key(CommandLineState *s) } else { vim_beep(BO_ERROR); } + return command_line_not_changed(s); } - return command_line_not_changed(s); + break; case Ctrl_V: case Ctrl_Q: diff --git a/src/nvim/version.c b/src/nvim/version.c index 23c2fac28a..5a107f0023 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -126,7 +126,7 @@ static const int included_patches[] = { 2321, // 2320, // 2319 NA - // 2318, + 2318, 2317, // 2316 NA 2315, From 54d5e90a2b87736a3248300ed423374e88ce8e79 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sun, 25 Jun 2017 12:15:58 -0400 Subject: [PATCH 075/161] vim-patch:7.4.2320 Problem: Redraw problem when using 'incsearch'. Solution: Save the current view when deleting characters. (Christian Brabandt) Fix that the '" mark is set in the wrong position. Don't change the search start when using BS. https://github.com/vim/vim/commit/dda933d06c06c2792bd686d059f6ad19191ad30b --- src/nvim/ex_getln.c | 63 +++++++++----- src/nvim/normal.c | 6 +- src/nvim/testdir/test_search.vim | 32 ++++++- src/nvim/version.c | 2 +- test/functional/legacy/search_spec.lua | 110 +++++++++++++++++++++---- 5 files changed, 174 insertions(+), 39 deletions(-) diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 45fff4f9d7..e8f9d9bf47 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -100,13 +100,18 @@ typedef struct command_line_state { char_u *lookfor; // string to match int hiscnt; // current history line in use int histype; // history type to be used - pos_T old_cursor; + pos_T search_start; // where 'incsearch' starts searching + pos_T save_cursor; colnr_T old_curswant; + colnr_T init_curswant; colnr_T old_leftcol; + colnr_T init_leftcol; linenr_T old_topline; + linenr_T init_topline; int old_topfill; + int init_topfill; linenr_T old_botline; - pos_T cursor_start; + linenr_T init_botline; pos_T match_start; pos_T match_end; int did_incsearch; @@ -171,6 +176,11 @@ static uint8_t *command_line_enter(int firstc, long count, int indent) s->save_p_icm = vim_strsave(p_icm); s->ignore_drag_release = true; s->match_start = curwin->w_cursor; + s->init_curswant = curwin->w_curswant; + s->init_leftcol = curwin->w_leftcol; + s->init_topline = curwin->w_topline; + s->init_topfill = curwin->w_topfill; + s->init_botline = curwin->w_botline; if (s->firstc == -1) { s->firstc = NUL; @@ -184,8 +194,8 @@ static uint8_t *command_line_enter(int firstc, long count, int indent) ccline.overstrike = false; // always start in insert mode clearpos(&s->match_end); - s->old_cursor = curwin->w_cursor; // needs to be restored later - s->cursor_start = s->old_cursor; + s->save_cursor = curwin->w_cursor; // may be restored later + s->search_start = curwin->w_cursor; s->old_curswant = curwin->w_curswant; s->old_leftcol = curwin->w_leftcol; s->old_topline = curwin->w_topline; @@ -288,9 +298,15 @@ static uint8_t *command_line_enter(int firstc, long count, int indent) ccline.xpc = NULL; if (s->did_incsearch) { - curwin->w_cursor = s->old_cursor; if (s->gotesc) { - curwin->w_cursor = s->cursor_start; + curwin->w_cursor = s->save_cursor; + } else { + if (!equalpos(s->save_cursor, s->search_start)) { + // put the '" mark at the original position + curwin->w_cursor = s->save_cursor; + setpcmark(); + } + curwin->w_cursor = s->search_start; } curwin->w_curswant = s->old_curswant; curwin->w_leftcol = s->old_leftcol; @@ -939,10 +955,14 @@ static int command_line_handle_key(CommandLineState *s) // Truncate at the end, required for multi-byte chars. ccline.cmdbuff[ccline.cmdlen] = NUL; if (ccline.cmdlen == 0) { - s->old_cursor = s->cursor_start; - } else { - s->old_cursor = s->match_start; - decl(&s->old_cursor); + s->search_start = s->save_cursor; + // save view settings, so that the screen won't be restored at the + // wrong position + s->old_curswant = s->init_curswant; + s->old_leftcol = s->init_leftcol; + s->old_topline = s->init_topline; + s->old_topfill = s->init_topfill; + s->old_botline = s->init_botline; } redrawcmd(); } else if (ccline.cmdlen == 0 && s->c != Ctrl_W @@ -962,6 +982,7 @@ static int command_line_handle_key(CommandLineState *s) } msg_putchar(' '); // delete ':' } + s->search_start = s->save_cursor; redraw_cmdline = true; return 0; // back to cmd mode } @@ -1017,7 +1038,7 @@ static int command_line_handle_key(CommandLineState *s) // Truncate at the end, required for multi-byte chars. ccline.cmdbuff[ccline.cmdlen] = NUL; if (ccline.cmdlen == 0) { - s->old_cursor = s->cursor_start; + s->search_start = s->save_cursor; } redrawcmd(); return command_line_changed(s); @@ -1250,7 +1271,7 @@ static int command_line_handle_key(CommandLineState *s) // Add a character from under the cursor for 'incsearch' if (s->did_incsearch) { curwin->w_cursor = s->match_end; - if (!equalpos(curwin->w_cursor, s->old_cursor)) { + if (!equalpos(curwin->w_cursor, s->search_start)) { s->c = gchar_cursor(); // If 'ignorecase' and 'smartcase' are set and the // command line has no uppercase characters, convert @@ -1453,23 +1474,23 @@ static int command_line_handle_key(CommandLineState *s) emsg_off--; ui_busy_stop(); if (s->i) { - s->old_cursor = s->match_start; + s->search_start = s->match_start; s->match_end = t; s->match_start = t; if (s->c == Ctrl_T && s->firstc == '/') { // move just before the current match, so that // when nv_search finishes the cursor will be // put back on the match - s->old_cursor = t; - (void)decl(&s->old_cursor); + s->search_start = t; + (void)decl(&s->search_start); } - if (lt(t, s->old_cursor) && s->c == Ctrl_G) { + if (lt(t, s->search_start) && s->c == Ctrl_G) { // wrap around - s->old_cursor = t; + s->search_start = t; if (s->firstc == '?') { - (void)incl(&s->old_cursor); + (void)incl(&s->search_start); } else { - (void)decl(&s->old_cursor); + (void)decl(&s->search_start); } } @@ -1607,7 +1628,7 @@ static int command_line_changed(CommandLineState *s) return 1; } s->incsearch_postponed = false; - curwin->w_cursor = s->old_cursor; // start at old position + curwin->w_cursor = s->search_start; // start at old position // If there is no command line, don't do anything if (ccline.cmdlen == 0) { @@ -1698,7 +1719,7 @@ static int command_line_changed(CommandLineState *s) emsg_silent--; // Unblock error reporting // Restore the window "view". - curwin->w_cursor = s->old_cursor; + curwin->w_cursor = s->save_cursor; curwin->w_curswant = s->old_curswant; curwin->w_leftcol = s->old_leftcol; curwin->w_topline = s->old_topline; diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 050020d79d..39cd2c6631 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -5231,6 +5231,7 @@ static void nv_dollar(cmdarg_T *cap) static void nv_search(cmdarg_T *cap) { oparg_T *oap = cap->oap; + pos_T save_cursor = curwin->w_cursor; if (cap->cmdchar == '?' && cap->oap->op_type == OP_ROT13) { /* Translate "g??" to "g?g?" */ @@ -5240,6 +5241,8 @@ static void nv_search(cmdarg_T *cap) return; } + // When using 'incsearch' the cursor may be moved to set a different search + // start position. cap->searchbuf = getcmdline(cap->cmdchar, cap->count1, 0); if (cap->searchbuf == NULL) { @@ -5248,7 +5251,8 @@ static void nv_search(cmdarg_T *cap) } (void)normal_search(cap, cap->cmdchar, cap->searchbuf, - (cap->arg ? 0 : SEARCH_MARK)); + (cap->arg || !equalpos(save_cursor, curwin->w_cursor)) + ? 0 : SEARCH_MARK); } /* diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim index 28e504a883..2106fc2dec 100644 --- a/src/nvim/testdir/test_search.vim +++ b/src/nvim/testdir/test_search.vim @@ -33,6 +33,7 @@ func Test_search_cmdline() " second match call feedkeys("/the\\", 'tx') call assert_equal(' 3 the', getline('.')) + call assert_equal([0, 0, 0, 0], getpos('"')) :1 " third match call feedkeys("/the".repeat("\", 2)."\", 'tx') @@ -61,6 +62,7 @@ func Test_search_cmdline() " no further match call feedkeys("/the".repeat("\", 8)."\", 'tx') call assert_equal(' 9 these', getline('.')) + call assert_equal([0, 0, 0, 0], getpos('"')) " Test 3 " Ctrl-G goes from one match to the next @@ -182,11 +184,11 @@ func Test_search_cmdline() 1 " delete one char, add another call feedkeys("/thei\s\", 'tx') - call assert_equal(' 9 these', getline('.')) + call assert_equal(' 2 these', getline('.')) 1 " delete one char, add another, go to previous match, add one char call feedkeys("/thei\s\\\\", 'tx') - call assert_equal(' 8 them', getline('.')) + call assert_equal(' 9 these', getline('.')) 1 " delete all chars, start from the beginning again call feedkeys("/them". repeat("\",4).'the\>'."\", 'tx') @@ -240,7 +242,33 @@ func Test_search_cmdline2() call feedkeys("/the\\\\\\\", 'tx') call assert_equal(' 2 these', getline('.')) + " Test 2: keep the view, + " after deleting a character from the search cmd + call setline(1, [' 1', ' 2 these', ' 3 the', ' 4 their', ' 5 there', ' 6 their', ' 7 the', ' 8 them', ' 9 these', ' 10 foobar']) + resize 5 + 1 + call feedkeys("/foo\\", 'tx') + redraw + call assert_equal({'lnum': 10, 'leftcol': 0, 'col': 4, 'topfill': 0, 'topline': 6, 'coladd': 0, 'skipcol': 0, 'curswant': 4}, winsaveview()) + + " remove all history entries + for i in range(10) + call histdel('/') + endfor + + " Test 3: reset the view, + " after deleting all characters from the search cmd + norm! 1gg0 + " unfortunately, neither "/foo\\", nor "/foo\\\\", + " nor "/foo\\" works to delete the commandline. + " In that case Vim should return "E35 no previous regular expression", + " but it looks like Vim still sees /foo and therefore the test fails. + " Therefore, disableing this test + "call assert_fails(feedkeys("/foo\\", 'tx'), 'E35') + "call assert_equal({'lnum': 1, 'leftcol': 0, 'col': 0, 'topfill': 0, 'topline': 1, 'coladd': 0, 'skipcol': 0, 'curswant': 0}, winsaveview()) + " clean up + set noincsearch call test_disable_char_avail(0) bw! endfunc diff --git a/src/nvim/version.c b/src/nvim/version.c index 5a107f0023..094ca29b01 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -124,7 +124,7 @@ static const int included_patches[] = { 2323, 2322, 2321, - // 2320, + 2320, // 2319 NA 2318, 2317, diff --git a/test/functional/legacy/search_spec.lua b/test/functional/legacy/search_spec.lua index 36c91accd6..5f71861821 100644 --- a/test/functional/legacy/search_spec.lua +++ b/test/functional/legacy/search_spec.lua @@ -54,6 +54,7 @@ describe('search cmdline', function() 3 {inc:the} | /the^ | ]]) + eq({0, 0, 0, 0}, funcs.getpos('"')) feed('') screen:expect([[ 3 the | @@ -103,6 +104,8 @@ describe('search cmdline', function() 9 {inc:the}se | /the^ | ]]) + feed('') + eq({0, 0, 0, 0}, funcs.getpos('"')) end end @@ -276,40 +279,40 @@ describe('search cmdline', function() 5 there | /thei^ | ]]) - -- Stay on this match when deleting a character + -- Match from initial cursor position when modifying search feed('') screen:expect([[ - 4 {inc:the}ir | - 5 there | + 1 | + 2 {inc:the}se | /the^ | ]]) -- New text advances to next match feed('s') screen:expect([[ - 9 {inc:thes}e | - 10 foobar | + 1 | + 2 {inc:thes}e | /thes^ | ]]) -- Stay on this match when deleting a character feed('') screen:expect([[ - 9 {inc:the}se | - 10 foobar | + 1 | + 2 {inc:the}se | /the^ | ]]) -- Advance to previous match feed('') screen:expect([[ - 8 {inc:the}m | - 9 these | + 9 {inc:the}se | + 10 foobar | /the^ | ]]) -- Extend search to include next character feed('') screen:expect([[ - 8 {inc:them} | - 9 these | - /them^ | + 9 {inc:thes}e | + 10 foobar | + /thes^ | ]]) -- Deleting all characters resets the cursor position feed('') @@ -320,14 +323,14 @@ describe('search cmdline', function() ]]) feed('the') screen:expect([[ + 1 | 2 {inc:the}se | - 3 the | /the^ | ]]) feed('\\>') screen:expect([[ + 2 these | 3 {inc:the} | - 4 their | /the\>^ | ]]) end) @@ -389,4 +392,83 @@ describe('search cmdline', function() /the^ | ]]) end) + + it('keeps the view after deleting a char from the search', function() + screen:detach() + screen = Screen.new(20, 6) + screen:attach() + screen:set_default_attr_ids({ + inc = {reverse = true} + }) + screen:set_default_attr_ignore({ + {bold=true, reverse=true}, {bold=true, foreground=Screen.colors.Blue1} + }) + tenlines() + + feed('/foo') + screen:expect([[ + 6 their | + 7 the | + 8 them | + 9 these | + 10 {inc:foo}bar | + /foo^ | + ]]) + feed('') + screen:expect([[ + 6 their | + 7 the | + 8 them | + 9 these | + 10 {inc:fo}obar | + /fo^ | + ]]) + feed('') + screen:expect([[ + 6 their | + 7 the | + 8 them | + 9 these | + 10 ^foobar | + /fo | + ]]) + eq({lnum = 10, leftcol = 0, col = 4, topfill = 0, topline = 6, + coladd = 0, skipcol = 0, curswant = 4}, + funcs.winsaveview()) + end) + + it('restores original view after failed search', function() + screen:detach() + screen = Screen.new(40, 3) + screen:attach() + screen:set_default_attr_ids({ + inc = {reverse = true}, + err = { foreground = Screen.colors.Grey100, background = Screen.colors.Red }, + more = { bold = true, foreground = Screen.colors.SeaGreen4 }, + }) + tenlines() + feed('0') + feed('/foo') + screen:expect([[ + 9 these | + 10 {inc:foo}bar | + /foo^ | + ]]) + feed('') + screen:expect([[ + 1 | + 2 these | + /^ | + ]]) + feed('') + screen:expect([[ + / | + {err:E35: No previous regular expression} | + {more:Press ENTER or type command to continue}^ | + ]]) + feed('') + eq({lnum = 1, leftcol = 0, col = 0, topfill = 0, topline = 1, + coladd = 0, skipcol = 0, curswant = 0}, + funcs.winsaveview()) + end) end) From 6a842132bcecb0d255fabf937694d1abfde1c86d Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 26 Jun 2017 19:12:06 -0400 Subject: [PATCH 076/161] ex_getln: Lint command_line_handle_key readability/fn_size Create new functions to handle moving to the next incsearch match or matching history index. --- src/nvim/ex_getln.c | 220 +++++++++++++++++++++++--------------------- 1 file changed, 116 insertions(+), 104 deletions(-) diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index e8f9d9bf47..7793081957 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -882,6 +882,118 @@ static int command_line_execute(VimState *state, int key) return command_line_handle_key(s); } +static void command_line_next_incsearch(CommandLineState *s, bool next_match) +{ + ui_busy_start(); + ui_flush(); + + pos_T t; + int search_flags = SEARCH_KEEP + SEARCH_NOOF + SEARCH_PEEK; + if (next_match) { + t = s->match_end; + search_flags += SEARCH_COL; + } else { + t = s->match_start; + } + emsg_off++; + s->i = searchit(curwin, curbuf, &t, + next_match ? FORWARD : BACKWARD, + ccline.cmdbuff, s->count, search_flags, + RE_SEARCH, 0, NULL); + emsg_off--; + ui_busy_stop(); + if (s->i) { + s->search_start = s->match_start; + s->match_end = t; + s->match_start = t; + if (!next_match && s->firstc == '/') { + // move just before the current match, so that + // when nv_search finishes the cursor will be + // put back on the match + s->search_start = t; + (void)decl(&s->search_start); + } + if (lt(t, s->search_start) && next_match) { + // wrap around + s->search_start = t; + if (s->firstc == '?') { + (void)incl(&s->search_start); + } else { + (void)decl(&s->search_start); + } + } + + set_search_match(&s->match_end); + curwin->w_cursor = s->match_start; + changed_cline_bef_curs(); + update_topline(); + validate_cursor(); + highlight_match = true; + s->old_curswant = curwin->w_curswant; + s->old_leftcol = curwin->w_leftcol; + s->old_topline = curwin->w_topline; + s->old_topfill = curwin->w_topfill; + s->old_botline = curwin->w_botline; + update_screen(NOT_VALID); + redrawcmdline(); + } else { + vim_beep(BO_ERROR); + } + return; +} + +static void command_line_next_histidx(CommandLineState *s, bool next_match) +{ + s->j = (int)STRLEN(s->lookfor); + for (;; ) { + // one step backwards + if (!next_match) { + if (s->hiscnt == hislen) { + // first time + s->hiscnt = hisidx[s->histype]; + } else if (s->hiscnt == 0 && hisidx[s->histype] != hislen - 1) { + s->hiscnt = hislen - 1; + } else if (s->hiscnt != hisidx[s->histype] + 1) { + s->hiscnt--; + } else { + // at top of list + s->hiscnt = s->i; + break; + } + } else { // one step forwards + // on last entry, clear the line + if (s->hiscnt == hisidx[s->histype]) { + s->hiscnt = hislen; + break; + } + + // not on a history line, nothing to do + if (s->hiscnt == hislen) { + break; + } + + if (s->hiscnt == hislen - 1) { + // wrap around + s->hiscnt = 0; + } else { + s->hiscnt++; + } + } + + if (s->hiscnt < 0 || history[s->histype][s->hiscnt].hisstr == NULL) { + s->hiscnt = s->i; + break; + } + + if ((s->c != K_UP && s->c != K_DOWN) + || s->hiscnt == s->i + || STRNCMP(history[s->histype][s->hiscnt].hisstr, + s->lookfor, (size_t)s->j) == 0) { + break; + } + } +} + static int command_line_handle_key(CommandLineState *s) { // Big switch for a typed command line character. @@ -1333,55 +1445,9 @@ static int command_line_handle_key(CommandLineState *s) s->lookfor[ccline.cmdpos] = NUL; } - s->j = (int)STRLEN(s->lookfor); - for (;; ) { - // one step backwards - if (s->c == K_UP|| s->c == K_S_UP || s->c == Ctrl_P - || s->c == K_PAGEUP || s->c == K_KPAGEUP) { - if (s->hiscnt == hislen) { - // first time - s->hiscnt = hisidx[s->histype]; - } else if (s->hiscnt == 0 && hisidx[s->histype] != hislen - 1) { - s->hiscnt = hislen - 1; - } else if (s->hiscnt != hisidx[s->histype] + 1) { - --s->hiscnt; - } else { - // at top of list - s->hiscnt = s->i; - break; - } - } else { // one step forwards - // on last entry, clear the line - if (s->hiscnt == hisidx[s->histype]) { - s->hiscnt = hislen; - break; - } - - // not on a history line, nothing to do - if (s->hiscnt == hislen) { - break; - } - - if (s->hiscnt == hislen - 1) { - // wrap around - s->hiscnt = 0; - } else { - ++s->hiscnt; - } - } - - if (s->hiscnt < 0 || history[s->histype][s->hiscnt].hisstr == NULL) { - s->hiscnt = s->i; - break; - } - - if ((s->c != K_UP && s->c != K_DOWN) - || s->hiscnt == s->i - || STRNCMP(history[s->histype][s->hiscnt].hisstr, - s->lookfor, (size_t)s->j) == 0) { - break; - } - } + bool next_match = (s->c == K_DOWN || s->c == K_S_DOWN || s->c == Ctrl_N + || s->c == K_PAGEDOWN || s->c == K_KPAGEDOWN); + command_line_next_histidx(s, next_match); if (s->hiscnt != s->i) { // jumped to other entry @@ -1452,64 +1518,10 @@ static int command_line_handle_key(CommandLineState *s) case Ctrl_G: // next match case Ctrl_T: // previous match if (p_is && !cmd_silent && (s->firstc == '/' || s->firstc == '?')) { - pos_T t; - int search_flags = SEARCH_KEEP + SEARCH_NOOF + SEARCH_PEEK; - if (char_avail()) { return 1; } - ui_busy_start(); - ui_flush(); - if (s->c == Ctrl_G) { - t = s->match_end; - search_flags += SEARCH_COL; - } else { - t = s->match_start; - } - emsg_off++; - s->i = searchit(curwin, curbuf, &t, - s->c == Ctrl_G ? FORWARD : BACKWARD, - ccline.cmdbuff, s->count, search_flags, - RE_SEARCH, 0, NULL); - emsg_off--; - ui_busy_stop(); - if (s->i) { - s->search_start = s->match_start; - s->match_end = t; - s->match_start = t; - if (s->c == Ctrl_T && s->firstc == '/') { - // move just before the current match, so that - // when nv_search finishes the cursor will be - // put back on the match - s->search_start = t; - (void)decl(&s->search_start); - } - if (lt(t, s->search_start) && s->c == Ctrl_G) { - // wrap around - s->search_start = t; - if (s->firstc == '?') { - (void)incl(&s->search_start); - } else { - (void)decl(&s->search_start); - } - } - - set_search_match(&s->match_end); - curwin->w_cursor = s->match_start; - changed_cline_bef_curs(); - update_topline(); - validate_cursor(); - highlight_match = true; - s->old_curswant = curwin->w_curswant; - s->old_leftcol = curwin->w_leftcol; - s->old_topline = curwin->w_topline; - s->old_topfill = curwin->w_topfill; - s->old_botline = curwin->w_botline; - update_screen(NOT_VALID); - redrawcmdline(); - } else { - vim_beep(BO_ERROR); - } + command_line_next_incsearch(s, s->c == Ctrl_G); return command_line_not_changed(s); } break; From 6016ac270f54fe8494ee7bedde109019edb709c5 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 27 Jun 2017 12:21:53 +0200 Subject: [PATCH 077/161] provider/clipboard.vim: allow configuration #6030 Closes #6029 --- runtime/autoload/provider/clipboard.vim | 7 ++++++- runtime/doc/provider.txt | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim index e15aa1f2bd..582895ae5e 100644 --- a/runtime/autoload/provider/clipboard.vim +++ b/runtime/autoload/provider/clipboard.vim @@ -47,7 +47,12 @@ function! provider#clipboard#Error() abort endfunction function! provider#clipboard#Executable() abort - if has('mac') && executable('pbcopy') + if exists('g:clipboard') + let s:copy = g:clipboard.copy + let s:paste = g:clipboard.paste + let s:cache_enabled = g:clipboard.cache_enabled + return g:clipboard.name + elseif has('mac') && executable('pbcopy') let s:copy['+'] = 'pbcopy' let s:paste['+'] = 'pbpaste' let s:copy['*'] = s:copy['+'] diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt index 435646bd1c..113f4a478e 100644 --- a/runtime/doc/provider.txt +++ b/runtime/doc/provider.txt @@ -129,6 +129,25 @@ are found in your `$PATH`. - lemonade (for SSH) https://github.com/pocke/lemonade - doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/ +If you would like to configure the provider: > + let g:clipboard = { + \ 'name': 'myClipboard', + \ 'copy': { + \ '+': 'copyCommand', + \ '*': 'copyCommand', + \ }, + \ 'paste': { + \ '+': 'pasteCommand', + \ '*': 'pasteCommand', + \ }, + \ 'cache_enabled': 1, + \ } + +If the cache is enabled, then when a selection is copied and the copy command +is executed, neovim will cache this selection until the copy command process +dies. Then, when pasting, if the copy command process has not died, the cached +selection is returned instead of executing the paste command. + The presence of a suitable clipboard tool implicitly enables the '+' and '*' registers. From f0dafa89c2b7602cfedf0bd3409858e4c212b0a2 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 28 Jun 2017 09:34:47 +0200 Subject: [PATCH 078/161] provider/clipboard.vim: Handle missing g:clipboard keys --- runtime/autoload/provider/clipboard.vim | 20 +++++----- runtime/doc/provider.txt | 52 ++++++++++++------------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim index 582895ae5e..a67681d28e 100644 --- a/runtime/autoload/provider/clipboard.vim +++ b/runtime/autoload/provider/clipboard.vim @@ -8,7 +8,7 @@ let s:paste = {} " ownership of the selection, so we know how long the cache is valid. let s:selection = { 'owner': 0, 'data': [] } -function! s:selection.on_exit(jobid, data, event) +function! s:selection.on_exit(jobid, data, event) abort " At this point this nvim instance might already have launched " a new provider instance. Don't drop ownership in this case. if self.owner == a:jobid @@ -18,7 +18,7 @@ endfunction let s:selections = { '*': s:selection, '+': copy(s:selection)} -function! s:try_cmd(cmd, ...) +function! s:try_cmd(cmd, ...) abort let argv = split(a:cmd, " ") let out = a:0 ? systemlist(argv, a:1, 1) : systemlist(argv, [''], 1) if v:shell_error @@ -34,7 +34,7 @@ function! s:try_cmd(cmd, ...) endfunction " Returns TRUE if `cmd` exits with success, else FALSE. -function! s:cmd_ok(cmd) +function! s:cmd_ok(cmd) abort call system(a:cmd) return v:shell_error == 0 endfunction @@ -48,10 +48,10 @@ endfunction function! provider#clipboard#Executable() abort if exists('g:clipboard') - let s:copy = g:clipboard.copy - let s:paste = g:clipboard.paste - let s:cache_enabled = g:clipboard.cache_enabled - return g:clipboard.name + let s:copy = get(g:clipboard, 'copy', { '+': v:null, '*': v:null }) + let s:paste = get(g:clipboard, 'paste', { '+': v:null, '*': v:null }) + let s:cache_enabled = get(g:clipboard, 'cache_enabled', 1) + return get(g:clipboard, 'name', 'g:clipboard') elseif has('mac') && executable('pbcopy') let s:copy['+'] = 'pbcopy' let s:paste['+'] = 'pbpaste' @@ -107,14 +107,14 @@ endif let s:clipboard = {} -function! s:clipboard.get(reg) +function! s:clipboard.get(reg) abort if s:selections[a:reg].owner > 0 return s:selections[a:reg].data end return s:try_cmd(s:paste[a:reg]) endfunction -function! s:clipboard.set(lines, regtype, reg) +function! s:clipboard.set(lines, regtype, reg) abort if a:reg == '"' call s:clipboard.set(a:lines,a:regtype,'+') if s:copy['*'] != s:copy['+'] @@ -149,6 +149,6 @@ function! s:clipboard.set(lines, regtype, reg) let selection.owner = jobid endfunction -function! provider#clipboard#Call(method, args) +function! provider#clipboard#Call(method, args) abort return call(s:clipboard[a:method],a:args,s:clipboard) endfunction diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt index 113f4a478e..50307ccbf3 100644 --- a/runtime/doc/provider.txt +++ b/runtime/doc/provider.txt @@ -116,48 +116,48 @@ To use the RVM "system" Ruby installation: > ============================================================================== Clipboard integration *provider-clipboard* *clipboard* -Nvim has no direct connection to the system clipboard. Instead it is -accessible through a |provider| which transparently uses shell commands for -communicating with the clipboard. +Nvim has no direct connection to the system clipboard. Instead it depends on +a |provider| which transparently uses shell commands to communicate with the +system clipboard or any other clipboard "backend". -Clipboard access is implicitly enabled if any of the following clipboard tools -are found in your `$PATH`. +To ALWAYS use the clipboard for ALL operations (instead of interacting with +the '+' and/or '*' registers explicitly): > + set clipboard+=unnamedplus +< +See 'clipboard' for details and options. + + *clipboard-tool* +The presence of a working clipboard tool implicitly enables the '+' and '*' +registers. Nvim looks for these clipboard tools, in order of priority: + + - |g:clipboard| + - pbcopy/pbpaste (macOS) - xclip - xsel (newer alternative to xclip) - - pbcopy/pbpaste (macOS) - lemonade (for SSH) https://github.com/pocke/lemonade - doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/ + - win32yank (Windows) + - tmux (if $TMUX is set) -If you would like to configure the provider: > + *g:clipboard* +To configure a custom clipboard tool, set `g:clipboard` to a dictionary: > let g:clipboard = { \ 'name': 'myClipboard', \ 'copy': { - \ '+': 'copyCommand', - \ '*': 'copyCommand', + \ '+': 'tmux load-buffer -', + \ '*': 'tmux load-buffer -', \ }, \ 'paste': { - \ '+': 'pasteCommand', - \ '*': 'pasteCommand', + \ '+': 'tmux save-buffer -', + \ '*': 'tmux save-buffer -', \ }, \ 'cache_enabled': 1, \ } -If the cache is enabled, then when a selection is copied and the copy command -is executed, neovim will cache this selection until the copy command process -dies. Then, when pasting, if the copy command process has not died, the cached -selection is returned instead of executing the paste command. - -The presence of a suitable clipboard tool implicitly enables the '+' and '*' -registers. - -If you want to ALWAYS use the clipboard for ALL operations (as opposed -to interacting with the '+' and/or '*' registers explicitly), set the -following option: -> - set clipboard+=unnamedplus -< -See 'clipboard' for details and more options. +If `cache_enabled` is |TRUE| then when a selection is copied, Nvim will cache +the selection until the copy command process dies. When pasting, if the copy +process has not died, the cached selection is applied. ============================================================================== X11 selection mechanism *clipboard-x11* *x11-selection* From 42d892913daa215c27e41b2255e96c1ce09ea56c Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 29 Jun 2017 09:29:40 +0200 Subject: [PATCH 079/161] cmake: Remove custom "Dev" build-type. (#6932) The main purpose of this build-type was to avoid unwanted ~/.nvimlog files (which could get really big, and also affects performance) for non-devs. But that is no longer necessary since the log system now avoids non-critical logging by default (#6827). This essentially reverts 87e5a4131666e44354f280538cbc6bbe52225092 --- CMakeLists.txt | 58 +++++++++++++--------------------------- contrib/local.mk.example | 13 +++------ 2 files changed, 22 insertions(+), 49 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1699ffa8fa..141fa81e16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,14 +51,14 @@ endif() # Set default build type. if(NOT CMAKE_BUILD_TYPE) - message(STATUS "CMAKE_BUILD_TYPE not given, defaulting to 'Dev'.") - set(CMAKE_BUILD_TYPE "Dev" CACHE STRING "Choose the type of build." FORCE) + message(STATUS "CMAKE_BUILD_TYPE not given, defaulting to 'Debug'.") + set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build." FORCE) endif() # Set available build types for CMake GUIs. # A different build type can still be set by -DCMAKE_BUILD_TYPE=... set_property(CACHE CMAKE_BUILD_TYPE PROPERTY - STRINGS "Debug" "Dev" "Release" "MinSizeRel" "RelWithDebInfo") + STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") # If not in a git repo (e.g., a tarball) these tokens define the complete # version string, else they are combined with the result of `git describe`. @@ -107,46 +107,24 @@ if(NOT CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DMIN_LOG_LEVEL) set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DMIN_LOG_LEVEL=3") endif() -# Enable assertions for RelWithDebInfo. -if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DNDEBUG) +if(CMAKE_COMPILER_IS_GNUCC) + check_c_compiler_flag(-Og HAS_OG_FLAG) +else() + set(HAS_OG_FLAG 0) +endif() + +# Set custom build flags for RelWithDebInfo. +# -DNDEBUG purposely omitted because we want assertions. +if(HAS_OG_FLAG) + set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Og -g" + CACHE STRING "Flags used by the compiler during release-with-debug builds." FORCE) +elseif(NOT MSVC) + set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g" + CACHE STRING "Flags used by the compiler during release-with-debug builds." FORCE) +elseif(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DNDEBUG) string(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") endif() -# Set build flags for custom Dev build type. -# -DNDEBUG purposely omitted because we want assertions. -if(MSVC) - SET(CMAKE_C_FLAGS_DEV "" - CACHE STRING "Flags used by the compiler during development (optimized, but with debug info and logging) builds." - FORCE) -else() - if(CMAKE_COMPILER_IS_GNUCC) - check_c_compiler_flag(-Og HAS_OG_FLAG) - else() - set(HAS_OG_FLAG 0) - endif() - - if(HAS_OG_FLAG) - set(CMAKE_C_FLAGS_DEV "-Og -g" - CACHE STRING "Flags used by the compiler during development (optimized, but with debug info and logging) builds." - FORCE) - else() - set(CMAKE_C_FLAGS_DEV "-O2 -g" - CACHE STRING "Flags used by the compiler during development (optimized, but with debug info and logging) builds." - FORCE) - endif() -endif() -SET(CMAKE_EXE_LINKER_FLAGS_DEV "" - CACHE STRING "Flags used for linking binaries during development (optimized, but with debug info and logging) builds." - FORCE) -SET(CMAKE_SHARED_LINKER_FLAGS_DEV "" - CACHE STRING "Flags used by the shared libraries linker during development (optimized, but with debug info and logging) builds." - FORCE) - -MARK_AS_ADVANCED( - CMAKE_C_FLAGS_DEV - CMAKE_EXE_LINKER_FLAGS_DEV - CMAKE_SHARED_LINKER_FLAGS_DEV) - # Enable -Wconversion. if(NOT MSVC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion") diff --git a/contrib/local.mk.example b/contrib/local.mk.example index cadb9cf4b2..23fe11622b 100644 --- a/contrib/local.mk.example +++ b/contrib/local.mk.example @@ -13,26 +13,21 @@ # Sets the build type; defaults to Debug. Valid values: # -# - Debug: Disables optimizations (-O0), enables debug information and logging. +# - Debug: Disables optimizations (-O0), enables debug information. # -# - Dev: Enables all optimizations that do not interfere with -# debugging (-Og if available, -O2 and -g if not). -# Enables debug information and logging. -# -# - RelWithDebInfo: Enables optimizations (-O2) and debug information. -# Disables logging. +# - RelWithDebInfo: Enables optimizations (-Og or -O2) with debug information. # # - MinSizeRel: Enables all -O2 optimization that do not typically # increase code size, and performs further optimizations # designed to reduce code size (-Os). -# Disables debug information and logging. +# Disables debug information. # # - Release: Same as RelWithDebInfo, but disables debug information. # # CMAKE_BUILD_TYPE := Debug -# The default log level is 1 (INFO) (unless CMAKE_BUILD_TYPE is "Release"). # Log levels: 0 (DEBUG), 1 (INFO), 2 (WARNING), 3 (ERROR) +# Default is 1 (INFO) unless CMAKE_BUILD_TYPE is Release or RelWithDebInfo. # CMAKE_EXTRA_FLAGS += -DMIN_LOG_LEVEL=1 # By default, nvim uses bundled versions of its required third-party From 25eced62b651fceee04706af787bccd328d36496 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Thu, 29 Jun 2017 15:16:06 -0400 Subject: [PATCH 080/161] Update emoji-data URL for Unicode 10 vim-patch:8.0.0652 --- scripts/download-unicode-files.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/download-unicode-files.sh b/scripts/download-unicode-files.sh index 54fc32550c..5e9efebb43 100755 --- a/scripts/download-unicode-files.sh +++ b/scripts/download-unicode-files.sh @@ -30,7 +30,7 @@ for filename in $data_files ; do done for filename in $emoji_files ; do - curl -o "$UNIDIR/$filename" "$DOWNLOAD_URL_BASE/emoji/3.0/$filename" + curl -o "$UNIDIR/$filename" "$DOWNLOAD_URL_BASE/emoji/latest/$filename" ( cd "$UNIDIR" git add $filename From ddea5038e45ec2ef77ad126e5cafd145c5bb393c Mon Sep 17 00:00:00 2001 From: James McCoy Date: Thu, 29 Jun 2017 15:16:12 -0400 Subject: [PATCH 081/161] Update unicode files --- unicode/CaseFolding.txt | 8 +- unicode/EastAsianWidth.txt | 90 +++- unicode/UnicodeData.txt | 1028 +++++++++++++++++++++++++++++++++++- unicode/emoji-data.txt | 764 ++++++++++++++------------- 4 files changed, 1500 insertions(+), 390 deletions(-) diff --git a/unicode/CaseFolding.txt b/unicode/CaseFolding.txt index 372ee68bd8..efdf18e441 100644 --- a/unicode/CaseFolding.txt +++ b/unicode/CaseFolding.txt @@ -1,6 +1,6 @@ -# CaseFolding-9.0.0.txt -# Date: 2016-03-02, 18:54:54 GMT -# © 2016 Unicode®, Inc. +# CaseFolding-10.0.0.txt +# Date: 2017-04-14, 05:40:18 GMT +# © 2017 Unicode®, Inc. # Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. # For terms of use, see http://www.unicode.org/terms_of_use.html # @@ -24,7 +24,7 @@ # # NOTE: case folding does not preserve normalization formats! # -# For information on case folding, including how to have case folding +# For information on case folding, including how to have case folding # preserve normalization formats, see Section 3.13 Default Case Algorithms in # The Unicode Standard. # diff --git a/unicode/EastAsianWidth.txt b/unicode/EastAsianWidth.txt index 5a2ede5d59..0d3129bb0a 100644 --- a/unicode/EastAsianWidth.txt +++ b/unicode/EastAsianWidth.txt @@ -1,6 +1,6 @@ -# EastAsianWidth-9.0.0.txt -# Date: 2016-05-27, 17:00:00 GMT [KW, LI] -# © 2016 Unicode®, Inc. +# EastAsianWidth-10.0.0.txt +# Date: 2017-03-08, 02:00:00 GMT [KW, LI] +# © 2017 Unicode®, Inc. # Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. # For terms of use, see http://www.unicode.org/terms_of_use.html # @@ -328,6 +328,7 @@ 0840..0858;N # Lo [25] MANDAIC LETTER HALQA..MANDAIC LETTER AIN 0859..085B;N # Mn [3] MANDAIC AFFRICATION MARK..MANDAIC GEMINATION MARK 085E;N # Po MANDAIC PUNCTUATION +0860..086A;N # Lo [11] SYRIAC LETTER MALAYALAM NGA..SYRIAC LETTER MALAYALAM SSA 08A0..08B4;N # Lo [21] ARABIC LETTER BEH WITH SMALL V BELOW..ARABIC LETTER KAF WITH DOT BELOW 08B6..08BD;N # Lo [8] ARABIC LETTER BEH WITH SMALL MEEM ABOVE..ARABIC LETTER AFRICAN NOON 08D4..08E1;N # Mn [14] ARABIC SMALL HIGH WORD AR-RUB..ARABIC SMALL HIGH SIGN SAFHA @@ -381,6 +382,8 @@ 09F4..09F9;N # No [6] BENGALI CURRENCY NUMERATOR ONE..BENGALI CURRENCY DENOMINATOR SIXTEEN 09FA;N # So BENGALI ISSHAR 09FB;N # Sc BENGALI GANDA MARK +09FC;N # Lo BENGALI LETTER VEDIC ANUSVARA +09FD;N # Po BENGALI ABBREVIATION SIGN 0A01..0A02;N # Mn [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI SIGN BINDI 0A03;N # Mc GURMUKHI SIGN VISARGA 0A05..0A0A;N # Lo [6] GURMUKHI LETTER A..GURMUKHI LETTER UU @@ -425,6 +428,7 @@ 0AF0;N # Po GUJARATI ABBREVIATION SIGN 0AF1;N # Sc GUJARATI RUPEE SIGN 0AF9;N # Lo GUJARATI LETTER ZHA +0AFA..0AFF;N # Mn [6] GUJARATI SIGN SUKUN..GUJARATI SIGN TWO-CIRCLE NUKTA ABOVE 0B01;N # Mn ORIYA SIGN CANDRABINDU 0B02..0B03;N # Mc [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VISARGA 0B05..0B0C;N # Lo [8] ORIYA LETTER A..ORIYA LETTER VOCALIC L @@ -516,11 +520,12 @@ 0CE2..0CE3;N # Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL 0CE6..0CEF;N # Nd [10] KANNADA DIGIT ZERO..KANNADA DIGIT NINE 0CF1..0CF2;N # Lo [2] KANNADA SIGN JIHVAMULIYA..KANNADA SIGN UPADHMANIYA -0D01;N # Mn MALAYALAM SIGN CANDRABINDU +0D00..0D01;N # Mn [2] MALAYALAM SIGN COMBINING ANUSVARA ABOVE..MALAYALAM SIGN CANDRABINDU 0D02..0D03;N # Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA 0D05..0D0C;N # Lo [8] MALAYALAM LETTER A..MALAYALAM LETTER VOCALIC L 0D0E..0D10;N # Lo [3] MALAYALAM LETTER E..MALAYALAM LETTER AI 0D12..0D3A;N # Lo [41] MALAYALAM LETTER O..MALAYALAM LETTER TTTA +0D3B..0D3C;N # Mn [2] MALAYALAM SIGN VERTICAL BAR VIRAMA..MALAYALAM SIGN CIRCULAR VIRAMA 0D3D;N # Lo MALAYALAM SIGN AVAGRAHA 0D3E..0D40;N # Mc [3] MALAYALAM VOWEL SIGN AA..MALAYALAM VOWEL SIGN II 0D41..0D44;N # Mn [4] MALAYALAM VOWEL SIGN U..MALAYALAM VOWEL SIGN VOCALIC RR @@ -853,6 +858,7 @@ 1CF2..1CF3;N # Mc [2] VEDIC SIGN ARDHAVISARGA..VEDIC SIGN ROTATED ARDHAVISARGA 1CF4;N # Mn VEDIC TONE CANDRA ABOVE 1CF5..1CF6;N # Lo [2] VEDIC SIGN JIHVAMULIYA..VEDIC SIGN UPADHMANIYA +1CF7;N # Mc VEDIC SIGN ATIKRAMA 1CF8..1CF9;N # Mn [2] VEDIC TONE RING ABOVE..VEDIC TONE DOUBLE RING ABOVE 1D00..1D2B;N # Ll [44] LATIN LETTER SMALL CAPITAL A..CYRILLIC LETTER SMALL CAPITAL EL 1D2C..1D6A;N # Lm [63] MODIFIER LETTER CAPITAL A..GREEK SUBSCRIPT SMALL LETTER CHI @@ -861,7 +867,7 @@ 1D79..1D7F;N # Ll [7] LATIN SMALL LETTER INSULAR G..LATIN SMALL LETTER UPSILON WITH STROKE 1D80..1D9A;N # Ll [27] LATIN SMALL LETTER B WITH PALATAL HOOK..LATIN SMALL LETTER EZH WITH RETROFLEX HOOK 1D9B..1DBF;N # Lm [37] MODIFIER LETTER SMALL TURNED ALPHA..MODIFIER LETTER SMALL THETA -1DC0..1DF5;N # Mn [54] COMBINING DOTTED GRAVE ACCENT..COMBINING UP TACK ABOVE +1DC0..1DF9;N # Mn [58] COMBINING DOTTED GRAVE ACCENT..COMBINING WIDE INVERTED BRIDGE BELOW 1DFB..1DFF;N # Mn [5] COMBINING DELETION MARK..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW 1E00..1EFF;N # L& [256] LATIN CAPITAL LETTER A WITH RING BELOW..LATIN SMALL LETTER Y WITH LOOP 1F00..1F15;N # L& [22] GREEK SMALL LETTER ALPHA WITH PSILI..GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA @@ -954,7 +960,7 @@ 20A9;H # Sc WON SIGN 20AA..20AB;N # Sc [2] NEW SHEQEL SIGN..DONG SIGN 20AC;A # Sc EURO SIGN -20AD..20BE;N # Sc [18] KIP SIGN..LARI SIGN +20AD..20BF;N # Sc [19] KIP SIGN..BITCOIN SIGN 20D0..20DC;N # Mn [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE 20DD..20E0;N # Me [4] COMBINING ENCLOSING CIRCLE..COMBINING ENCLOSING CIRCLE BACKSLASH 20E1;N # Mn COMBINING LEFT RIGHT ARROW ABOVE @@ -1120,7 +1126,7 @@ 23F0;W # So ALARM CLOCK 23F1..23F2;N # So [2] STOPWATCH..TIMER CLOCK 23F3;W # So HOURGLASS WITH FLOWING SAND -23F4..23FE;N # So [11] BLACK MEDIUM LEFT-POINTING TRIANGLE..POWER SLEEP SYMBOL +23F4..23FF;N # So [12] BLACK MEDIUM LEFT-POINTING TRIANGLE..OBSERVER EYE SYMBOL 2400..2426;N # So [39] SYMBOL FOR NULL..SYMBOL FOR SUBSTITUTE FORM TWO 2440..244A;N # So [11] OCR HOOK..OCR DOUBLE BACKSLASH 2460..249B;A # No [60] CIRCLED DIGIT ONE..NUMBER TWENTY FULL STOP @@ -1328,7 +1334,7 @@ 2B76..2B95;N # So [32] NORTH WEST TRIANGLE-HEADED ARROW TO BAR..RIGHTWARDS BLACK ARROW 2B98..2BB9;N # So [34] THREE-D TOP-LIGHTED LEFTWARDS EQUILATERAL ARROWHEAD..UP ARROWHEAD IN A RECTANGLE BOX 2BBD..2BC8;N # So [12] BALLOT BOX WITH LIGHT X..BLACK MEDIUM RIGHT-POINTING TRIANGLE CENTRED -2BCA..2BD1;N # So [8] TOP HALF BLACK CIRCLE..UNCERTAINTY SIGN +2BCA..2BD2;N # So [9] TOP HALF BLACK CIRCLE..GROUP MARK 2BEC..2BEF;N # So [4] LEFTWARDS TWO-HEADED ARROW WITH TRIANGLE ARROWHEADS..DOWNWARDS TWO-HEADED ARROW WITH TRIANGLE ARROWHEADS 2C00..2C2E;N # Lu [47] GLAGOLITIC CAPITAL LETTER AZU..GLAGOLITIC CAPITAL LETTER LATINATE MYSLITE 2C30..2C5E;N # Ll [47] GLAGOLITIC SMALL LETTER AZU..GLAGOLITIC SMALL LETTER LATINATE MYSLITE @@ -1397,7 +1403,7 @@ 2E40;N # Pd DOUBLE HYPHEN 2E41;N # Po REVERSED COMMA 2E42;N # Ps DOUBLE LOW-REVERSED-9 QUOTATION MARK -2E43..2E44;N # Po [2] DASH WITH LEFT UPTURN..DOUBLE SUSPENSION MARK +2E43..2E49;N # Po [7] DASH WITH LEFT UPTURN..DOUBLE STACKED COMMA 2E80..2E99;W # So [26] CJK RADICAL REPEAT..CJK RADICAL RAP 2E9B..2EF3;W # So [89] CJK RADICAL CHOKE..CJK RADICAL C-SIMPLIFIED TURTLE 2F00..2FD5;W # So [214] KANGXI RADICAL ONE..KANGXI RADICAL FLUTE @@ -1453,7 +1459,7 @@ 30FB;W # Po KATAKANA MIDDLE DOT 30FC..30FE;W # Lm [3] KATAKANA-HIRAGANA PROLONGED SOUND MARK..KATAKANA VOICED ITERATION MARK 30FF;W # Lo KATAKANA DIGRAPH KOTO -3105..312D;W # Lo [41] BOPOMOFO LETTER B..BOPOMOFO LETTER IH +3105..312E;W # Lo [42] BOPOMOFO LETTER B..BOPOMOFO LETTER O WITH DOT ABOVE 3131..318E;W # Lo [94] HANGUL LETTER KIYEOK..HANGUL LETTER ARAEAE 3190..3191;W # So [2] IDEOGRAPHIC ANNOTATION LINKING MARK..IDEOGRAPHIC ANNOTATION REVERSE MARK 3192..3195;W # No [4] IDEOGRAPHIC ANNOTATION ONE MARK..IDEOGRAPHIC ANNOTATION FOUR MARK @@ -1476,8 +1482,8 @@ 3400..4DB5;W # Lo [6582] CJK UNIFIED IDEOGRAPH-3400..CJK UNIFIED IDEOGRAPH-4DB5 4DB6..4DBF;W # Cn [10] .. 4DC0..4DFF;N # So [64] HEXAGRAM FOR THE CREATIVE HEAVEN..HEXAGRAM FOR BEFORE COMPLETION -4E00..9FD5;W # Lo [20950] CJK UNIFIED IDEOGRAPH-4E00..CJK UNIFIED IDEOGRAPH-9FD5 -9FD6..9FFF;W # Cn [42] .. +4E00..9FEA;W # Lo [20971] CJK UNIFIED IDEOGRAPH-4E00..CJK UNIFIED IDEOGRAPH-9FEA +9FEB..9FFF;W # Cn [21] .. A000..A014;W # Lo [21] YI SYLLABLE IT..YI SYLLABLE E A015;W # Lm YI SYLLABLE WU A016..A48C;W # Lo [1143] YI SYLLABLE BIT..YI SYLLABLE YYR @@ -1803,6 +1809,7 @@ FFFD;A # So REPLACEMENT CHARACTER 102E1..102FB;N # No [27] COPTIC EPACT DIGIT ONE..COPTIC EPACT NUMBER NINE HUNDRED 10300..1031F;N # Lo [32] OLD ITALIC LETTER A..OLD ITALIC LETTER ESS 10320..10323;N # No [4] OLD ITALIC NUMERAL ONE..OLD ITALIC NUMERAL FIFTY +1032D..1032F;N # Lo [3] OLD ITALIC LETTER YE..OLD ITALIC LETTER SOUTHERN TSE 10330..10340;N # Lo [17] GOTHIC LETTER AHSA..GOTHIC LETTER PAIRTHRA 10341;N # Nl GOTHIC LETTER NINETY 10342..10349;N # Lo [8] GOTHIC LETTER RAIDA..GOTHIC LETTER OTHAL @@ -2050,6 +2057,28 @@ FFFD;A # So REPLACEMENT CHARACTER 118E0..118E9;N # Nd [10] WARANG CITI DIGIT ZERO..WARANG CITI DIGIT NINE 118EA..118F2;N # No [9] WARANG CITI NUMBER TEN..WARANG CITI NUMBER NINETY 118FF;N # Lo WARANG CITI OM +11A00;N # Lo ZANABAZAR SQUARE LETTER A +11A01..11A06;N # Mn [6] ZANABAZAR SQUARE VOWEL SIGN I..ZANABAZAR SQUARE VOWEL SIGN O +11A07..11A08;N # Mc [2] ZANABAZAR SQUARE VOWEL SIGN AI..ZANABAZAR SQUARE VOWEL SIGN AU +11A09..11A0A;N # Mn [2] ZANABAZAR SQUARE VOWEL SIGN REVERSED I..ZANABAZAR SQUARE VOWEL LENGTH MARK +11A0B..11A32;N # Lo [40] ZANABAZAR SQUARE LETTER KA..ZANABAZAR SQUARE LETTER KSSA +11A33..11A38;N # Mn [6] ZANABAZAR SQUARE FINAL CONSONANT MARK..ZANABAZAR SQUARE SIGN ANUSVARA +11A39;N # Mc ZANABAZAR SQUARE SIGN VISARGA +11A3A;N # Lo ZANABAZAR SQUARE CLUSTER-INITIAL LETTER RA +11A3B..11A3E;N # Mn [4] ZANABAZAR SQUARE CLUSTER-FINAL LETTER YA..ZANABAZAR SQUARE CLUSTER-FINAL LETTER VA +11A3F..11A46;N # Po [8] ZANABAZAR SQUARE INITIAL HEAD MARK..ZANABAZAR SQUARE CLOSING DOUBLE-LINED HEAD MARK +11A47;N # Mn ZANABAZAR SQUARE SUBJOINER +11A50;N # Lo SOYOMBO LETTER A +11A51..11A56;N # Mn [6] SOYOMBO VOWEL SIGN I..SOYOMBO VOWEL SIGN OE +11A57..11A58;N # Mc [2] SOYOMBO VOWEL SIGN AI..SOYOMBO VOWEL SIGN AU +11A59..11A5B;N # Mn [3] SOYOMBO VOWEL SIGN VOCALIC R..SOYOMBO VOWEL LENGTH MARK +11A5C..11A83;N # Lo [40] SOYOMBO LETTER KA..SOYOMBO LETTER KSSA +11A86..11A89;N # Lo [4] SOYOMBO CLUSTER-INITIAL LETTER RA..SOYOMBO CLUSTER-INITIAL LETTER SA +11A8A..11A96;N # Mn [13] SOYOMBO FINAL CONSONANT SIGN G..SOYOMBO SIGN ANUSVARA +11A97;N # Mc SOYOMBO SIGN VISARGA +11A98..11A99;N # Mn [2] SOYOMBO GEMINATION MARK..SOYOMBO SUBJOINER +11A9A..11A9C;N # Po [3] SOYOMBO MARK TSHEG..SOYOMBO MARK DOUBLE SHAD +11A9E..11AA2;N # Po [5] SOYOMBO HEAD MARK WITH MOON AND SUN AND TRIPLE FLAME..SOYOMBO TERMINAL MARK-2 11AC0..11AF8;N # Lo [57] PAU CIN HAU LETTER PA..PAU CIN HAU GLOTTAL STOP FINAL 11C00..11C08;N # Lo [9] BHAIKSUKI LETTER A..BHAIKSUKI LETTER VOCALIC L 11C0A..11C2E;N # Lo [37] BHAIKSUKI LETTER E..BHAIKSUKI LETTER HA @@ -2071,6 +2100,16 @@ FFFD;A # So REPLACEMENT CHARACTER 11CB2..11CB3;N # Mn [2] MARCHEN VOWEL SIGN U..MARCHEN VOWEL SIGN E 11CB4;N # Mc MARCHEN VOWEL SIGN O 11CB5..11CB6;N # Mn [2] MARCHEN SIGN ANUSVARA..MARCHEN SIGN CANDRABINDU +11D00..11D06;N # Lo [7] MASARAM GONDI LETTER A..MASARAM GONDI LETTER E +11D08..11D09;N # Lo [2] MASARAM GONDI LETTER AI..MASARAM GONDI LETTER O +11D0B..11D30;N # Lo [38] MASARAM GONDI LETTER AU..MASARAM GONDI LETTER TRA +11D31..11D36;N # Mn [6] MASARAM GONDI VOWEL SIGN AA..MASARAM GONDI VOWEL SIGN VOCALIC R +11D3A;N # Mn MASARAM GONDI VOWEL SIGN E +11D3C..11D3D;N # Mn [2] MASARAM GONDI VOWEL SIGN AI..MASARAM GONDI VOWEL SIGN O +11D3F..11D45;N # Mn [7] MASARAM GONDI VOWEL SIGN AU..MASARAM GONDI VIRAMA +11D46;N # Lo MASARAM GONDI REPHA +11D47;N # Mn MASARAM GONDI RA-KARA +11D50..11D59;N # Nd [10] MASARAM GONDI DIGIT ZERO..MASARAM GONDI DIGIT NINE 12000..12399;N # Lo [922] CUNEIFORM SIGN A..CUNEIFORM SIGN U U 12400..1246E;N # Nl [111] CUNEIFORM NUMERIC SIGN TWO ASH..CUNEIFORM NUMERIC SIGN NINE U VARIANT FORM 12470..12474;N # Po [5] CUNEIFORM PUNCTUATION SIGN OLD ASSYRIAN WORD DIVIDER..CUNEIFORM PUNCTUATION SIGN DIAGONAL QUADCOLON @@ -2100,10 +2139,12 @@ FFFD;A # So REPLACEMENT CHARACTER 16F51..16F7E;N # Mc [46] MIAO SIGN ASPIRATION..MIAO VOWEL SIGN NG 16F8F..16F92;N # Mn [4] MIAO TONE RIGHT..MIAO TONE BELOW 16F93..16F9F;N # Lm [13] MIAO LETTER TONE-2..MIAO LETTER REFORMED TONE-8 -16FE0;W # Lm TANGUT ITERATION MARK +16FE0..16FE1;W # Lm [2] TANGUT ITERATION MARK..NUSHU ITERATION MARK 17000..187EC;W # Lo [6125] TANGUT IDEOGRAPH-17000..TANGUT IDEOGRAPH-187EC 18800..18AF2;W # Lo [755] TANGUT COMPONENT-001..TANGUT COMPONENT-755 -1B000..1B001;W # Lo [2] KATAKANA LETTER ARCHAIC E..HIRAGANA LETTER ARCHAIC YE +1B000..1B0FF;W # Lo [256] KATAKANA LETTER ARCHAIC E..HENTAIGANA LETTER RE-2 +1B100..1B11E;W # Lo [31] HENTAIGANA LETTER RE-3..HENTAIGANA LETTER N-MU-MO-2 +1B170..1B2FB;W # Lo [396] NUSHU CHARACTER-1B170..NUSHU CHARACTER-1B2FB 1BC00..1BC6A;N # Lo [107] DUPLOYAN LETTER H..DUPLOYAN LETTER VOCALIC M 1BC70..1BC7C;N # Lo [13] DUPLOYAN AFFIX LEFT HORIZONTAL SECANT..DUPLOYAN AFFIX ATTACHED TANGENT HOOK 1BC80..1BC88;N # Lo [9] DUPLOYAN AFFIX HIGH ACUTE..DUPLOYAN AFFIX HIGH VERTICAL @@ -2255,6 +2296,7 @@ FFFD;A # So REPLACEMENT CHARACTER 1F210..1F23B;W # So [44] SQUARED CJK UNIFIED IDEOGRAPH-624B..SQUARED CJK UNIFIED IDEOGRAPH-914D 1F240..1F248;W # So [9] TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-672C..TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-6557 1F250..1F251;W # So [2] CIRCLED IDEOGRAPH ADVANTAGE..CIRCLED IDEOGRAPH ACCEPT +1F260..1F265;W # So [6] ROUNDED SYMBOL FOR FU..ROUNDED SYMBOL FOR CAI 1F300..1F320;W # So [33] CYCLONE..SHOOTING STAR 1F321..1F32C;N # So [12] THERMOMETER..WIND BLOWING FACE 1F32D..1F335;W # So [9] HOT DOG..CACTUS @@ -2299,10 +2341,11 @@ FFFD;A # So REPLACEMENT CHARACTER 1F6CC;W # So SLEEPING ACCOMMODATION 1F6CD..1F6CF;N # So [3] SHOPPING BAGS..BED 1F6D0..1F6D2;W # So [3] PLACE OF WORSHIP..SHOPPING TROLLEY +1F6D3..1F6D4;N # So [2] STUPA..PAGODA 1F6E0..1F6EA;N # So [11] HAMMER AND WRENCH..NORTHEAST-POINTING AIRPLANE 1F6EB..1F6EC;W # So [2] AIRPLANE DEPARTURE..AIRPLANE ARRIVING 1F6F0..1F6F3;N # So [4] SATELLITE..PASSENGER SHIP -1F6F4..1F6F6;W # So [3] SCOOTER..CANOE +1F6F4..1F6F8;W # So [5] SCOOTER..FLYING SAUCER 1F700..1F773;N # So [116] ALCHEMICAL SYMBOL FOR QUINTESSENCE..ALCHEMICAL SYMBOL FOR HALF OUNCE 1F780..1F7D4;N # So [85] BLACK LEFT-POINTING ISOSCELES RIGHT TRIANGLE..HEAVY TWELVE POINTED PINWHEEL STAR 1F800..1F80B;N # So [12] LEFTWARDS ARROW WITH SMALL TRIANGLE ARROWHEAD..DOWNWARDS ARROW WITH LARGE TRIANGLE ARROWHEAD @@ -2310,14 +2353,13 @@ FFFD;A # So REPLACEMENT CHARACTER 1F850..1F859;N # So [10] LEFTWARDS SANS-SERIF ARROW..UP DOWN SANS-SERIF ARROW 1F860..1F887;N # So [40] WIDE-HEADED LEFTWARDS LIGHT BARB ARROW..WIDE-HEADED SOUTH WEST VERY HEAVY BARB ARROW 1F890..1F8AD;N # So [30] LEFTWARDS TRIANGLE ARROWHEAD..WHITE ARROW SHAFT WIDTH TWO THIRDS -1F910..1F91E;W # So [15] ZIPPER-MOUTH FACE..HAND WITH INDEX AND MIDDLE FINGERS CROSSED -1F920..1F927;W # So [8] FACE WITH COWBOY HAT..SNEEZING FACE -1F930;W # So PREGNANT WOMAN -1F933..1F93E;W # So [12] SELFIE..HANDBALL -1F940..1F94B;W # So [12] WILTED FLOWER..MARTIAL ARTS UNIFORM -1F950..1F95E;W # So [15] CROISSANT..PANCAKES -1F980..1F991;W # So [18] CRAB..SQUID +1F900..1F90B;N # So [12] CIRCLED CROSS FORMEE WITH FOUR DOTS..DOWNWARD FACING NOTCHED HOOK WITH DOT +1F910..1F93E;W # So [47] ZIPPER-MOUTH FACE..HANDBALL +1F940..1F94C;W # So [13] WILTED FLOWER..CURLING STONE +1F950..1F96B;W # So [28] CROISSANT..CANNED FOOD +1F980..1F997;W # So [24] CRAB..CRICKET 1F9C0;W # So CHEESE WEDGE +1F9D0..1F9E6;W # So [23] FACE WITH MONOCLE..SOCKS 20000..2A6D6;W # Lo [42711] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6D6 2A6D7..2A6FF;W # Cn [41] .. 2A700..2B734;W # Lo [4149] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B734 @@ -2325,7 +2367,9 @@ FFFD;A # So REPLACEMENT CHARACTER 2B740..2B81D;W # Lo [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D 2B81E..2B81F;W # Cn [2] .. 2B820..2CEA1;W # Lo [5762] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEA1 -2CEA2..2F7FF;W # Cn [10590] .. +2CEA2..2CEAF;W # Cn [14] .. +2CEB0..2EBE0;W # Lo [7473] CJK UNIFIED IDEOGRAPH-2CEB0..CJK UNIFIED IDEOGRAPH-2EBE0 +2EBE1..2F7FF;W # Cn [3103] .. 2F800..2FA1D;W # Lo [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D 2FA1E..2FFFD;W # Cn [1504] .. 30000..3FFFD;W # Cn [65534] .. diff --git a/unicode/UnicodeData.txt b/unicode/UnicodeData.txt index a756976461..d89c64f526 100644 --- a/unicode/UnicodeData.txt +++ b/unicode/UnicodeData.txt @@ -2072,6 +2072,17 @@ 085A;MANDAIC VOCALIZATION MARK;Mn;220;NSM;;;;;N;;;;; 085B;MANDAIC GEMINATION MARK;Mn;220;NSM;;;;;N;;;;; 085E;MANDAIC PUNCTUATION;Po;0;R;;;;;N;;;;; +0860;SYRIAC LETTER MALAYALAM NGA;Lo;0;AL;;;;;N;;;;; +0861;SYRIAC LETTER MALAYALAM JA;Lo;0;AL;;;;;N;;;;; +0862;SYRIAC LETTER MALAYALAM NYA;Lo;0;AL;;;;;N;;;;; +0863;SYRIAC LETTER MALAYALAM TTA;Lo;0;AL;;;;;N;;;;; +0864;SYRIAC LETTER MALAYALAM NNA;Lo;0;AL;;;;;N;;;;; +0865;SYRIAC LETTER MALAYALAM NNNA;Lo;0;AL;;;;;N;;;;; +0866;SYRIAC LETTER MALAYALAM BHA;Lo;0;AL;;;;;N;;;;; +0867;SYRIAC LETTER MALAYALAM RA;Lo;0;AL;;;;;N;;;;; +0868;SYRIAC LETTER MALAYALAM LLA;Lo;0;AL;;;;;N;;;;; +0869;SYRIAC LETTER MALAYALAM LLLA;Lo;0;AL;;;;;N;;;;; +086A;SYRIAC LETTER MALAYALAM SSA;Lo;0;AL;;;;;N;;;;; 08A0;ARABIC LETTER BEH WITH SMALL V BELOW;Lo;0;AL;;;;;N;;;;; 08A1;ARABIC LETTER BEH WITH HAMZA ABOVE;Lo;0;AL;;;;;N;;;;; 08A2;ARABIC LETTER JEEM WITH TWO DOTS ABOVE;Lo;0;AL;;;;;N;;;;; @@ -2366,6 +2377,8 @@ 09F9;BENGALI CURRENCY DENOMINATOR SIXTEEN;No;0;L;;;;16;N;;;;; 09FA;BENGALI ISSHAR;So;0;L;;;;;N;;;;; 09FB;BENGALI GANDA MARK;Sc;0;ET;;;;;N;;;;; +09FC;BENGALI LETTER VEDIC ANUSVARA;Lo;0;L;;;;;N;;;;; +09FD;BENGALI ABBREVIATION SIGN;Po;0;L;;;;;N;;;;; 0A01;GURMUKHI SIGN ADAK BINDI;Mn;0;NSM;;;;;N;;;;; 0A02;GURMUKHI SIGN BINDI;Mn;0;NSM;;;;;N;;;;; 0A03;GURMUKHI SIGN VISARGA;Mc;0;L;;;;;N;;;;; @@ -2530,6 +2543,12 @@ 0AF0;GUJARATI ABBREVIATION SIGN;Po;0;L;;;;;N;;;;; 0AF1;GUJARATI RUPEE SIGN;Sc;0;ET;;;;;N;;;;; 0AF9;GUJARATI LETTER ZHA;Lo;0;L;;;;;N;;;;; +0AFA;GUJARATI SIGN SUKUN;Mn;0;NSM;;;;;N;;;;; +0AFB;GUJARATI SIGN SHADDA;Mn;0;NSM;;;;;N;;;;; +0AFC;GUJARATI SIGN MADDAH;Mn;0;NSM;;;;;N;;;;; +0AFD;GUJARATI SIGN THREE-DOT NUKTA ABOVE;Mn;0;NSM;;;;;N;;;;; +0AFE;GUJARATI SIGN CIRCLE NUKTA ABOVE;Mn;0;NSM;;;;;N;;;;; +0AFF;GUJARATI SIGN TWO-CIRCLE NUKTA ABOVE;Mn;0;NSM;;;;;N;;;;; 0B01;ORIYA SIGN CANDRABINDU;Mn;0;NSM;;;;;N;;;;; 0B02;ORIYA SIGN ANUSVARA;Mc;0;L;;;;;N;;;;; 0B03;ORIYA SIGN VISARGA;Mc;0;L;;;;;N;;;;; @@ -2876,6 +2895,7 @@ 0CEF;KANNADA DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 0CF1;KANNADA SIGN JIHVAMULIYA;Lo;0;L;;;;;N;;;;; 0CF2;KANNADA SIGN UPADHMANIYA;Lo;0;L;;;;;N;;;;; +0D00;MALAYALAM SIGN COMBINING ANUSVARA ABOVE;Mn;0;NSM;;;;;N;;;;; 0D01;MALAYALAM SIGN CANDRABINDU;Mn;0;NSM;;;;;N;;;;; 0D02;MALAYALAM SIGN ANUSVARA;Mc;0;L;;;;;N;;;;; 0D03;MALAYALAM SIGN VISARGA;Mc;0;L;;;;;N;;;;; @@ -2931,6 +2951,8 @@ 0D38;MALAYALAM LETTER SA;Lo;0;L;;;;;N;;;;; 0D39;MALAYALAM LETTER HA;Lo;0;L;;;;;N;;;;; 0D3A;MALAYALAM LETTER TTTA;Lo;0;L;;;;;N;;;;; +0D3B;MALAYALAM SIGN VERTICAL BAR VIRAMA;Mn;9;NSM;;;;;N;;;;; +0D3C;MALAYALAM SIGN CIRCULAR VIRAMA;Mn;9;NSM;;;;;N;;;;; 0D3D;MALAYALAM SIGN AVAGRAHA;Lo;0;L;;;;;N;;;;; 0D3E;MALAYALAM VOWEL SIGN AA;Mc;0;L;;;;;N;;;;; 0D3F;MALAYALAM VOWEL SIGN I;Mc;0;L;;;;;N;;;;; @@ -6413,6 +6435,7 @@ 1CF4;VEDIC TONE CANDRA ABOVE;Mn;230;NSM;;;;;N;;;;; 1CF5;VEDIC SIGN JIHVAMULIYA;Lo;0;L;;;;;N;;;;; 1CF6;VEDIC SIGN UPADHMANIYA;Lo;0;L;;;;;N;;;;; +1CF7;VEDIC SIGN ATIKRAMA;Mc;0;L;;;;;N;;;;; 1CF8;VEDIC TONE RING ABOVE;Mn;230;NSM;;;;;N;;;;; 1CF9;VEDIC TONE DOUBLE RING ABOVE;Mn;230;NSM;;;;;N;;;;; 1D00;LATIN LETTER SMALL CAPITAL A;Ll;0;L;;;;;N;;;;; @@ -6661,6 +6684,10 @@ 1DF3;COMBINING LATIN SMALL LETTER O WITH DIAERESIS;Mn;230;NSM;;;;;N;;;;; 1DF4;COMBINING LATIN SMALL LETTER U WITH DIAERESIS;Mn;230;NSM;;;;;N;;;;; 1DF5;COMBINING UP TACK ABOVE;Mn;230;NSM;;;;;N;;;;; +1DF6;COMBINING KAVYKA ABOVE RIGHT;Mn;232;NSM;;;;;N;;;;; +1DF7;COMBINING KAVYKA ABOVE LEFT;Mn;228;NSM;;;;;N;;;;; +1DF8;COMBINING DOT ABOVE LEFT;Mn;228;NSM;;;;;N;;;;; +1DF9;COMBINING WIDE INVERTED BRIDGE BELOW;Mn;220;NSM;;;;;N;;;;; 1DFB;COMBINING DELETION MARK;Mn;230;NSM;;;;;N;;;;; 1DFC;COMBINING DOUBLE INVERTED BREVE BELOW;Mn;233;NSM;;;;;N;;;;; 1DFD;COMBINING ALMOST EQUAL TO BELOW;Mn;220;NSM;;;;;N;;;;; @@ -7339,6 +7366,7 @@ 20BC;MANAT SIGN;Sc;0;ET;;;;;N;;;;; 20BD;RUBLE SIGN;Sc;0;ET;;;;;N;;;;; 20BE;LARI SIGN;Sc;0;ET;;;;;N;;;;; +20BF;BITCOIN SIGN;Sc;0;ET;;;;;N;;;;; 20D0;COMBINING LEFT HARPOON ABOVE;Mn;230;NSM;;;;;N;NON-SPACING LEFT HARPOON ABOVE;;;; 20D1;COMBINING RIGHT HARPOON ABOVE;Mn;230;NSM;;;;;N;NON-SPACING RIGHT HARPOON ABOVE;;;; 20D2;COMBINING LONG VERTICAL LINE OVERLAY;Mn;1;NSM;;;;;N;NON-SPACING LONG VERTICAL BAR OVERLAY;;;; @@ -8135,6 +8163,7 @@ 23FC;POWER ON-OFF SYMBOL;So;0;ON;;;;;N;;;;; 23FD;POWER ON SYMBOL;So;0;ON;;;;;N;;;;; 23FE;POWER SLEEP SYMBOL;So;0;ON;;;;;N;;;;; +23FF;OBSERVER EYE SYMBOL;So;0;ON;;;;;N;;;;; 2400;SYMBOL FOR NULL;So;0;ON;;;;;N;GRAPHIC FOR NULL;;;; 2401;SYMBOL FOR START OF HEADING;So;0;ON;;;;;N;GRAPHIC FOR START OF HEADING;;;; 2402;SYMBOL FOR START OF TEXT;So;0;ON;;;;;N;GRAPHIC FOR START OF TEXT;;;; @@ -10083,6 +10112,7 @@ 2BCF;ROTATED WHITE FOUR POINTED CUSP;So;0;ON;;;;;N;;;;; 2BD0;SQUARE POSITION INDICATOR;So;0;ON;;;;;N;;;;; 2BD1;UNCERTAINTY SIGN;So;0;ON;;;;;N;;;;; +2BD2;GROUP MARK;So;0;ON;;;;;N;;;;; 2BEC;LEFTWARDS TWO-HEADED ARROW WITH TRIANGLE ARROWHEADS;So;0;ON;;;;;N;;;;; 2BED;UPWARDS TWO-HEADED ARROW WITH TRIANGLE ARROWHEADS;So;0;ON;;;;;N;;;;; 2BEE;RIGHTWARDS TWO-HEADED ARROW WITH TRIANGLE ARROWHEADS;So;0;ON;;;;;N;;;;; @@ -10615,6 +10645,11 @@ 2E42;DOUBLE LOW-REVERSED-9 QUOTATION MARK;Ps;0;ON;;;;;N;;;;; 2E43;DASH WITH LEFT UPTURN;Po;0;ON;;;;;N;;;;; 2E44;DOUBLE SUSPENSION MARK;Po;0;ON;;;;;N;;;;; +2E45;INVERTED LOW KAVYKA;Po;0;ON;;;;;N;;;;; +2E46;INVERTED LOW KAVYKA WITH KAVYKA ABOVE;Po;0;ON;;;;;N;;;;; +2E47;LOW KAVYKA;Po;0;ON;;;;;N;;;;; +2E48;LOW KAVYKA WITH DOT;Po;0;ON;;;;;N;;;;; +2E49;DOUBLE STACKED COMMA;Po;0;ON;;;;;N;;;;; 2E80;CJK RADICAL REPEAT;So;0;ON;;;;;N;;;;; 2E81;CJK RADICAL CLIFF;So;0;ON;;;;;N;;;;; 2E82;CJK RADICAL SECOND ONE;So;0;ON;;;;;N;;;;; @@ -11250,6 +11285,7 @@ 312B;BOPOMOFO LETTER NG;Lo;0;L;;;;;N;;;;; 312C;BOPOMOFO LETTER GN;Lo;0;L;;;;;N;;;;; 312D;BOPOMOFO LETTER IH;Lo;0;L;;;;;N;;;;; +312E;BOPOMOFO LETTER O WITH DOT ABOVE;Lo;0;L;;;;;N;;;;; 3131;HANGUL LETTER KIYEOK;Lo;0;L; 1100;;;;N;HANGUL LETTER GIYEOG;;;; 3132;HANGUL LETTER SSANGKIYEOK;Lo;0;L; 1101;;;;N;HANGUL LETTER SSANG GIYEOG;;;; 3133;HANGUL LETTER KIYEOK-SIOS;Lo;0;L; 11AA;;;;N;HANGUL LETTER GIYEOG SIOS;;;; @@ -12016,7 +12052,7 @@ 4DFE;HEXAGRAM FOR AFTER COMPLETION;So;0;ON;;;;;N;;;;; 4DFF;HEXAGRAM FOR BEFORE COMPLETION;So;0;ON;;;;;N;;;;; 4E00;;Lo;0;L;;;;;N;;;;; -9FD5;;Lo;0;L;;;;;N;;;;; +9FEA;;Lo;0;L;;;;;N;;;;; A000;YI SYLLABLE IT;Lo;0;L;;;;;N;;;;; A001;YI SYLLABLE IX;Lo;0;L;;;;;N;;;;; A002;YI SYLLABLE I;Lo;0;L;;;;;N;;;;; @@ -17093,6 +17129,9 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 10321;OLD ITALIC NUMERAL FIVE;No;0;L;;;;5;N;;;;; 10322;OLD ITALIC NUMERAL TEN;No;0;L;;;;10;N;;;;; 10323;OLD ITALIC NUMERAL FIFTY;No;0;L;;;;50;N;;;;; +1032D;OLD ITALIC LETTER YE;Lo;0;L;;;;;N;;;;; +1032E;OLD ITALIC LETTER NORTHERN TSE;Lo;0;L;;;;;N;;;;; +1032F;OLD ITALIC LETTER SOUTHERN TSE;Lo;0;L;;;;;N;;;;; 10330;GOTHIC LETTER AHSA;Lo;0;L;;;;;N;;;;; 10331;GOTHIC LETTER BAIRKAN;Lo;0;L;;;;;N;;;;; 10332;GOTHIC LETTER GIBA;Lo;0;L;;;;;N;;;;; @@ -20068,6 +20107,158 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 118F1;WARANG CITI NUMBER EIGHTY;No;0;L;;;;80;N;;;;; 118F2;WARANG CITI NUMBER NINETY;No;0;L;;;;90;N;;;;; 118FF;WARANG CITI OM;Lo;0;L;;;;;N;;;;; +11A00;ZANABAZAR SQUARE LETTER A;Lo;0;L;;;;;N;;;;; +11A01;ZANABAZAR SQUARE VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;; +11A02;ZANABAZAR SQUARE VOWEL SIGN UE;Mn;0;NSM;;;;;N;;;;; +11A03;ZANABAZAR SQUARE VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; +11A04;ZANABAZAR SQUARE VOWEL SIGN E;Mn;0;NSM;;;;;N;;;;; +11A05;ZANABAZAR SQUARE VOWEL SIGN OE;Mn;0;NSM;;;;;N;;;;; +11A06;ZANABAZAR SQUARE VOWEL SIGN O;Mn;0;NSM;;;;;N;;;;; +11A07;ZANABAZAR SQUARE VOWEL SIGN AI;Mc;0;L;;;;;N;;;;; +11A08;ZANABAZAR SQUARE VOWEL SIGN AU;Mc;0;L;;;;;N;;;;; +11A09;ZANABAZAR SQUARE VOWEL SIGN REVERSED I;Mn;0;NSM;;;;;N;;;;; +11A0A;ZANABAZAR SQUARE VOWEL LENGTH MARK;Mn;0;NSM;;;;;N;;;;; +11A0B;ZANABAZAR SQUARE LETTER KA;Lo;0;L;;;;;N;;;;; +11A0C;ZANABAZAR SQUARE LETTER KHA;Lo;0;L;;;;;N;;;;; +11A0D;ZANABAZAR SQUARE LETTER GA;Lo;0;L;;;;;N;;;;; +11A0E;ZANABAZAR SQUARE LETTER GHA;Lo;0;L;;;;;N;;;;; +11A0F;ZANABAZAR SQUARE LETTER NGA;Lo;0;L;;;;;N;;;;; +11A10;ZANABAZAR SQUARE LETTER CA;Lo;0;L;;;;;N;;;;; +11A11;ZANABAZAR SQUARE LETTER CHA;Lo;0;L;;;;;N;;;;; +11A12;ZANABAZAR SQUARE LETTER JA;Lo;0;L;;;;;N;;;;; +11A13;ZANABAZAR SQUARE LETTER NYA;Lo;0;L;;;;;N;;;;; +11A14;ZANABAZAR SQUARE LETTER TTA;Lo;0;L;;;;;N;;;;; +11A15;ZANABAZAR SQUARE LETTER TTHA;Lo;0;L;;;;;N;;;;; +11A16;ZANABAZAR SQUARE LETTER DDA;Lo;0;L;;;;;N;;;;; +11A17;ZANABAZAR SQUARE LETTER DDHA;Lo;0;L;;;;;N;;;;; +11A18;ZANABAZAR SQUARE LETTER NNA;Lo;0;L;;;;;N;;;;; +11A19;ZANABAZAR SQUARE LETTER TA;Lo;0;L;;;;;N;;;;; +11A1A;ZANABAZAR SQUARE LETTER THA;Lo;0;L;;;;;N;;;;; +11A1B;ZANABAZAR SQUARE LETTER DA;Lo;0;L;;;;;N;;;;; +11A1C;ZANABAZAR SQUARE LETTER DHA;Lo;0;L;;;;;N;;;;; +11A1D;ZANABAZAR SQUARE LETTER NA;Lo;0;L;;;;;N;;;;; +11A1E;ZANABAZAR SQUARE LETTER PA;Lo;0;L;;;;;N;;;;; +11A1F;ZANABAZAR SQUARE LETTER PHA;Lo;0;L;;;;;N;;;;; +11A20;ZANABAZAR SQUARE LETTER BA;Lo;0;L;;;;;N;;;;; +11A21;ZANABAZAR SQUARE LETTER BHA;Lo;0;L;;;;;N;;;;; +11A22;ZANABAZAR SQUARE LETTER MA;Lo;0;L;;;;;N;;;;; +11A23;ZANABAZAR SQUARE LETTER TSA;Lo;0;L;;;;;N;;;;; +11A24;ZANABAZAR SQUARE LETTER TSHA;Lo;0;L;;;;;N;;;;; +11A25;ZANABAZAR SQUARE LETTER DZA;Lo;0;L;;;;;N;;;;; +11A26;ZANABAZAR SQUARE LETTER DZHA;Lo;0;L;;;;;N;;;;; +11A27;ZANABAZAR SQUARE LETTER ZHA;Lo;0;L;;;;;N;;;;; +11A28;ZANABAZAR SQUARE LETTER ZA;Lo;0;L;;;;;N;;;;; +11A29;ZANABAZAR SQUARE LETTER -A;Lo;0;L;;;;;N;;;;; +11A2A;ZANABAZAR SQUARE LETTER YA;Lo;0;L;;;;;N;;;;; +11A2B;ZANABAZAR SQUARE LETTER RA;Lo;0;L;;;;;N;;;;; +11A2C;ZANABAZAR SQUARE LETTER LA;Lo;0;L;;;;;N;;;;; +11A2D;ZANABAZAR SQUARE LETTER VA;Lo;0;L;;;;;N;;;;; +11A2E;ZANABAZAR SQUARE LETTER SHA;Lo;0;L;;;;;N;;;;; +11A2F;ZANABAZAR SQUARE LETTER SSA;Lo;0;L;;;;;N;;;;; +11A30;ZANABAZAR SQUARE LETTER SA;Lo;0;L;;;;;N;;;;; +11A31;ZANABAZAR SQUARE LETTER HA;Lo;0;L;;;;;N;;;;; +11A32;ZANABAZAR SQUARE LETTER KSSA;Lo;0;L;;;;;N;;;;; +11A33;ZANABAZAR SQUARE FINAL CONSONANT MARK;Mn;0;NSM;;;;;N;;;;; +11A34;ZANABAZAR SQUARE SIGN VIRAMA;Mn;9;NSM;;;;;N;;;;; +11A35;ZANABAZAR SQUARE SIGN CANDRABINDU;Mn;0;NSM;;;;;N;;;;; +11A36;ZANABAZAR SQUARE SIGN CANDRABINDU WITH ORNAMENT;Mn;0;NSM;;;;;N;;;;; +11A37;ZANABAZAR SQUARE SIGN CANDRA WITH ORNAMENT;Mn;0;NSM;;;;;N;;;;; +11A38;ZANABAZAR SQUARE SIGN ANUSVARA;Mn;0;NSM;;;;;N;;;;; +11A39;ZANABAZAR SQUARE SIGN VISARGA;Mc;0;L;;;;;N;;;;; +11A3A;ZANABAZAR SQUARE CLUSTER-INITIAL LETTER RA;Lo;0;L;;;;;N;;;;; +11A3B;ZANABAZAR SQUARE CLUSTER-FINAL LETTER YA;Mn;0;NSM;;;;;N;;;;; +11A3C;ZANABAZAR SQUARE CLUSTER-FINAL LETTER RA;Mn;0;NSM;;;;;N;;;;; +11A3D;ZANABAZAR SQUARE CLUSTER-FINAL LETTER LA;Mn;0;NSM;;;;;N;;;;; +11A3E;ZANABAZAR SQUARE CLUSTER-FINAL LETTER VA;Mn;0;NSM;;;;;N;;;;; +11A3F;ZANABAZAR SQUARE INITIAL HEAD MARK;Po;0;L;;;;;N;;;;; +11A40;ZANABAZAR SQUARE CLOSING HEAD MARK;Po;0;L;;;;;N;;;;; +11A41;ZANABAZAR SQUARE MARK TSHEG;Po;0;L;;;;;N;;;;; +11A42;ZANABAZAR SQUARE MARK SHAD;Po;0;L;;;;;N;;;;; +11A43;ZANABAZAR SQUARE MARK DOUBLE SHAD;Po;0;L;;;;;N;;;;; +11A44;ZANABAZAR SQUARE MARK LONG TSHEG;Po;0;L;;;;;N;;;;; +11A45;ZANABAZAR SQUARE INITIAL DOUBLE-LINED HEAD MARK;Po;0;L;;;;;N;;;;; +11A46;ZANABAZAR SQUARE CLOSING DOUBLE-LINED HEAD MARK;Po;0;L;;;;;N;;;;; +11A47;ZANABAZAR SQUARE SUBJOINER;Mn;9;NSM;;;;;N;;;;; +11A50;SOYOMBO LETTER A;Lo;0;L;;;;;N;;;;; +11A51;SOYOMBO VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;; +11A52;SOYOMBO VOWEL SIGN UE;Mn;0;NSM;;;;;N;;;;; +11A53;SOYOMBO VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; +11A54;SOYOMBO VOWEL SIGN E;Mn;0;NSM;;;;;N;;;;; +11A55;SOYOMBO VOWEL SIGN O;Mn;0;NSM;;;;;N;;;;; +11A56;SOYOMBO VOWEL SIGN OE;Mn;0;NSM;;;;;N;;;;; +11A57;SOYOMBO VOWEL SIGN AI;Mc;0;L;;;;;N;;;;; +11A58;SOYOMBO VOWEL SIGN AU;Mc;0;L;;;;;N;;;;; +11A59;SOYOMBO VOWEL SIGN VOCALIC R;Mn;0;NSM;;;;;N;;;;; +11A5A;SOYOMBO VOWEL SIGN VOCALIC L;Mn;0;NSM;;;;;N;;;;; +11A5B;SOYOMBO VOWEL LENGTH MARK;Mn;0;NSM;;;;;N;;;;; +11A5C;SOYOMBO LETTER KA;Lo;0;L;;;;;N;;;;; +11A5D;SOYOMBO LETTER KHA;Lo;0;L;;;;;N;;;;; +11A5E;SOYOMBO LETTER GA;Lo;0;L;;;;;N;;;;; +11A5F;SOYOMBO LETTER GHA;Lo;0;L;;;;;N;;;;; +11A60;SOYOMBO LETTER NGA;Lo;0;L;;;;;N;;;;; +11A61;SOYOMBO LETTER CA;Lo;0;L;;;;;N;;;;; +11A62;SOYOMBO LETTER CHA;Lo;0;L;;;;;N;;;;; +11A63;SOYOMBO LETTER JA;Lo;0;L;;;;;N;;;;; +11A64;SOYOMBO LETTER JHA;Lo;0;L;;;;;N;;;;; +11A65;SOYOMBO LETTER NYA;Lo;0;L;;;;;N;;;;; +11A66;SOYOMBO LETTER TTA;Lo;0;L;;;;;N;;;;; +11A67;SOYOMBO LETTER TTHA;Lo;0;L;;;;;N;;;;; +11A68;SOYOMBO LETTER DDA;Lo;0;L;;;;;N;;;;; +11A69;SOYOMBO LETTER DDHA;Lo;0;L;;;;;N;;;;; +11A6A;SOYOMBO LETTER NNA;Lo;0;L;;;;;N;;;;; +11A6B;SOYOMBO LETTER TA;Lo;0;L;;;;;N;;;;; +11A6C;SOYOMBO LETTER THA;Lo;0;L;;;;;N;;;;; +11A6D;SOYOMBO LETTER DA;Lo;0;L;;;;;N;;;;; +11A6E;SOYOMBO LETTER DHA;Lo;0;L;;;;;N;;;;; +11A6F;SOYOMBO LETTER NA;Lo;0;L;;;;;N;;;;; +11A70;SOYOMBO LETTER PA;Lo;0;L;;;;;N;;;;; +11A71;SOYOMBO LETTER PHA;Lo;0;L;;;;;N;;;;; +11A72;SOYOMBO LETTER BA;Lo;0;L;;;;;N;;;;; +11A73;SOYOMBO LETTER BHA;Lo;0;L;;;;;N;;;;; +11A74;SOYOMBO LETTER MA;Lo;0;L;;;;;N;;;;; +11A75;SOYOMBO LETTER TSA;Lo;0;L;;;;;N;;;;; +11A76;SOYOMBO LETTER TSHA;Lo;0;L;;;;;N;;;;; +11A77;SOYOMBO LETTER DZA;Lo;0;L;;;;;N;;;;; +11A78;SOYOMBO LETTER ZHA;Lo;0;L;;;;;N;;;;; +11A79;SOYOMBO LETTER ZA;Lo;0;L;;;;;N;;;;; +11A7A;SOYOMBO LETTER -A;Lo;0;L;;;;;N;;;;; +11A7B;SOYOMBO LETTER YA;Lo;0;L;;;;;N;;;;; +11A7C;SOYOMBO LETTER RA;Lo;0;L;;;;;N;;;;; +11A7D;SOYOMBO LETTER LA;Lo;0;L;;;;;N;;;;; +11A7E;SOYOMBO LETTER VA;Lo;0;L;;;;;N;;;;; +11A7F;SOYOMBO LETTER SHA;Lo;0;L;;;;;N;;;;; +11A80;SOYOMBO LETTER SSA;Lo;0;L;;;;;N;;;;; +11A81;SOYOMBO LETTER SA;Lo;0;L;;;;;N;;;;; +11A82;SOYOMBO LETTER HA;Lo;0;L;;;;;N;;;;; +11A83;SOYOMBO LETTER KSSA;Lo;0;L;;;;;N;;;;; +11A86;SOYOMBO CLUSTER-INITIAL LETTER RA;Lo;0;L;;;;;N;;;;; +11A87;SOYOMBO CLUSTER-INITIAL LETTER LA;Lo;0;L;;;;;N;;;;; +11A88;SOYOMBO CLUSTER-INITIAL LETTER SHA;Lo;0;L;;;;;N;;;;; +11A89;SOYOMBO CLUSTER-INITIAL LETTER SA;Lo;0;L;;;;;N;;;;; +11A8A;SOYOMBO FINAL CONSONANT SIGN G;Mn;0;NSM;;;;;N;;;;; +11A8B;SOYOMBO FINAL CONSONANT SIGN K;Mn;0;NSM;;;;;N;;;;; +11A8C;SOYOMBO FINAL CONSONANT SIGN NG;Mn;0;NSM;;;;;N;;;;; +11A8D;SOYOMBO FINAL CONSONANT SIGN D;Mn;0;NSM;;;;;N;;;;; +11A8E;SOYOMBO FINAL CONSONANT SIGN N;Mn;0;NSM;;;;;N;;;;; +11A8F;SOYOMBO FINAL CONSONANT SIGN B;Mn;0;NSM;;;;;N;;;;; +11A90;SOYOMBO FINAL CONSONANT SIGN M;Mn;0;NSM;;;;;N;;;;; +11A91;SOYOMBO FINAL CONSONANT SIGN R;Mn;0;NSM;;;;;N;;;;; +11A92;SOYOMBO FINAL CONSONANT SIGN L;Mn;0;NSM;;;;;N;;;;; +11A93;SOYOMBO FINAL CONSONANT SIGN SH;Mn;0;NSM;;;;;N;;;;; +11A94;SOYOMBO FINAL CONSONANT SIGN S;Mn;0;NSM;;;;;N;;;;; +11A95;SOYOMBO FINAL CONSONANT SIGN -A;Mn;0;NSM;;;;;N;;;;; +11A96;SOYOMBO SIGN ANUSVARA;Mn;0;NSM;;;;;N;;;;; +11A97;SOYOMBO SIGN VISARGA;Mc;0;L;;;;;N;;;;; +11A98;SOYOMBO GEMINATION MARK;Mn;0;NSM;;;;;N;;;;; +11A99;SOYOMBO SUBJOINER;Mn;9;NSM;;;;;N;;;;; +11A9A;SOYOMBO MARK TSHEG;Po;0;L;;;;;N;;;;; +11A9B;SOYOMBO MARK SHAD;Po;0;L;;;;;N;;;;; +11A9C;SOYOMBO MARK DOUBLE SHAD;Po;0;L;;;;;N;;;;; +11A9E;SOYOMBO HEAD MARK WITH MOON AND SUN AND TRIPLE FLAME;Po;0;L;;;;;N;;;;; +11A9F;SOYOMBO HEAD MARK WITH MOON AND SUN AND FLAME;Po;0;L;;;;;N;;;;; +11AA0;SOYOMBO HEAD MARK WITH MOON AND SUN;Po;0;L;;;;;N;;;;; +11AA1;SOYOMBO TERMINAL MARK-1;Po;0;L;;;;;N;;;;; +11AA2;SOYOMBO TERMINAL MARK-2;Po;0;L;;;;;N;;;;; 11AC0;PAU CIN HAU LETTER PA;Lo;0;L;;;;;N;;;;; 11AC1;PAU CIN HAU LETTER KA;Lo;0;L;;;;;N;;;;; 11AC2;PAU CIN HAU LETTER LA;Lo;0;L;;;;;N;;;;; @@ -20290,6 +20481,81 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 11CB4;MARCHEN VOWEL SIGN O;Mc;0;L;;;;;N;;;;; 11CB5;MARCHEN SIGN ANUSVARA;Mn;0;NSM;;;;;N;;;;; 11CB6;MARCHEN SIGN CANDRABINDU;Mn;0;NSM;;;;;N;;;;; +11D00;MASARAM GONDI LETTER A;Lo;0;L;;;;;N;;;;; +11D01;MASARAM GONDI LETTER AA;Lo;0;L;;;;;N;;;;; +11D02;MASARAM GONDI LETTER I;Lo;0;L;;;;;N;;;;; +11D03;MASARAM GONDI LETTER II;Lo;0;L;;;;;N;;;;; +11D04;MASARAM GONDI LETTER U;Lo;0;L;;;;;N;;;;; +11D05;MASARAM GONDI LETTER UU;Lo;0;L;;;;;N;;;;; +11D06;MASARAM GONDI LETTER E;Lo;0;L;;;;;N;;;;; +11D08;MASARAM GONDI LETTER AI;Lo;0;L;;;;;N;;;;; +11D09;MASARAM GONDI LETTER O;Lo;0;L;;;;;N;;;;; +11D0B;MASARAM GONDI LETTER AU;Lo;0;L;;;;;N;;;;; +11D0C;MASARAM GONDI LETTER KA;Lo;0;L;;;;;N;;;;; +11D0D;MASARAM GONDI LETTER KHA;Lo;0;L;;;;;N;;;;; +11D0E;MASARAM GONDI LETTER GA;Lo;0;L;;;;;N;;;;; +11D0F;MASARAM GONDI LETTER GHA;Lo;0;L;;;;;N;;;;; +11D10;MASARAM GONDI LETTER NGA;Lo;0;L;;;;;N;;;;; +11D11;MASARAM GONDI LETTER CA;Lo;0;L;;;;;N;;;;; +11D12;MASARAM GONDI LETTER CHA;Lo;0;L;;;;;N;;;;; +11D13;MASARAM GONDI LETTER JA;Lo;0;L;;;;;N;;;;; +11D14;MASARAM GONDI LETTER JHA;Lo;0;L;;;;;N;;;;; +11D15;MASARAM GONDI LETTER NYA;Lo;0;L;;;;;N;;;;; +11D16;MASARAM GONDI LETTER TTA;Lo;0;L;;;;;N;;;;; +11D17;MASARAM GONDI LETTER TTHA;Lo;0;L;;;;;N;;;;; +11D18;MASARAM GONDI LETTER DDA;Lo;0;L;;;;;N;;;;; +11D19;MASARAM GONDI LETTER DDHA;Lo;0;L;;;;;N;;;;; +11D1A;MASARAM GONDI LETTER NNA;Lo;0;L;;;;;N;;;;; +11D1B;MASARAM GONDI LETTER TA;Lo;0;L;;;;;N;;;;; +11D1C;MASARAM GONDI LETTER THA;Lo;0;L;;;;;N;;;;; +11D1D;MASARAM GONDI LETTER DA;Lo;0;L;;;;;N;;;;; +11D1E;MASARAM GONDI LETTER DHA;Lo;0;L;;;;;N;;;;; +11D1F;MASARAM GONDI LETTER NA;Lo;0;L;;;;;N;;;;; +11D20;MASARAM GONDI LETTER PA;Lo;0;L;;;;;N;;;;; +11D21;MASARAM GONDI LETTER PHA;Lo;0;L;;;;;N;;;;; +11D22;MASARAM GONDI LETTER BA;Lo;0;L;;;;;N;;;;; +11D23;MASARAM GONDI LETTER BHA;Lo;0;L;;;;;N;;;;; +11D24;MASARAM GONDI LETTER MA;Lo;0;L;;;;;N;;;;; +11D25;MASARAM GONDI LETTER YA;Lo;0;L;;;;;N;;;;; +11D26;MASARAM GONDI LETTER RA;Lo;0;L;;;;;N;;;;; +11D27;MASARAM GONDI LETTER LA;Lo;0;L;;;;;N;;;;; +11D28;MASARAM GONDI LETTER VA;Lo;0;L;;;;;N;;;;; +11D29;MASARAM GONDI LETTER SHA;Lo;0;L;;;;;N;;;;; +11D2A;MASARAM GONDI LETTER SSA;Lo;0;L;;;;;N;;;;; +11D2B;MASARAM GONDI LETTER SA;Lo;0;L;;;;;N;;;;; +11D2C;MASARAM GONDI LETTER HA;Lo;0;L;;;;;N;;;;; +11D2D;MASARAM GONDI LETTER LLA;Lo;0;L;;;;;N;;;;; +11D2E;MASARAM GONDI LETTER KSSA;Lo;0;L;;;;;N;;;;; +11D2F;MASARAM GONDI LETTER JNYA;Lo;0;L;;;;;N;;;;; +11D30;MASARAM GONDI LETTER TRA;Lo;0;L;;;;;N;;;;; +11D31;MASARAM GONDI VOWEL SIGN AA;Mn;0;NSM;;;;;N;;;;; +11D32;MASARAM GONDI VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;; +11D33;MASARAM GONDI VOWEL SIGN II;Mn;0;NSM;;;;;N;;;;; +11D34;MASARAM GONDI VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; +11D35;MASARAM GONDI VOWEL SIGN UU;Mn;0;NSM;;;;;N;;;;; +11D36;MASARAM GONDI VOWEL SIGN VOCALIC R;Mn;0;NSM;;;;;N;;;;; +11D3A;MASARAM GONDI VOWEL SIGN E;Mn;0;NSM;;;;;N;;;;; +11D3C;MASARAM GONDI VOWEL SIGN AI;Mn;0;NSM;;;;;N;;;;; +11D3D;MASARAM GONDI VOWEL SIGN O;Mn;0;NSM;;;;;N;;;;; +11D3F;MASARAM GONDI VOWEL SIGN AU;Mn;0;NSM;;;;;N;;;;; +11D40;MASARAM GONDI SIGN ANUSVARA;Mn;0;NSM;;;;;N;;;;; +11D41;MASARAM GONDI SIGN VISARGA;Mn;0;NSM;;;;;N;;;;; +11D42;MASARAM GONDI SIGN NUKTA;Mn;7;NSM;;;;;N;;;;; +11D43;MASARAM GONDI SIGN CANDRA;Mn;0;NSM;;;;;N;;;;; +11D44;MASARAM GONDI SIGN HALANTA;Mn;9;NSM;;;;;N;;;;; +11D45;MASARAM GONDI VIRAMA;Mn;9;NSM;;;;;N;;;;; +11D46;MASARAM GONDI REPHA;Lo;0;L;;;;;N;;;;; +11D47;MASARAM GONDI RA-KARA;Mn;0;NSM;;;;;N;;;;; +11D50;MASARAM GONDI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; +11D51;MASARAM GONDI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; +11D52;MASARAM GONDI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; +11D53;MASARAM GONDI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; +11D54;MASARAM GONDI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; +11D55;MASARAM GONDI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; +11D56;MASARAM GONDI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; +11D57;MASARAM GONDI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; +11D58;MASARAM GONDI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; +11D59;MASARAM GONDI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 12000;CUNEIFORM SIGN A;Lo;0;L;;;;;N;;;;; 12001;CUNEIFORM SIGN A TIMES A;Lo;0;L;;;;;N;;;;; 12002;CUNEIFORM SIGN A TIMES BAD;Lo;0;L;;;;;N;;;;; @@ -24087,6 +24353,7 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 16F9E;MIAO LETTER REFORMED TONE-6;Lm;0;L;;;;;N;;;;; 16F9F;MIAO LETTER REFORMED TONE-8;Lm;0;L;;;;;N;;;;; 16FE0;TANGUT ITERATION MARK;Lm;0;L;;;;;N;;;;; +16FE1;NUSHU ITERATION MARK;Lm;0;L;;;;;N;;;;; 17000;;Lo;0;L;;;;;N;;;;; 187EC;;Lo;0;L;;;;;N;;;;; 18800;TANGUT COMPONENT-001;Lo;0;L;;;;;N;;;;; @@ -24846,6 +25113,687 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 18AF2;TANGUT COMPONENT-755;Lo;0;L;;;;;N;;;;; 1B000;KATAKANA LETTER ARCHAIC E;Lo;0;L;;;;;N;;;;; 1B001;HIRAGANA LETTER ARCHAIC YE;Lo;0;L;;;;;N;;;;; +1B002;HENTAIGANA LETTER A-1;Lo;0;L;;;;;N;;;;; +1B003;HENTAIGANA LETTER A-2;Lo;0;L;;;;;N;;;;; +1B004;HENTAIGANA LETTER A-3;Lo;0;L;;;;;N;;;;; +1B005;HENTAIGANA LETTER A-WO;Lo;0;L;;;;;N;;;;; +1B006;HENTAIGANA LETTER I-1;Lo;0;L;;;;;N;;;;; +1B007;HENTAIGANA LETTER I-2;Lo;0;L;;;;;N;;;;; +1B008;HENTAIGANA LETTER I-3;Lo;0;L;;;;;N;;;;; +1B009;HENTAIGANA LETTER I-4;Lo;0;L;;;;;N;;;;; +1B00A;HENTAIGANA LETTER U-1;Lo;0;L;;;;;N;;;;; +1B00B;HENTAIGANA LETTER U-2;Lo;0;L;;;;;N;;;;; +1B00C;HENTAIGANA LETTER U-3;Lo;0;L;;;;;N;;;;; +1B00D;HENTAIGANA LETTER U-4;Lo;0;L;;;;;N;;;;; +1B00E;HENTAIGANA LETTER U-5;Lo;0;L;;;;;N;;;;; +1B00F;HENTAIGANA LETTER E-2;Lo;0;L;;;;;N;;;;; +1B010;HENTAIGANA LETTER E-3;Lo;0;L;;;;;N;;;;; +1B011;HENTAIGANA LETTER E-4;Lo;0;L;;;;;N;;;;; +1B012;HENTAIGANA LETTER E-5;Lo;0;L;;;;;N;;;;; +1B013;HENTAIGANA LETTER E-6;Lo;0;L;;;;;N;;;;; +1B014;HENTAIGANA LETTER O-1;Lo;0;L;;;;;N;;;;; +1B015;HENTAIGANA LETTER O-2;Lo;0;L;;;;;N;;;;; +1B016;HENTAIGANA LETTER O-3;Lo;0;L;;;;;N;;;;; +1B017;HENTAIGANA LETTER KA-1;Lo;0;L;;;;;N;;;;; +1B018;HENTAIGANA LETTER KA-2;Lo;0;L;;;;;N;;;;; +1B019;HENTAIGANA LETTER KA-3;Lo;0;L;;;;;N;;;;; +1B01A;HENTAIGANA LETTER KA-4;Lo;0;L;;;;;N;;;;; +1B01B;HENTAIGANA LETTER KA-5;Lo;0;L;;;;;N;;;;; +1B01C;HENTAIGANA LETTER KA-6;Lo;0;L;;;;;N;;;;; +1B01D;HENTAIGANA LETTER KA-7;Lo;0;L;;;;;N;;;;; +1B01E;HENTAIGANA LETTER KA-8;Lo;0;L;;;;;N;;;;; +1B01F;HENTAIGANA LETTER KA-9;Lo;0;L;;;;;N;;;;; +1B020;HENTAIGANA LETTER KA-10;Lo;0;L;;;;;N;;;;; +1B021;HENTAIGANA LETTER KA-11;Lo;0;L;;;;;N;;;;; +1B022;HENTAIGANA LETTER KA-KE;Lo;0;L;;;;;N;;;;; +1B023;HENTAIGANA LETTER KI-1;Lo;0;L;;;;;N;;;;; +1B024;HENTAIGANA LETTER KI-2;Lo;0;L;;;;;N;;;;; +1B025;HENTAIGANA LETTER KI-3;Lo;0;L;;;;;N;;;;; +1B026;HENTAIGANA LETTER KI-4;Lo;0;L;;;;;N;;;;; +1B027;HENTAIGANA LETTER KI-5;Lo;0;L;;;;;N;;;;; +1B028;HENTAIGANA LETTER KI-6;Lo;0;L;;;;;N;;;;; +1B029;HENTAIGANA LETTER KI-7;Lo;0;L;;;;;N;;;;; +1B02A;HENTAIGANA LETTER KI-8;Lo;0;L;;;;;N;;;;; +1B02B;HENTAIGANA LETTER KU-1;Lo;0;L;;;;;N;;;;; +1B02C;HENTAIGANA LETTER KU-2;Lo;0;L;;;;;N;;;;; +1B02D;HENTAIGANA LETTER KU-3;Lo;0;L;;;;;N;;;;; +1B02E;HENTAIGANA LETTER KU-4;Lo;0;L;;;;;N;;;;; +1B02F;HENTAIGANA LETTER KU-5;Lo;0;L;;;;;N;;;;; +1B030;HENTAIGANA LETTER KU-6;Lo;0;L;;;;;N;;;;; +1B031;HENTAIGANA LETTER KU-7;Lo;0;L;;;;;N;;;;; +1B032;HENTAIGANA LETTER KE-1;Lo;0;L;;;;;N;;;;; +1B033;HENTAIGANA LETTER KE-2;Lo;0;L;;;;;N;;;;; +1B034;HENTAIGANA LETTER KE-3;Lo;0;L;;;;;N;;;;; +1B035;HENTAIGANA LETTER KE-4;Lo;0;L;;;;;N;;;;; +1B036;HENTAIGANA LETTER KE-5;Lo;0;L;;;;;N;;;;; +1B037;HENTAIGANA LETTER KE-6;Lo;0;L;;;;;N;;;;; +1B038;HENTAIGANA LETTER KO-1;Lo;0;L;;;;;N;;;;; +1B039;HENTAIGANA LETTER KO-2;Lo;0;L;;;;;N;;;;; +1B03A;HENTAIGANA LETTER KO-3;Lo;0;L;;;;;N;;;;; +1B03B;HENTAIGANA LETTER KO-KI;Lo;0;L;;;;;N;;;;; +1B03C;HENTAIGANA LETTER SA-1;Lo;0;L;;;;;N;;;;; +1B03D;HENTAIGANA LETTER SA-2;Lo;0;L;;;;;N;;;;; +1B03E;HENTAIGANA LETTER SA-3;Lo;0;L;;;;;N;;;;; +1B03F;HENTAIGANA LETTER SA-4;Lo;0;L;;;;;N;;;;; +1B040;HENTAIGANA LETTER SA-5;Lo;0;L;;;;;N;;;;; +1B041;HENTAIGANA LETTER SA-6;Lo;0;L;;;;;N;;;;; +1B042;HENTAIGANA LETTER SA-7;Lo;0;L;;;;;N;;;;; +1B043;HENTAIGANA LETTER SA-8;Lo;0;L;;;;;N;;;;; +1B044;HENTAIGANA LETTER SI-1;Lo;0;L;;;;;N;;;;; +1B045;HENTAIGANA LETTER SI-2;Lo;0;L;;;;;N;;;;; +1B046;HENTAIGANA LETTER SI-3;Lo;0;L;;;;;N;;;;; +1B047;HENTAIGANA LETTER SI-4;Lo;0;L;;;;;N;;;;; +1B048;HENTAIGANA LETTER SI-5;Lo;0;L;;;;;N;;;;; +1B049;HENTAIGANA LETTER SI-6;Lo;0;L;;;;;N;;;;; +1B04A;HENTAIGANA LETTER SU-1;Lo;0;L;;;;;N;;;;; +1B04B;HENTAIGANA LETTER SU-2;Lo;0;L;;;;;N;;;;; +1B04C;HENTAIGANA LETTER SU-3;Lo;0;L;;;;;N;;;;; +1B04D;HENTAIGANA LETTER SU-4;Lo;0;L;;;;;N;;;;; +1B04E;HENTAIGANA LETTER SU-5;Lo;0;L;;;;;N;;;;; +1B04F;HENTAIGANA LETTER SU-6;Lo;0;L;;;;;N;;;;; +1B050;HENTAIGANA LETTER SU-7;Lo;0;L;;;;;N;;;;; +1B051;HENTAIGANA LETTER SU-8;Lo;0;L;;;;;N;;;;; +1B052;HENTAIGANA LETTER SE-1;Lo;0;L;;;;;N;;;;; +1B053;HENTAIGANA LETTER SE-2;Lo;0;L;;;;;N;;;;; +1B054;HENTAIGANA LETTER SE-3;Lo;0;L;;;;;N;;;;; +1B055;HENTAIGANA LETTER SE-4;Lo;0;L;;;;;N;;;;; +1B056;HENTAIGANA LETTER SE-5;Lo;0;L;;;;;N;;;;; +1B057;HENTAIGANA LETTER SO-1;Lo;0;L;;;;;N;;;;; +1B058;HENTAIGANA LETTER SO-2;Lo;0;L;;;;;N;;;;; +1B059;HENTAIGANA LETTER SO-3;Lo;0;L;;;;;N;;;;; +1B05A;HENTAIGANA LETTER SO-4;Lo;0;L;;;;;N;;;;; +1B05B;HENTAIGANA LETTER SO-5;Lo;0;L;;;;;N;;;;; +1B05C;HENTAIGANA LETTER SO-6;Lo;0;L;;;;;N;;;;; +1B05D;HENTAIGANA LETTER SO-7;Lo;0;L;;;;;N;;;;; +1B05E;HENTAIGANA LETTER TA-1;Lo;0;L;;;;;N;;;;; +1B05F;HENTAIGANA LETTER TA-2;Lo;0;L;;;;;N;;;;; +1B060;HENTAIGANA LETTER TA-3;Lo;0;L;;;;;N;;;;; +1B061;HENTAIGANA LETTER TA-4;Lo;0;L;;;;;N;;;;; +1B062;HENTAIGANA LETTER TI-1;Lo;0;L;;;;;N;;;;; +1B063;HENTAIGANA LETTER TI-2;Lo;0;L;;;;;N;;;;; +1B064;HENTAIGANA LETTER TI-3;Lo;0;L;;;;;N;;;;; +1B065;HENTAIGANA LETTER TI-4;Lo;0;L;;;;;N;;;;; +1B066;HENTAIGANA LETTER TI-5;Lo;0;L;;;;;N;;;;; +1B067;HENTAIGANA LETTER TI-6;Lo;0;L;;;;;N;;;;; +1B068;HENTAIGANA LETTER TI-7;Lo;0;L;;;;;N;;;;; +1B069;HENTAIGANA LETTER TU-1;Lo;0;L;;;;;N;;;;; +1B06A;HENTAIGANA LETTER TU-2;Lo;0;L;;;;;N;;;;; +1B06B;HENTAIGANA LETTER TU-3;Lo;0;L;;;;;N;;;;; +1B06C;HENTAIGANA LETTER TU-4;Lo;0;L;;;;;N;;;;; +1B06D;HENTAIGANA LETTER TU-TO;Lo;0;L;;;;;N;;;;; +1B06E;HENTAIGANA LETTER TE-1;Lo;0;L;;;;;N;;;;; +1B06F;HENTAIGANA LETTER TE-2;Lo;0;L;;;;;N;;;;; +1B070;HENTAIGANA LETTER TE-3;Lo;0;L;;;;;N;;;;; +1B071;HENTAIGANA LETTER TE-4;Lo;0;L;;;;;N;;;;; +1B072;HENTAIGANA LETTER TE-5;Lo;0;L;;;;;N;;;;; +1B073;HENTAIGANA LETTER TE-6;Lo;0;L;;;;;N;;;;; +1B074;HENTAIGANA LETTER TE-7;Lo;0;L;;;;;N;;;;; +1B075;HENTAIGANA LETTER TE-8;Lo;0;L;;;;;N;;;;; +1B076;HENTAIGANA LETTER TE-9;Lo;0;L;;;;;N;;;;; +1B077;HENTAIGANA LETTER TO-1;Lo;0;L;;;;;N;;;;; +1B078;HENTAIGANA LETTER TO-2;Lo;0;L;;;;;N;;;;; +1B079;HENTAIGANA LETTER TO-3;Lo;0;L;;;;;N;;;;; +1B07A;HENTAIGANA LETTER TO-4;Lo;0;L;;;;;N;;;;; +1B07B;HENTAIGANA LETTER TO-5;Lo;0;L;;;;;N;;;;; +1B07C;HENTAIGANA LETTER TO-6;Lo;0;L;;;;;N;;;;; +1B07D;HENTAIGANA LETTER TO-RA;Lo;0;L;;;;;N;;;;; +1B07E;HENTAIGANA LETTER NA-1;Lo;0;L;;;;;N;;;;; +1B07F;HENTAIGANA LETTER NA-2;Lo;0;L;;;;;N;;;;; +1B080;HENTAIGANA LETTER NA-3;Lo;0;L;;;;;N;;;;; +1B081;HENTAIGANA LETTER NA-4;Lo;0;L;;;;;N;;;;; +1B082;HENTAIGANA LETTER NA-5;Lo;0;L;;;;;N;;;;; +1B083;HENTAIGANA LETTER NA-6;Lo;0;L;;;;;N;;;;; +1B084;HENTAIGANA LETTER NA-7;Lo;0;L;;;;;N;;;;; +1B085;HENTAIGANA LETTER NA-8;Lo;0;L;;;;;N;;;;; +1B086;HENTAIGANA LETTER NA-9;Lo;0;L;;;;;N;;;;; +1B087;HENTAIGANA LETTER NI-1;Lo;0;L;;;;;N;;;;; +1B088;HENTAIGANA LETTER NI-2;Lo;0;L;;;;;N;;;;; +1B089;HENTAIGANA LETTER NI-3;Lo;0;L;;;;;N;;;;; +1B08A;HENTAIGANA LETTER NI-4;Lo;0;L;;;;;N;;;;; +1B08B;HENTAIGANA LETTER NI-5;Lo;0;L;;;;;N;;;;; +1B08C;HENTAIGANA LETTER NI-6;Lo;0;L;;;;;N;;;;; +1B08D;HENTAIGANA LETTER NI-7;Lo;0;L;;;;;N;;;;; +1B08E;HENTAIGANA LETTER NI-TE;Lo;0;L;;;;;N;;;;; +1B08F;HENTAIGANA LETTER NU-1;Lo;0;L;;;;;N;;;;; +1B090;HENTAIGANA LETTER NU-2;Lo;0;L;;;;;N;;;;; +1B091;HENTAIGANA LETTER NU-3;Lo;0;L;;;;;N;;;;; +1B092;HENTAIGANA LETTER NE-1;Lo;0;L;;;;;N;;;;; +1B093;HENTAIGANA LETTER NE-2;Lo;0;L;;;;;N;;;;; +1B094;HENTAIGANA LETTER NE-3;Lo;0;L;;;;;N;;;;; +1B095;HENTAIGANA LETTER NE-4;Lo;0;L;;;;;N;;;;; +1B096;HENTAIGANA LETTER NE-5;Lo;0;L;;;;;N;;;;; +1B097;HENTAIGANA LETTER NE-6;Lo;0;L;;;;;N;;;;; +1B098;HENTAIGANA LETTER NE-KO;Lo;0;L;;;;;N;;;;; +1B099;HENTAIGANA LETTER NO-1;Lo;0;L;;;;;N;;;;; +1B09A;HENTAIGANA LETTER NO-2;Lo;0;L;;;;;N;;;;; +1B09B;HENTAIGANA LETTER NO-3;Lo;0;L;;;;;N;;;;; +1B09C;HENTAIGANA LETTER NO-4;Lo;0;L;;;;;N;;;;; +1B09D;HENTAIGANA LETTER NO-5;Lo;0;L;;;;;N;;;;; +1B09E;HENTAIGANA LETTER HA-1;Lo;0;L;;;;;N;;;;; +1B09F;HENTAIGANA LETTER HA-2;Lo;0;L;;;;;N;;;;; +1B0A0;HENTAIGANA LETTER HA-3;Lo;0;L;;;;;N;;;;; +1B0A1;HENTAIGANA LETTER HA-4;Lo;0;L;;;;;N;;;;; +1B0A2;HENTAIGANA LETTER HA-5;Lo;0;L;;;;;N;;;;; +1B0A3;HENTAIGANA LETTER HA-6;Lo;0;L;;;;;N;;;;; +1B0A4;HENTAIGANA LETTER HA-7;Lo;0;L;;;;;N;;;;; +1B0A5;HENTAIGANA LETTER HA-8;Lo;0;L;;;;;N;;;;; +1B0A6;HENTAIGANA LETTER HA-9;Lo;0;L;;;;;N;;;;; +1B0A7;HENTAIGANA LETTER HA-10;Lo;0;L;;;;;N;;;;; +1B0A8;HENTAIGANA LETTER HA-11;Lo;0;L;;;;;N;;;;; +1B0A9;HENTAIGANA LETTER HI-1;Lo;0;L;;;;;N;;;;; +1B0AA;HENTAIGANA LETTER HI-2;Lo;0;L;;;;;N;;;;; +1B0AB;HENTAIGANA LETTER HI-3;Lo;0;L;;;;;N;;;;; +1B0AC;HENTAIGANA LETTER HI-4;Lo;0;L;;;;;N;;;;; +1B0AD;HENTAIGANA LETTER HI-5;Lo;0;L;;;;;N;;;;; +1B0AE;HENTAIGANA LETTER HI-6;Lo;0;L;;;;;N;;;;; +1B0AF;HENTAIGANA LETTER HI-7;Lo;0;L;;;;;N;;;;; +1B0B0;HENTAIGANA LETTER HU-1;Lo;0;L;;;;;N;;;;; +1B0B1;HENTAIGANA LETTER HU-2;Lo;0;L;;;;;N;;;;; +1B0B2;HENTAIGANA LETTER HU-3;Lo;0;L;;;;;N;;;;; +1B0B3;HENTAIGANA LETTER HE-1;Lo;0;L;;;;;N;;;;; +1B0B4;HENTAIGANA LETTER HE-2;Lo;0;L;;;;;N;;;;; +1B0B5;HENTAIGANA LETTER HE-3;Lo;0;L;;;;;N;;;;; +1B0B6;HENTAIGANA LETTER HE-4;Lo;0;L;;;;;N;;;;; +1B0B7;HENTAIGANA LETTER HE-5;Lo;0;L;;;;;N;;;;; +1B0B8;HENTAIGANA LETTER HE-6;Lo;0;L;;;;;N;;;;; +1B0B9;HENTAIGANA LETTER HE-7;Lo;0;L;;;;;N;;;;; +1B0BA;HENTAIGANA LETTER HO-1;Lo;0;L;;;;;N;;;;; +1B0BB;HENTAIGANA LETTER HO-2;Lo;0;L;;;;;N;;;;; +1B0BC;HENTAIGANA LETTER HO-3;Lo;0;L;;;;;N;;;;; +1B0BD;HENTAIGANA LETTER HO-4;Lo;0;L;;;;;N;;;;; +1B0BE;HENTAIGANA LETTER HO-5;Lo;0;L;;;;;N;;;;; +1B0BF;HENTAIGANA LETTER HO-6;Lo;0;L;;;;;N;;;;; +1B0C0;HENTAIGANA LETTER HO-7;Lo;0;L;;;;;N;;;;; +1B0C1;HENTAIGANA LETTER HO-8;Lo;0;L;;;;;N;;;;; +1B0C2;HENTAIGANA LETTER MA-1;Lo;0;L;;;;;N;;;;; +1B0C3;HENTAIGANA LETTER MA-2;Lo;0;L;;;;;N;;;;; +1B0C4;HENTAIGANA LETTER MA-3;Lo;0;L;;;;;N;;;;; +1B0C5;HENTAIGANA LETTER MA-4;Lo;0;L;;;;;N;;;;; +1B0C6;HENTAIGANA LETTER MA-5;Lo;0;L;;;;;N;;;;; +1B0C7;HENTAIGANA LETTER MA-6;Lo;0;L;;;;;N;;;;; +1B0C8;HENTAIGANA LETTER MA-7;Lo;0;L;;;;;N;;;;; +1B0C9;HENTAIGANA LETTER MI-1;Lo;0;L;;;;;N;;;;; +1B0CA;HENTAIGANA LETTER MI-2;Lo;0;L;;;;;N;;;;; +1B0CB;HENTAIGANA LETTER MI-3;Lo;0;L;;;;;N;;;;; +1B0CC;HENTAIGANA LETTER MI-4;Lo;0;L;;;;;N;;;;; +1B0CD;HENTAIGANA LETTER MI-5;Lo;0;L;;;;;N;;;;; +1B0CE;HENTAIGANA LETTER MI-6;Lo;0;L;;;;;N;;;;; +1B0CF;HENTAIGANA LETTER MI-7;Lo;0;L;;;;;N;;;;; +1B0D0;HENTAIGANA LETTER MU-1;Lo;0;L;;;;;N;;;;; +1B0D1;HENTAIGANA LETTER MU-2;Lo;0;L;;;;;N;;;;; +1B0D2;HENTAIGANA LETTER MU-3;Lo;0;L;;;;;N;;;;; +1B0D3;HENTAIGANA LETTER MU-4;Lo;0;L;;;;;N;;;;; +1B0D4;HENTAIGANA LETTER ME-1;Lo;0;L;;;;;N;;;;; +1B0D5;HENTAIGANA LETTER ME-2;Lo;0;L;;;;;N;;;;; +1B0D6;HENTAIGANA LETTER ME-MA;Lo;0;L;;;;;N;;;;; +1B0D7;HENTAIGANA LETTER MO-1;Lo;0;L;;;;;N;;;;; +1B0D8;HENTAIGANA LETTER MO-2;Lo;0;L;;;;;N;;;;; +1B0D9;HENTAIGANA LETTER MO-3;Lo;0;L;;;;;N;;;;; +1B0DA;HENTAIGANA LETTER MO-4;Lo;0;L;;;;;N;;;;; +1B0DB;HENTAIGANA LETTER MO-5;Lo;0;L;;;;;N;;;;; +1B0DC;HENTAIGANA LETTER MO-6;Lo;0;L;;;;;N;;;;; +1B0DD;HENTAIGANA LETTER YA-1;Lo;0;L;;;;;N;;;;; +1B0DE;HENTAIGANA LETTER YA-2;Lo;0;L;;;;;N;;;;; +1B0DF;HENTAIGANA LETTER YA-3;Lo;0;L;;;;;N;;;;; +1B0E0;HENTAIGANA LETTER YA-4;Lo;0;L;;;;;N;;;;; +1B0E1;HENTAIGANA LETTER YA-5;Lo;0;L;;;;;N;;;;; +1B0E2;HENTAIGANA LETTER YA-YO;Lo;0;L;;;;;N;;;;; +1B0E3;HENTAIGANA LETTER YU-1;Lo;0;L;;;;;N;;;;; +1B0E4;HENTAIGANA LETTER YU-2;Lo;0;L;;;;;N;;;;; +1B0E5;HENTAIGANA LETTER YU-3;Lo;0;L;;;;;N;;;;; +1B0E6;HENTAIGANA LETTER YU-4;Lo;0;L;;;;;N;;;;; +1B0E7;HENTAIGANA LETTER YO-1;Lo;0;L;;;;;N;;;;; +1B0E8;HENTAIGANA LETTER YO-2;Lo;0;L;;;;;N;;;;; +1B0E9;HENTAIGANA LETTER YO-3;Lo;0;L;;;;;N;;;;; +1B0EA;HENTAIGANA LETTER YO-4;Lo;0;L;;;;;N;;;;; +1B0EB;HENTAIGANA LETTER YO-5;Lo;0;L;;;;;N;;;;; +1B0EC;HENTAIGANA LETTER YO-6;Lo;0;L;;;;;N;;;;; +1B0ED;HENTAIGANA LETTER RA-1;Lo;0;L;;;;;N;;;;; +1B0EE;HENTAIGANA LETTER RA-2;Lo;0;L;;;;;N;;;;; +1B0EF;HENTAIGANA LETTER RA-3;Lo;0;L;;;;;N;;;;; +1B0F0;HENTAIGANA LETTER RA-4;Lo;0;L;;;;;N;;;;; +1B0F1;HENTAIGANA LETTER RI-1;Lo;0;L;;;;;N;;;;; +1B0F2;HENTAIGANA LETTER RI-2;Lo;0;L;;;;;N;;;;; +1B0F3;HENTAIGANA LETTER RI-3;Lo;0;L;;;;;N;;;;; +1B0F4;HENTAIGANA LETTER RI-4;Lo;0;L;;;;;N;;;;; +1B0F5;HENTAIGANA LETTER RI-5;Lo;0;L;;;;;N;;;;; +1B0F6;HENTAIGANA LETTER RI-6;Lo;0;L;;;;;N;;;;; +1B0F7;HENTAIGANA LETTER RI-7;Lo;0;L;;;;;N;;;;; +1B0F8;HENTAIGANA LETTER RU-1;Lo;0;L;;;;;N;;;;; +1B0F9;HENTAIGANA LETTER RU-2;Lo;0;L;;;;;N;;;;; +1B0FA;HENTAIGANA LETTER RU-3;Lo;0;L;;;;;N;;;;; +1B0FB;HENTAIGANA LETTER RU-4;Lo;0;L;;;;;N;;;;; +1B0FC;HENTAIGANA LETTER RU-5;Lo;0;L;;;;;N;;;;; +1B0FD;HENTAIGANA LETTER RU-6;Lo;0;L;;;;;N;;;;; +1B0FE;HENTAIGANA LETTER RE-1;Lo;0;L;;;;;N;;;;; +1B0FF;HENTAIGANA LETTER RE-2;Lo;0;L;;;;;N;;;;; +1B100;HENTAIGANA LETTER RE-3;Lo;0;L;;;;;N;;;;; +1B101;HENTAIGANA LETTER RE-4;Lo;0;L;;;;;N;;;;; +1B102;HENTAIGANA LETTER RO-1;Lo;0;L;;;;;N;;;;; +1B103;HENTAIGANA LETTER RO-2;Lo;0;L;;;;;N;;;;; +1B104;HENTAIGANA LETTER RO-3;Lo;0;L;;;;;N;;;;; +1B105;HENTAIGANA LETTER RO-4;Lo;0;L;;;;;N;;;;; +1B106;HENTAIGANA LETTER RO-5;Lo;0;L;;;;;N;;;;; +1B107;HENTAIGANA LETTER RO-6;Lo;0;L;;;;;N;;;;; +1B108;HENTAIGANA LETTER WA-1;Lo;0;L;;;;;N;;;;; +1B109;HENTAIGANA LETTER WA-2;Lo;0;L;;;;;N;;;;; +1B10A;HENTAIGANA LETTER WA-3;Lo;0;L;;;;;N;;;;; +1B10B;HENTAIGANA LETTER WA-4;Lo;0;L;;;;;N;;;;; +1B10C;HENTAIGANA LETTER WA-5;Lo;0;L;;;;;N;;;;; +1B10D;HENTAIGANA LETTER WI-1;Lo;0;L;;;;;N;;;;; +1B10E;HENTAIGANA LETTER WI-2;Lo;0;L;;;;;N;;;;; +1B10F;HENTAIGANA LETTER WI-3;Lo;0;L;;;;;N;;;;; +1B110;HENTAIGANA LETTER WI-4;Lo;0;L;;;;;N;;;;; +1B111;HENTAIGANA LETTER WI-5;Lo;0;L;;;;;N;;;;; +1B112;HENTAIGANA LETTER WE-1;Lo;0;L;;;;;N;;;;; +1B113;HENTAIGANA LETTER WE-2;Lo;0;L;;;;;N;;;;; +1B114;HENTAIGANA LETTER WE-3;Lo;0;L;;;;;N;;;;; +1B115;HENTAIGANA LETTER WE-4;Lo;0;L;;;;;N;;;;; +1B116;HENTAIGANA LETTER WO-1;Lo;0;L;;;;;N;;;;; +1B117;HENTAIGANA LETTER WO-2;Lo;0;L;;;;;N;;;;; +1B118;HENTAIGANA LETTER WO-3;Lo;0;L;;;;;N;;;;; +1B119;HENTAIGANA LETTER WO-4;Lo;0;L;;;;;N;;;;; +1B11A;HENTAIGANA LETTER WO-5;Lo;0;L;;;;;N;;;;; +1B11B;HENTAIGANA LETTER WO-6;Lo;0;L;;;;;N;;;;; +1B11C;HENTAIGANA LETTER WO-7;Lo;0;L;;;;;N;;;;; +1B11D;HENTAIGANA LETTER N-MU-MO-1;Lo;0;L;;;;;N;;;;; +1B11E;HENTAIGANA LETTER N-MU-MO-2;Lo;0;L;;;;;N;;;;; +1B170;NUSHU CHARACTER-1B170;Lo;0;L;;;;;N;;;;; +1B171;NUSHU CHARACTER-1B171;Lo;0;L;;;;;N;;;;; +1B172;NUSHU CHARACTER-1B172;Lo;0;L;;;;;N;;;;; +1B173;NUSHU CHARACTER-1B173;Lo;0;L;;;;;N;;;;; +1B174;NUSHU CHARACTER-1B174;Lo;0;L;;;;;N;;;;; +1B175;NUSHU CHARACTER-1B175;Lo;0;L;;;;;N;;;;; +1B176;NUSHU CHARACTER-1B176;Lo;0;L;;;;;N;;;;; +1B177;NUSHU CHARACTER-1B177;Lo;0;L;;;;;N;;;;; +1B178;NUSHU CHARACTER-1B178;Lo;0;L;;;;;N;;;;; +1B179;NUSHU CHARACTER-1B179;Lo;0;L;;;;;N;;;;; +1B17A;NUSHU CHARACTER-1B17A;Lo;0;L;;;;;N;;;;; +1B17B;NUSHU CHARACTER-1B17B;Lo;0;L;;;;;N;;;;; +1B17C;NUSHU CHARACTER-1B17C;Lo;0;L;;;;;N;;;;; +1B17D;NUSHU CHARACTER-1B17D;Lo;0;L;;;;;N;;;;; +1B17E;NUSHU CHARACTER-1B17E;Lo;0;L;;;;;N;;;;; +1B17F;NUSHU CHARACTER-1B17F;Lo;0;L;;;;;N;;;;; +1B180;NUSHU CHARACTER-1B180;Lo;0;L;;;;;N;;;;; +1B181;NUSHU CHARACTER-1B181;Lo;0;L;;;;;N;;;;; +1B182;NUSHU CHARACTER-1B182;Lo;0;L;;;;;N;;;;; +1B183;NUSHU CHARACTER-1B183;Lo;0;L;;;;;N;;;;; +1B184;NUSHU CHARACTER-1B184;Lo;0;L;;;;;N;;;;; +1B185;NUSHU CHARACTER-1B185;Lo;0;L;;;;;N;;;;; +1B186;NUSHU CHARACTER-1B186;Lo;0;L;;;;;N;;;;; +1B187;NUSHU CHARACTER-1B187;Lo;0;L;;;;;N;;;;; +1B188;NUSHU CHARACTER-1B188;Lo;0;L;;;;;N;;;;; +1B189;NUSHU CHARACTER-1B189;Lo;0;L;;;;;N;;;;; +1B18A;NUSHU CHARACTER-1B18A;Lo;0;L;;;;;N;;;;; +1B18B;NUSHU CHARACTER-1B18B;Lo;0;L;;;;;N;;;;; +1B18C;NUSHU CHARACTER-1B18C;Lo;0;L;;;;;N;;;;; +1B18D;NUSHU CHARACTER-1B18D;Lo;0;L;;;;;N;;;;; +1B18E;NUSHU CHARACTER-1B18E;Lo;0;L;;;;;N;;;;; +1B18F;NUSHU CHARACTER-1B18F;Lo;0;L;;;;;N;;;;; +1B190;NUSHU CHARACTER-1B190;Lo;0;L;;;;;N;;;;; +1B191;NUSHU CHARACTER-1B191;Lo;0;L;;;;;N;;;;; +1B192;NUSHU CHARACTER-1B192;Lo;0;L;;;;;N;;;;; +1B193;NUSHU CHARACTER-1B193;Lo;0;L;;;;;N;;;;; +1B194;NUSHU CHARACTER-1B194;Lo;0;L;;;;;N;;;;; +1B195;NUSHU CHARACTER-1B195;Lo;0;L;;;;;N;;;;; +1B196;NUSHU CHARACTER-1B196;Lo;0;L;;;;;N;;;;; +1B197;NUSHU CHARACTER-1B197;Lo;0;L;;;;;N;;;;; +1B198;NUSHU CHARACTER-1B198;Lo;0;L;;;;;N;;;;; +1B199;NUSHU CHARACTER-1B199;Lo;0;L;;;;;N;;;;; +1B19A;NUSHU CHARACTER-1B19A;Lo;0;L;;;;;N;;;;; +1B19B;NUSHU CHARACTER-1B19B;Lo;0;L;;;;;N;;;;; +1B19C;NUSHU CHARACTER-1B19C;Lo;0;L;;;;;N;;;;; +1B19D;NUSHU CHARACTER-1B19D;Lo;0;L;;;;;N;;;;; +1B19E;NUSHU CHARACTER-1B19E;Lo;0;L;;;;;N;;;;; +1B19F;NUSHU CHARACTER-1B19F;Lo;0;L;;;;;N;;;;; +1B1A0;NUSHU CHARACTER-1B1A0;Lo;0;L;;;;;N;;;;; +1B1A1;NUSHU CHARACTER-1B1A1;Lo;0;L;;;;;N;;;;; +1B1A2;NUSHU CHARACTER-1B1A2;Lo;0;L;;;;;N;;;;; +1B1A3;NUSHU CHARACTER-1B1A3;Lo;0;L;;;;;N;;;;; +1B1A4;NUSHU CHARACTER-1B1A4;Lo;0;L;;;;;N;;;;; +1B1A5;NUSHU CHARACTER-1B1A5;Lo;0;L;;;;;N;;;;; +1B1A6;NUSHU CHARACTER-1B1A6;Lo;0;L;;;;;N;;;;; +1B1A7;NUSHU CHARACTER-1B1A7;Lo;0;L;;;;;N;;;;; +1B1A8;NUSHU CHARACTER-1B1A8;Lo;0;L;;;;;N;;;;; +1B1A9;NUSHU CHARACTER-1B1A9;Lo;0;L;;;;;N;;;;; +1B1AA;NUSHU CHARACTER-1B1AA;Lo;0;L;;;;;N;;;;; +1B1AB;NUSHU CHARACTER-1B1AB;Lo;0;L;;;;;N;;;;; +1B1AC;NUSHU CHARACTER-1B1AC;Lo;0;L;;;;;N;;;;; +1B1AD;NUSHU CHARACTER-1B1AD;Lo;0;L;;;;;N;;;;; +1B1AE;NUSHU CHARACTER-1B1AE;Lo;0;L;;;;;N;;;;; +1B1AF;NUSHU CHARACTER-1B1AF;Lo;0;L;;;;;N;;;;; +1B1B0;NUSHU CHARACTER-1B1B0;Lo;0;L;;;;;N;;;;; +1B1B1;NUSHU CHARACTER-1B1B1;Lo;0;L;;;;;N;;;;; +1B1B2;NUSHU CHARACTER-1B1B2;Lo;0;L;;;;;N;;;;; +1B1B3;NUSHU CHARACTER-1B1B3;Lo;0;L;;;;;N;;;;; +1B1B4;NUSHU CHARACTER-1B1B4;Lo;0;L;;;;;N;;;;; +1B1B5;NUSHU CHARACTER-1B1B5;Lo;0;L;;;;;N;;;;; +1B1B6;NUSHU CHARACTER-1B1B6;Lo;0;L;;;;;N;;;;; +1B1B7;NUSHU CHARACTER-1B1B7;Lo;0;L;;;;;N;;;;; +1B1B8;NUSHU CHARACTER-1B1B8;Lo;0;L;;;;;N;;;;; +1B1B9;NUSHU CHARACTER-1B1B9;Lo;0;L;;;;;N;;;;; +1B1BA;NUSHU CHARACTER-1B1BA;Lo;0;L;;;;;N;;;;; +1B1BB;NUSHU CHARACTER-1B1BB;Lo;0;L;;;;;N;;;;; +1B1BC;NUSHU CHARACTER-1B1BC;Lo;0;L;;;;;N;;;;; +1B1BD;NUSHU CHARACTER-1B1BD;Lo;0;L;;;;;N;;;;; +1B1BE;NUSHU CHARACTER-1B1BE;Lo;0;L;;;;;N;;;;; +1B1BF;NUSHU CHARACTER-1B1BF;Lo;0;L;;;;;N;;;;; +1B1C0;NUSHU CHARACTER-1B1C0;Lo;0;L;;;;;N;;;;; +1B1C1;NUSHU CHARACTER-1B1C1;Lo;0;L;;;;;N;;;;; +1B1C2;NUSHU CHARACTER-1B1C2;Lo;0;L;;;;;N;;;;; +1B1C3;NUSHU CHARACTER-1B1C3;Lo;0;L;;;;;N;;;;; +1B1C4;NUSHU CHARACTER-1B1C4;Lo;0;L;;;;;N;;;;; +1B1C5;NUSHU CHARACTER-1B1C5;Lo;0;L;;;;;N;;;;; +1B1C6;NUSHU CHARACTER-1B1C6;Lo;0;L;;;;;N;;;;; +1B1C7;NUSHU CHARACTER-1B1C7;Lo;0;L;;;;;N;;;;; +1B1C8;NUSHU CHARACTER-1B1C8;Lo;0;L;;;;;N;;;;; +1B1C9;NUSHU CHARACTER-1B1C9;Lo;0;L;;;;;N;;;;; +1B1CA;NUSHU CHARACTER-1B1CA;Lo;0;L;;;;;N;;;;; +1B1CB;NUSHU CHARACTER-1B1CB;Lo;0;L;;;;;N;;;;; +1B1CC;NUSHU CHARACTER-1B1CC;Lo;0;L;;;;;N;;;;; +1B1CD;NUSHU CHARACTER-1B1CD;Lo;0;L;;;;;N;;;;; +1B1CE;NUSHU CHARACTER-1B1CE;Lo;0;L;;;;;N;;;;; +1B1CF;NUSHU CHARACTER-1B1CF;Lo;0;L;;;;;N;;;;; +1B1D0;NUSHU CHARACTER-1B1D0;Lo;0;L;;;;;N;;;;; +1B1D1;NUSHU CHARACTER-1B1D1;Lo;0;L;;;;;N;;;;; +1B1D2;NUSHU CHARACTER-1B1D2;Lo;0;L;;;;;N;;;;; +1B1D3;NUSHU CHARACTER-1B1D3;Lo;0;L;;;;;N;;;;; +1B1D4;NUSHU CHARACTER-1B1D4;Lo;0;L;;;;;N;;;;; +1B1D5;NUSHU CHARACTER-1B1D5;Lo;0;L;;;;;N;;;;; +1B1D6;NUSHU CHARACTER-1B1D6;Lo;0;L;;;;;N;;;;; +1B1D7;NUSHU CHARACTER-1B1D7;Lo;0;L;;;;;N;;;;; +1B1D8;NUSHU CHARACTER-1B1D8;Lo;0;L;;;;;N;;;;; +1B1D9;NUSHU CHARACTER-1B1D9;Lo;0;L;;;;;N;;;;; +1B1DA;NUSHU CHARACTER-1B1DA;Lo;0;L;;;;;N;;;;; +1B1DB;NUSHU CHARACTER-1B1DB;Lo;0;L;;;;;N;;;;; +1B1DC;NUSHU CHARACTER-1B1DC;Lo;0;L;;;;;N;;;;; +1B1DD;NUSHU CHARACTER-1B1DD;Lo;0;L;;;;;N;;;;; +1B1DE;NUSHU CHARACTER-1B1DE;Lo;0;L;;;;;N;;;;; +1B1DF;NUSHU CHARACTER-1B1DF;Lo;0;L;;;;;N;;;;; +1B1E0;NUSHU CHARACTER-1B1E0;Lo;0;L;;;;;N;;;;; +1B1E1;NUSHU CHARACTER-1B1E1;Lo;0;L;;;;;N;;;;; +1B1E2;NUSHU CHARACTER-1B1E2;Lo;0;L;;;;;N;;;;; +1B1E3;NUSHU CHARACTER-1B1E3;Lo;0;L;;;;;N;;;;; +1B1E4;NUSHU CHARACTER-1B1E4;Lo;0;L;;;;;N;;;;; +1B1E5;NUSHU CHARACTER-1B1E5;Lo;0;L;;;;;N;;;;; +1B1E6;NUSHU CHARACTER-1B1E6;Lo;0;L;;;;;N;;;;; +1B1E7;NUSHU CHARACTER-1B1E7;Lo;0;L;;;;;N;;;;; +1B1E8;NUSHU CHARACTER-1B1E8;Lo;0;L;;;;;N;;;;; +1B1E9;NUSHU CHARACTER-1B1E9;Lo;0;L;;;;;N;;;;; +1B1EA;NUSHU CHARACTER-1B1EA;Lo;0;L;;;;;N;;;;; +1B1EB;NUSHU CHARACTER-1B1EB;Lo;0;L;;;;;N;;;;; +1B1EC;NUSHU CHARACTER-1B1EC;Lo;0;L;;;;;N;;;;; +1B1ED;NUSHU CHARACTER-1B1ED;Lo;0;L;;;;;N;;;;; +1B1EE;NUSHU CHARACTER-1B1EE;Lo;0;L;;;;;N;;;;; +1B1EF;NUSHU CHARACTER-1B1EF;Lo;0;L;;;;;N;;;;; +1B1F0;NUSHU CHARACTER-1B1F0;Lo;0;L;;;;;N;;;;; +1B1F1;NUSHU CHARACTER-1B1F1;Lo;0;L;;;;;N;;;;; +1B1F2;NUSHU CHARACTER-1B1F2;Lo;0;L;;;;;N;;;;; +1B1F3;NUSHU CHARACTER-1B1F3;Lo;0;L;;;;;N;;;;; +1B1F4;NUSHU CHARACTER-1B1F4;Lo;0;L;;;;;N;;;;; +1B1F5;NUSHU CHARACTER-1B1F5;Lo;0;L;;;;;N;;;;; +1B1F6;NUSHU CHARACTER-1B1F6;Lo;0;L;;;;;N;;;;; +1B1F7;NUSHU CHARACTER-1B1F7;Lo;0;L;;;;;N;;;;; +1B1F8;NUSHU CHARACTER-1B1F8;Lo;0;L;;;;;N;;;;; +1B1F9;NUSHU CHARACTER-1B1F9;Lo;0;L;;;;;N;;;;; +1B1FA;NUSHU CHARACTER-1B1FA;Lo;0;L;;;;;N;;;;; +1B1FB;NUSHU CHARACTER-1B1FB;Lo;0;L;;;;;N;;;;; +1B1FC;NUSHU CHARACTER-1B1FC;Lo;0;L;;;;;N;;;;; +1B1FD;NUSHU CHARACTER-1B1FD;Lo;0;L;;;;;N;;;;; +1B1FE;NUSHU CHARACTER-1B1FE;Lo;0;L;;;;;N;;;;; +1B1FF;NUSHU CHARACTER-1B1FF;Lo;0;L;;;;;N;;;;; +1B200;NUSHU CHARACTER-1B200;Lo;0;L;;;;;N;;;;; +1B201;NUSHU CHARACTER-1B201;Lo;0;L;;;;;N;;;;; +1B202;NUSHU CHARACTER-1B202;Lo;0;L;;;;;N;;;;; +1B203;NUSHU CHARACTER-1B203;Lo;0;L;;;;;N;;;;; +1B204;NUSHU CHARACTER-1B204;Lo;0;L;;;;;N;;;;; +1B205;NUSHU CHARACTER-1B205;Lo;0;L;;;;;N;;;;; +1B206;NUSHU CHARACTER-1B206;Lo;0;L;;;;;N;;;;; +1B207;NUSHU CHARACTER-1B207;Lo;0;L;;;;;N;;;;; +1B208;NUSHU CHARACTER-1B208;Lo;0;L;;;;;N;;;;; +1B209;NUSHU CHARACTER-1B209;Lo;0;L;;;;;N;;;;; +1B20A;NUSHU CHARACTER-1B20A;Lo;0;L;;;;;N;;;;; +1B20B;NUSHU CHARACTER-1B20B;Lo;0;L;;;;;N;;;;; +1B20C;NUSHU CHARACTER-1B20C;Lo;0;L;;;;;N;;;;; +1B20D;NUSHU CHARACTER-1B20D;Lo;0;L;;;;;N;;;;; +1B20E;NUSHU CHARACTER-1B20E;Lo;0;L;;;;;N;;;;; +1B20F;NUSHU CHARACTER-1B20F;Lo;0;L;;;;;N;;;;; +1B210;NUSHU CHARACTER-1B210;Lo;0;L;;;;;N;;;;; +1B211;NUSHU CHARACTER-1B211;Lo;0;L;;;;;N;;;;; +1B212;NUSHU CHARACTER-1B212;Lo;0;L;;;;;N;;;;; +1B213;NUSHU CHARACTER-1B213;Lo;0;L;;;;;N;;;;; +1B214;NUSHU CHARACTER-1B214;Lo;0;L;;;;;N;;;;; +1B215;NUSHU CHARACTER-1B215;Lo;0;L;;;;;N;;;;; +1B216;NUSHU CHARACTER-1B216;Lo;0;L;;;;;N;;;;; +1B217;NUSHU CHARACTER-1B217;Lo;0;L;;;;;N;;;;; +1B218;NUSHU CHARACTER-1B218;Lo;0;L;;;;;N;;;;; +1B219;NUSHU CHARACTER-1B219;Lo;0;L;;;;;N;;;;; +1B21A;NUSHU CHARACTER-1B21A;Lo;0;L;;;;;N;;;;; +1B21B;NUSHU CHARACTER-1B21B;Lo;0;L;;;;;N;;;;; +1B21C;NUSHU CHARACTER-1B21C;Lo;0;L;;;;;N;;;;; +1B21D;NUSHU CHARACTER-1B21D;Lo;0;L;;;;;N;;;;; +1B21E;NUSHU CHARACTER-1B21E;Lo;0;L;;;;;N;;;;; +1B21F;NUSHU CHARACTER-1B21F;Lo;0;L;;;;;N;;;;; +1B220;NUSHU CHARACTER-1B220;Lo;0;L;;;;;N;;;;; +1B221;NUSHU CHARACTER-1B221;Lo;0;L;;;;;N;;;;; +1B222;NUSHU CHARACTER-1B222;Lo;0;L;;;;;N;;;;; +1B223;NUSHU CHARACTER-1B223;Lo;0;L;;;;;N;;;;; +1B224;NUSHU CHARACTER-1B224;Lo;0;L;;;;;N;;;;; +1B225;NUSHU CHARACTER-1B225;Lo;0;L;;;;;N;;;;; +1B226;NUSHU CHARACTER-1B226;Lo;0;L;;;;;N;;;;; +1B227;NUSHU CHARACTER-1B227;Lo;0;L;;;;;N;;;;; +1B228;NUSHU CHARACTER-1B228;Lo;0;L;;;;;N;;;;; +1B229;NUSHU CHARACTER-1B229;Lo;0;L;;;;;N;;;;; +1B22A;NUSHU CHARACTER-1B22A;Lo;0;L;;;;;N;;;;; +1B22B;NUSHU CHARACTER-1B22B;Lo;0;L;;;;;N;;;;; +1B22C;NUSHU CHARACTER-1B22C;Lo;0;L;;;;;N;;;;; +1B22D;NUSHU CHARACTER-1B22D;Lo;0;L;;;;;N;;;;; +1B22E;NUSHU CHARACTER-1B22E;Lo;0;L;;;;;N;;;;; +1B22F;NUSHU CHARACTER-1B22F;Lo;0;L;;;;;N;;;;; +1B230;NUSHU CHARACTER-1B230;Lo;0;L;;;;;N;;;;; +1B231;NUSHU CHARACTER-1B231;Lo;0;L;;;;;N;;;;; +1B232;NUSHU CHARACTER-1B232;Lo;0;L;;;;;N;;;;; +1B233;NUSHU CHARACTER-1B233;Lo;0;L;;;;;N;;;;; +1B234;NUSHU CHARACTER-1B234;Lo;0;L;;;;;N;;;;; +1B235;NUSHU CHARACTER-1B235;Lo;0;L;;;;;N;;;;; +1B236;NUSHU CHARACTER-1B236;Lo;0;L;;;;;N;;;;; +1B237;NUSHU CHARACTER-1B237;Lo;0;L;;;;;N;;;;; +1B238;NUSHU CHARACTER-1B238;Lo;0;L;;;;;N;;;;; +1B239;NUSHU CHARACTER-1B239;Lo;0;L;;;;;N;;;;; +1B23A;NUSHU CHARACTER-1B23A;Lo;0;L;;;;;N;;;;; +1B23B;NUSHU CHARACTER-1B23B;Lo;0;L;;;;;N;;;;; +1B23C;NUSHU CHARACTER-1B23C;Lo;0;L;;;;;N;;;;; +1B23D;NUSHU CHARACTER-1B23D;Lo;0;L;;;;;N;;;;; +1B23E;NUSHU CHARACTER-1B23E;Lo;0;L;;;;;N;;;;; +1B23F;NUSHU CHARACTER-1B23F;Lo;0;L;;;;;N;;;;; +1B240;NUSHU CHARACTER-1B240;Lo;0;L;;;;;N;;;;; +1B241;NUSHU CHARACTER-1B241;Lo;0;L;;;;;N;;;;; +1B242;NUSHU CHARACTER-1B242;Lo;0;L;;;;;N;;;;; +1B243;NUSHU CHARACTER-1B243;Lo;0;L;;;;;N;;;;; +1B244;NUSHU CHARACTER-1B244;Lo;0;L;;;;;N;;;;; +1B245;NUSHU CHARACTER-1B245;Lo;0;L;;;;;N;;;;; +1B246;NUSHU CHARACTER-1B246;Lo;0;L;;;;;N;;;;; +1B247;NUSHU CHARACTER-1B247;Lo;0;L;;;;;N;;;;; +1B248;NUSHU CHARACTER-1B248;Lo;0;L;;;;;N;;;;; +1B249;NUSHU CHARACTER-1B249;Lo;0;L;;;;;N;;;;; +1B24A;NUSHU CHARACTER-1B24A;Lo;0;L;;;;;N;;;;; +1B24B;NUSHU CHARACTER-1B24B;Lo;0;L;;;;;N;;;;; +1B24C;NUSHU CHARACTER-1B24C;Lo;0;L;;;;;N;;;;; +1B24D;NUSHU CHARACTER-1B24D;Lo;0;L;;;;;N;;;;; +1B24E;NUSHU CHARACTER-1B24E;Lo;0;L;;;;;N;;;;; +1B24F;NUSHU CHARACTER-1B24F;Lo;0;L;;;;;N;;;;; +1B250;NUSHU CHARACTER-1B250;Lo;0;L;;;;;N;;;;; +1B251;NUSHU CHARACTER-1B251;Lo;0;L;;;;;N;;;;; +1B252;NUSHU CHARACTER-1B252;Lo;0;L;;;;;N;;;;; +1B253;NUSHU CHARACTER-1B253;Lo;0;L;;;;;N;;;;; +1B254;NUSHU CHARACTER-1B254;Lo;0;L;;;;;N;;;;; +1B255;NUSHU CHARACTER-1B255;Lo;0;L;;;;;N;;;;; +1B256;NUSHU CHARACTER-1B256;Lo;0;L;;;;;N;;;;; +1B257;NUSHU CHARACTER-1B257;Lo;0;L;;;;;N;;;;; +1B258;NUSHU CHARACTER-1B258;Lo;0;L;;;;;N;;;;; +1B259;NUSHU CHARACTER-1B259;Lo;0;L;;;;;N;;;;; +1B25A;NUSHU CHARACTER-1B25A;Lo;0;L;;;;;N;;;;; +1B25B;NUSHU CHARACTER-1B25B;Lo;0;L;;;;;N;;;;; +1B25C;NUSHU CHARACTER-1B25C;Lo;0;L;;;;;N;;;;; +1B25D;NUSHU CHARACTER-1B25D;Lo;0;L;;;;;N;;;;; +1B25E;NUSHU CHARACTER-1B25E;Lo;0;L;;;;;N;;;;; +1B25F;NUSHU CHARACTER-1B25F;Lo;0;L;;;;;N;;;;; +1B260;NUSHU CHARACTER-1B260;Lo;0;L;;;;;N;;;;; +1B261;NUSHU CHARACTER-1B261;Lo;0;L;;;;;N;;;;; +1B262;NUSHU CHARACTER-1B262;Lo;0;L;;;;;N;;;;; +1B263;NUSHU CHARACTER-1B263;Lo;0;L;;;;;N;;;;; +1B264;NUSHU CHARACTER-1B264;Lo;0;L;;;;;N;;;;; +1B265;NUSHU CHARACTER-1B265;Lo;0;L;;;;;N;;;;; +1B266;NUSHU CHARACTER-1B266;Lo;0;L;;;;;N;;;;; +1B267;NUSHU CHARACTER-1B267;Lo;0;L;;;;;N;;;;; +1B268;NUSHU CHARACTER-1B268;Lo;0;L;;;;;N;;;;; +1B269;NUSHU CHARACTER-1B269;Lo;0;L;;;;;N;;;;; +1B26A;NUSHU CHARACTER-1B26A;Lo;0;L;;;;;N;;;;; +1B26B;NUSHU CHARACTER-1B26B;Lo;0;L;;;;;N;;;;; +1B26C;NUSHU CHARACTER-1B26C;Lo;0;L;;;;;N;;;;; +1B26D;NUSHU CHARACTER-1B26D;Lo;0;L;;;;;N;;;;; +1B26E;NUSHU CHARACTER-1B26E;Lo;0;L;;;;;N;;;;; +1B26F;NUSHU CHARACTER-1B26F;Lo;0;L;;;;;N;;;;; +1B270;NUSHU CHARACTER-1B270;Lo;0;L;;;;;N;;;;; +1B271;NUSHU CHARACTER-1B271;Lo;0;L;;;;;N;;;;; +1B272;NUSHU CHARACTER-1B272;Lo;0;L;;;;;N;;;;; +1B273;NUSHU CHARACTER-1B273;Lo;0;L;;;;;N;;;;; +1B274;NUSHU CHARACTER-1B274;Lo;0;L;;;;;N;;;;; +1B275;NUSHU CHARACTER-1B275;Lo;0;L;;;;;N;;;;; +1B276;NUSHU CHARACTER-1B276;Lo;0;L;;;;;N;;;;; +1B277;NUSHU CHARACTER-1B277;Lo;0;L;;;;;N;;;;; +1B278;NUSHU CHARACTER-1B278;Lo;0;L;;;;;N;;;;; +1B279;NUSHU CHARACTER-1B279;Lo;0;L;;;;;N;;;;; +1B27A;NUSHU CHARACTER-1B27A;Lo;0;L;;;;;N;;;;; +1B27B;NUSHU CHARACTER-1B27B;Lo;0;L;;;;;N;;;;; +1B27C;NUSHU CHARACTER-1B27C;Lo;0;L;;;;;N;;;;; +1B27D;NUSHU CHARACTER-1B27D;Lo;0;L;;;;;N;;;;; +1B27E;NUSHU CHARACTER-1B27E;Lo;0;L;;;;;N;;;;; +1B27F;NUSHU CHARACTER-1B27F;Lo;0;L;;;;;N;;;;; +1B280;NUSHU CHARACTER-1B280;Lo;0;L;;;;;N;;;;; +1B281;NUSHU CHARACTER-1B281;Lo;0;L;;;;;N;;;;; +1B282;NUSHU CHARACTER-1B282;Lo;0;L;;;;;N;;;;; +1B283;NUSHU CHARACTER-1B283;Lo;0;L;;;;;N;;;;; +1B284;NUSHU CHARACTER-1B284;Lo;0;L;;;;;N;;;;; +1B285;NUSHU CHARACTER-1B285;Lo;0;L;;;;;N;;;;; +1B286;NUSHU CHARACTER-1B286;Lo;0;L;;;;;N;;;;; +1B287;NUSHU CHARACTER-1B287;Lo;0;L;;;;;N;;;;; +1B288;NUSHU CHARACTER-1B288;Lo;0;L;;;;;N;;;;; +1B289;NUSHU CHARACTER-1B289;Lo;0;L;;;;;N;;;;; +1B28A;NUSHU CHARACTER-1B28A;Lo;0;L;;;;;N;;;;; +1B28B;NUSHU CHARACTER-1B28B;Lo;0;L;;;;;N;;;;; +1B28C;NUSHU CHARACTER-1B28C;Lo;0;L;;;;;N;;;;; +1B28D;NUSHU CHARACTER-1B28D;Lo;0;L;;;;;N;;;;; +1B28E;NUSHU CHARACTER-1B28E;Lo;0;L;;;;;N;;;;; +1B28F;NUSHU CHARACTER-1B28F;Lo;0;L;;;;;N;;;;; +1B290;NUSHU CHARACTER-1B290;Lo;0;L;;;;;N;;;;; +1B291;NUSHU CHARACTER-1B291;Lo;0;L;;;;;N;;;;; +1B292;NUSHU CHARACTER-1B292;Lo;0;L;;;;;N;;;;; +1B293;NUSHU CHARACTER-1B293;Lo;0;L;;;;;N;;;;; +1B294;NUSHU CHARACTER-1B294;Lo;0;L;;;;;N;;;;; +1B295;NUSHU CHARACTER-1B295;Lo;0;L;;;;;N;;;;; +1B296;NUSHU CHARACTER-1B296;Lo;0;L;;;;;N;;;;; +1B297;NUSHU CHARACTER-1B297;Lo;0;L;;;;;N;;;;; +1B298;NUSHU CHARACTER-1B298;Lo;0;L;;;;;N;;;;; +1B299;NUSHU CHARACTER-1B299;Lo;0;L;;;;;N;;;;; +1B29A;NUSHU CHARACTER-1B29A;Lo;0;L;;;;;N;;;;; +1B29B;NUSHU CHARACTER-1B29B;Lo;0;L;;;;;N;;;;; +1B29C;NUSHU CHARACTER-1B29C;Lo;0;L;;;;;N;;;;; +1B29D;NUSHU CHARACTER-1B29D;Lo;0;L;;;;;N;;;;; +1B29E;NUSHU CHARACTER-1B29E;Lo;0;L;;;;;N;;;;; +1B29F;NUSHU CHARACTER-1B29F;Lo;0;L;;;;;N;;;;; +1B2A0;NUSHU CHARACTER-1B2A0;Lo;0;L;;;;;N;;;;; +1B2A1;NUSHU CHARACTER-1B2A1;Lo;0;L;;;;;N;;;;; +1B2A2;NUSHU CHARACTER-1B2A2;Lo;0;L;;;;;N;;;;; +1B2A3;NUSHU CHARACTER-1B2A3;Lo;0;L;;;;;N;;;;; +1B2A4;NUSHU CHARACTER-1B2A4;Lo;0;L;;;;;N;;;;; +1B2A5;NUSHU CHARACTER-1B2A5;Lo;0;L;;;;;N;;;;; +1B2A6;NUSHU CHARACTER-1B2A6;Lo;0;L;;;;;N;;;;; +1B2A7;NUSHU CHARACTER-1B2A7;Lo;0;L;;;;;N;;;;; +1B2A8;NUSHU CHARACTER-1B2A8;Lo;0;L;;;;;N;;;;; +1B2A9;NUSHU CHARACTER-1B2A9;Lo;0;L;;;;;N;;;;; +1B2AA;NUSHU CHARACTER-1B2AA;Lo;0;L;;;;;N;;;;; +1B2AB;NUSHU CHARACTER-1B2AB;Lo;0;L;;;;;N;;;;; +1B2AC;NUSHU CHARACTER-1B2AC;Lo;0;L;;;;;N;;;;; +1B2AD;NUSHU CHARACTER-1B2AD;Lo;0;L;;;;;N;;;;; +1B2AE;NUSHU CHARACTER-1B2AE;Lo;0;L;;;;;N;;;;; +1B2AF;NUSHU CHARACTER-1B2AF;Lo;0;L;;;;;N;;;;; +1B2B0;NUSHU CHARACTER-1B2B0;Lo;0;L;;;;;N;;;;; +1B2B1;NUSHU CHARACTER-1B2B1;Lo;0;L;;;;;N;;;;; +1B2B2;NUSHU CHARACTER-1B2B2;Lo;0;L;;;;;N;;;;; +1B2B3;NUSHU CHARACTER-1B2B3;Lo;0;L;;;;;N;;;;; +1B2B4;NUSHU CHARACTER-1B2B4;Lo;0;L;;;;;N;;;;; +1B2B5;NUSHU CHARACTER-1B2B5;Lo;0;L;;;;;N;;;;; +1B2B6;NUSHU CHARACTER-1B2B6;Lo;0;L;;;;;N;;;;; +1B2B7;NUSHU CHARACTER-1B2B7;Lo;0;L;;;;;N;;;;; +1B2B8;NUSHU CHARACTER-1B2B8;Lo;0;L;;;;;N;;;;; +1B2B9;NUSHU CHARACTER-1B2B9;Lo;0;L;;;;;N;;;;; +1B2BA;NUSHU CHARACTER-1B2BA;Lo;0;L;;;;;N;;;;; +1B2BB;NUSHU CHARACTER-1B2BB;Lo;0;L;;;;;N;;;;; +1B2BC;NUSHU CHARACTER-1B2BC;Lo;0;L;;;;;N;;;;; +1B2BD;NUSHU CHARACTER-1B2BD;Lo;0;L;;;;;N;;;;; +1B2BE;NUSHU CHARACTER-1B2BE;Lo;0;L;;;;;N;;;;; +1B2BF;NUSHU CHARACTER-1B2BF;Lo;0;L;;;;;N;;;;; +1B2C0;NUSHU CHARACTER-1B2C0;Lo;0;L;;;;;N;;;;; +1B2C1;NUSHU CHARACTER-1B2C1;Lo;0;L;;;;;N;;;;; +1B2C2;NUSHU CHARACTER-1B2C2;Lo;0;L;;;;;N;;;;; +1B2C3;NUSHU CHARACTER-1B2C3;Lo;0;L;;;;;N;;;;; +1B2C4;NUSHU CHARACTER-1B2C4;Lo;0;L;;;;;N;;;;; +1B2C5;NUSHU CHARACTER-1B2C5;Lo;0;L;;;;;N;;;;; +1B2C6;NUSHU CHARACTER-1B2C6;Lo;0;L;;;;;N;;;;; +1B2C7;NUSHU CHARACTER-1B2C7;Lo;0;L;;;;;N;;;;; +1B2C8;NUSHU CHARACTER-1B2C8;Lo;0;L;;;;;N;;;;; +1B2C9;NUSHU CHARACTER-1B2C9;Lo;0;L;;;;;N;;;;; +1B2CA;NUSHU CHARACTER-1B2CA;Lo;0;L;;;;;N;;;;; +1B2CB;NUSHU CHARACTER-1B2CB;Lo;0;L;;;;;N;;;;; +1B2CC;NUSHU CHARACTER-1B2CC;Lo;0;L;;;;;N;;;;; +1B2CD;NUSHU CHARACTER-1B2CD;Lo;0;L;;;;;N;;;;; +1B2CE;NUSHU CHARACTER-1B2CE;Lo;0;L;;;;;N;;;;; +1B2CF;NUSHU CHARACTER-1B2CF;Lo;0;L;;;;;N;;;;; +1B2D0;NUSHU CHARACTER-1B2D0;Lo;0;L;;;;;N;;;;; +1B2D1;NUSHU CHARACTER-1B2D1;Lo;0;L;;;;;N;;;;; +1B2D2;NUSHU CHARACTER-1B2D2;Lo;0;L;;;;;N;;;;; +1B2D3;NUSHU CHARACTER-1B2D3;Lo;0;L;;;;;N;;;;; +1B2D4;NUSHU CHARACTER-1B2D4;Lo;0;L;;;;;N;;;;; +1B2D5;NUSHU CHARACTER-1B2D5;Lo;0;L;;;;;N;;;;; +1B2D6;NUSHU CHARACTER-1B2D6;Lo;0;L;;;;;N;;;;; +1B2D7;NUSHU CHARACTER-1B2D7;Lo;0;L;;;;;N;;;;; +1B2D8;NUSHU CHARACTER-1B2D8;Lo;0;L;;;;;N;;;;; +1B2D9;NUSHU CHARACTER-1B2D9;Lo;0;L;;;;;N;;;;; +1B2DA;NUSHU CHARACTER-1B2DA;Lo;0;L;;;;;N;;;;; +1B2DB;NUSHU CHARACTER-1B2DB;Lo;0;L;;;;;N;;;;; +1B2DC;NUSHU CHARACTER-1B2DC;Lo;0;L;;;;;N;;;;; +1B2DD;NUSHU CHARACTER-1B2DD;Lo;0;L;;;;;N;;;;; +1B2DE;NUSHU CHARACTER-1B2DE;Lo;0;L;;;;;N;;;;; +1B2DF;NUSHU CHARACTER-1B2DF;Lo;0;L;;;;;N;;;;; +1B2E0;NUSHU CHARACTER-1B2E0;Lo;0;L;;;;;N;;;;; +1B2E1;NUSHU CHARACTER-1B2E1;Lo;0;L;;;;;N;;;;; +1B2E2;NUSHU CHARACTER-1B2E2;Lo;0;L;;;;;N;;;;; +1B2E3;NUSHU CHARACTER-1B2E3;Lo;0;L;;;;;N;;;;; +1B2E4;NUSHU CHARACTER-1B2E4;Lo;0;L;;;;;N;;;;; +1B2E5;NUSHU CHARACTER-1B2E5;Lo;0;L;;;;;N;;;;; +1B2E6;NUSHU CHARACTER-1B2E6;Lo;0;L;;;;;N;;;;; +1B2E7;NUSHU CHARACTER-1B2E7;Lo;0;L;;;;;N;;;;; +1B2E8;NUSHU CHARACTER-1B2E8;Lo;0;L;;;;;N;;;;; +1B2E9;NUSHU CHARACTER-1B2E9;Lo;0;L;;;;;N;;;;; +1B2EA;NUSHU CHARACTER-1B2EA;Lo;0;L;;;;;N;;;;; +1B2EB;NUSHU CHARACTER-1B2EB;Lo;0;L;;;;;N;;;;; +1B2EC;NUSHU CHARACTER-1B2EC;Lo;0;L;;;;;N;;;;; +1B2ED;NUSHU CHARACTER-1B2ED;Lo;0;L;;;;;N;;;;; +1B2EE;NUSHU CHARACTER-1B2EE;Lo;0;L;;;;;N;;;;; +1B2EF;NUSHU CHARACTER-1B2EF;Lo;0;L;;;;;N;;;;; +1B2F0;NUSHU CHARACTER-1B2F0;Lo;0;L;;;;;N;;;;; +1B2F1;NUSHU CHARACTER-1B2F1;Lo;0;L;;;;;N;;;;; +1B2F2;NUSHU CHARACTER-1B2F2;Lo;0;L;;;;;N;;;;; +1B2F3;NUSHU CHARACTER-1B2F3;Lo;0;L;;;;;N;;;;; +1B2F4;NUSHU CHARACTER-1B2F4;Lo;0;L;;;;;N;;;;; +1B2F5;NUSHU CHARACTER-1B2F5;Lo;0;L;;;;;N;;;;; +1B2F6;NUSHU CHARACTER-1B2F6;Lo;0;L;;;;;N;;;;; +1B2F7;NUSHU CHARACTER-1B2F7;Lo;0;L;;;;;N;;;;; +1B2F8;NUSHU CHARACTER-1B2F8;Lo;0;L;;;;;N;;;;; +1B2F9;NUSHU CHARACTER-1B2F9;Lo;0;L;;;;;N;;;;; +1B2FA;NUSHU CHARACTER-1B2FA;Lo;0;L;;;;;N;;;;; +1B2FB;NUSHU CHARACTER-1B2FB;Lo;0;L;;;;;N;;;;; 1BC00;DUPLOYAN LETTER H;Lo;0;L;;;;;N;;;;; 1BC01;DUPLOYAN LETTER X;Lo;0;L;;;;;N;;;;; 1BC02;DUPLOYAN LETTER P;Lo;0;L;;;;;N;;;;; @@ -28269,6 +29217,12 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 1F248;TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-6557;So;0;L; 3014 6557 3015;;;;N;;;;; 1F250;CIRCLED IDEOGRAPH ADVANTAGE;So;0;L; 5F97;;;;N;;;;; 1F251;CIRCLED IDEOGRAPH ACCEPT;So;0;L; 53EF;;;;N;;;;; +1F260;ROUNDED SYMBOL FOR FU;So;0;ON;;;;;N;;;;; +1F261;ROUNDED SYMBOL FOR LU;So;0;ON;;;;;N;;;;; +1F262;ROUNDED SYMBOL FOR SHOU;So;0;ON;;;;;N;;;;; +1F263;ROUNDED SYMBOL FOR XI;So;0;ON;;;;;N;;;;; +1F264;ROUNDED SYMBOL FOR SHUANGXI;So;0;ON;;;;;N;;;;; +1F265;ROUNDED SYMBOL FOR CAI;So;0;ON;;;;;N;;;;; 1F300;CYCLONE;So;0;ON;;;;;N;;;;; 1F301;FOGGY;So;0;ON;;;;;N;;;;; 1F302;CLOSED UMBRELLA;So;0;ON;;;;;N;;;;; @@ -29248,6 +30202,8 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 1F6D0;PLACE OF WORSHIP;So;0;ON;;;;;N;;;;; 1F6D1;OCTAGONAL SIGN;So;0;ON;;;;;N;;;;; 1F6D2;SHOPPING TROLLEY;So;0;ON;;;;;N;;;;; +1F6D3;STUPA;So;0;ON;;;;;N;;;;; +1F6D4;PAGODA;So;0;ON;;;;;N;;;;; 1F6E0;HAMMER AND WRENCH;So;0;ON;;;;;N;;;;; 1F6E1;SHIELD;So;0;ON;;;;;N;;;;; 1F6E2;OIL DRUM;So;0;ON;;;;;N;;;;; @@ -29268,6 +30224,8 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 1F6F4;SCOOTER;So;0;ON;;;;;N;;;;; 1F6F5;MOTOR SCOOTER;So;0;ON;;;;;N;;;;; 1F6F6;CANOE;So;0;ON;;;;;N;;;;; +1F6F7;SLED;So;0;ON;;;;;N;;;;; +1F6F8;FLYING SAUCER;So;0;ON;;;;;N;;;;; 1F700;ALCHEMICAL SYMBOL FOR QUINTESSENCE;So;0;ON;;;;;N;;;;; 1F701;ALCHEMICAL SYMBOL FOR AIR;So;0;ON;;;;;N;;;;; 1F702;ALCHEMICAL SYMBOL FOR FIRE;So;0;ON;;;;;N;;;;; @@ -29617,6 +30575,18 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 1F8AB;RIGHTWARDS FRONT-TILTED SHADOWED WHITE ARROW;So;0;ON;;;;;N;;;;; 1F8AC;WHITE ARROW SHAFT WIDTH ONE;So;0;ON;;;;;N;;;;; 1F8AD;WHITE ARROW SHAFT WIDTH TWO THIRDS;So;0;ON;;;;;N;;;;; +1F900;CIRCLED CROSS FORMEE WITH FOUR DOTS;So;0;ON;;;;;N;;;;; +1F901;CIRCLED CROSS FORMEE WITH TWO DOTS;So;0;ON;;;;;N;;;;; +1F902;CIRCLED CROSS FORMEE;So;0;ON;;;;;N;;;;; +1F903;LEFT HALF CIRCLE WITH FOUR DOTS;So;0;ON;;;;;N;;;;; +1F904;LEFT HALF CIRCLE WITH THREE DOTS;So;0;ON;;;;;N;;;;; +1F905;LEFT HALF CIRCLE WITH TWO DOTS;So;0;ON;;;;;N;;;;; +1F906;LEFT HALF CIRCLE WITH DOT;So;0;ON;;;;;N;;;;; +1F907;LEFT HALF CIRCLE;So;0;ON;;;;;N;;;;; +1F908;DOWNWARD FACING HOOK;So;0;ON;;;;;N;;;;; +1F909;DOWNWARD FACING NOTCHED HOOK;So;0;ON;;;;;N;;;;; +1F90A;DOWNWARD FACING HOOK WITH DOT;So;0;ON;;;;;N;;;;; +1F90B;DOWNWARD FACING NOTCHED HOOK WITH DOT;So;0;ON;;;;;N;;;;; 1F910;ZIPPER-MOUTH FACE;So;0;ON;;;;;N;;;;; 1F911;MONEY-MOUTH FACE;So;0;ON;;;;;N;;;;; 1F912;FACE WITH THERMOMETER;So;0;ON;;;;;N;;;;; @@ -29632,6 +30602,7 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 1F91C;RIGHT-FACING FIST;So;0;ON;;;;;N;;;;; 1F91D;HANDSHAKE;So;0;ON;;;;;N;;;;; 1F91E;HAND WITH INDEX AND MIDDLE FINGERS CROSSED;So;0;ON;;;;;N;;;;; +1F91F;I LOVE YOU HAND SIGN;So;0;ON;;;;;N;;;;; 1F920;FACE WITH COWBOY HAT;So;0;ON;;;;;N;;;;; 1F921;CLOWN FACE;So;0;ON;;;;;N;;;;; 1F922;NAUSEATED FACE;So;0;ON;;;;;N;;;;; @@ -29640,7 +30611,17 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 1F925;LYING FACE;So;0;ON;;;;;N;;;;; 1F926;FACE PALM;So;0;ON;;;;;N;;;;; 1F927;SNEEZING FACE;So;0;ON;;;;;N;;;;; +1F928;FACE WITH ONE EYEBROW RAISED;So;0;ON;;;;;N;;;;; +1F929;GRINNING FACE WITH STAR EYES;So;0;ON;;;;;N;;;;; +1F92A;GRINNING FACE WITH ONE LARGE AND ONE SMALL EYE;So;0;ON;;;;;N;;;;; +1F92B;FACE WITH FINGER COVERING CLOSED LIPS;So;0;ON;;;;;N;;;;; +1F92C;SERIOUS FACE WITH SYMBOLS COVERING MOUTH;So;0;ON;;;;;N;;;;; +1F92D;SMILING FACE WITH SMILING EYES AND HAND COVERING MOUTH;So;0;ON;;;;;N;;;;; +1F92E;FACE WITH OPEN MOUTH VOMITING;So;0;ON;;;;;N;;;;; +1F92F;SHOCKED FACE WITH EXPLODING HEAD;So;0;ON;;;;;N;;;;; 1F930;PREGNANT WOMAN;So;0;ON;;;;;N;;;;; +1F931;BREAST-FEEDING;So;0;ON;;;;;N;;;;; +1F932;PALMS UP TOGETHER;So;0;ON;;;;;N;;;;; 1F933;SELFIE;So;0;ON;;;;;N;;;;; 1F934;PRINCE;So;0;ON;;;;;N;;;;; 1F935;MAN IN TUXEDO;So;0;ON;;;;;N;;;;; @@ -29665,6 +30646,7 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 1F949;THIRD PLACE MEDAL;So;0;ON;;;;;N;;;;; 1F94A;BOXING GLOVE;So;0;ON;;;;;N;;;;; 1F94B;MARTIAL ARTS UNIFORM;So;0;ON;;;;;N;;;;; +1F94C;CURLING STONE;So;0;ON;;;;;N;;;;; 1F950;CROISSANT;So;0;ON;;;;;N;;;;; 1F951;AVOCADO;So;0;ON;;;;;N;;;;; 1F952;CUCUMBER;So;0;ON;;;;;N;;;;; @@ -29680,6 +30662,19 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 1F95C;PEANUTS;So;0;ON;;;;;N;;;;; 1F95D;KIWIFRUIT;So;0;ON;;;;;N;;;;; 1F95E;PANCAKES;So;0;ON;;;;;N;;;;; +1F95F;DUMPLING;So;0;ON;;;;;N;;;;; +1F960;FORTUNE COOKIE;So;0;ON;;;;;N;;;;; +1F961;TAKEOUT BOX;So;0;ON;;;;;N;;;;; +1F962;CHOPSTICKS;So;0;ON;;;;;N;;;;; +1F963;BOWL WITH SPOON;So;0;ON;;;;;N;;;;; +1F964;CUP WITH STRAW;So;0;ON;;;;;N;;;;; +1F965;COCONUT;So;0;ON;;;;;N;;;;; +1F966;BROCCOLI;So;0;ON;;;;;N;;;;; +1F967;PIE;So;0;ON;;;;;N;;;;; +1F968;PRETZEL;So;0;ON;;;;;N;;;;; +1F969;CUT OF MEAT;So;0;ON;;;;;N;;;;; +1F96A;SANDWICH;So;0;ON;;;;;N;;;;; +1F96B;CANNED FOOD;So;0;ON;;;;;N;;;;; 1F980;CRAB;So;0;ON;;;;;N;;;;; 1F981;LION FACE;So;0;ON;;;;;N;;;;; 1F982;SCORPION;So;0;ON;;;;;N;;;;; @@ -29698,7 +30693,36 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 1F98F;RHINOCEROS;So;0;ON;;;;;N;;;;; 1F990;SHRIMP;So;0;ON;;;;;N;;;;; 1F991;SQUID;So;0;ON;;;;;N;;;;; +1F992;GIRAFFE FACE;So;0;ON;;;;;N;;;;; +1F993;ZEBRA FACE;So;0;ON;;;;;N;;;;; +1F994;HEDGEHOG;So;0;ON;;;;;N;;;;; +1F995;SAUROPOD;So;0;ON;;;;;N;;;;; +1F996;T-REX;So;0;ON;;;;;N;;;;; +1F997;CRICKET;So;0;ON;;;;;N;;;;; 1F9C0;CHEESE WEDGE;So;0;ON;;;;;N;;;;; +1F9D0;FACE WITH MONOCLE;So;0;ON;;;;;N;;;;; +1F9D1;ADULT;So;0;ON;;;;;N;;;;; +1F9D2;CHILD;So;0;ON;;;;;N;;;;; +1F9D3;OLDER ADULT;So;0;ON;;;;;N;;;;; +1F9D4;BEARDED PERSON;So;0;ON;;;;;N;;;;; +1F9D5;PERSON WITH HEADSCARF;So;0;ON;;;;;N;;;;; +1F9D6;PERSON IN STEAMY ROOM;So;0;ON;;;;;N;;;;; +1F9D7;PERSON CLIMBING;So;0;ON;;;;;N;;;;; +1F9D8;PERSON IN LOTUS POSITION;So;0;ON;;;;;N;;;;; +1F9D9;MAGE;So;0;ON;;;;;N;;;;; +1F9DA;FAIRY;So;0;ON;;;;;N;;;;; +1F9DB;VAMPIRE;So;0;ON;;;;;N;;;;; +1F9DC;MERPERSON;So;0;ON;;;;;N;;;;; +1F9DD;ELF;So;0;ON;;;;;N;;;;; +1F9DE;GENIE;So;0;ON;;;;;N;;;;; +1F9DF;ZOMBIE;So;0;ON;;;;;N;;;;; +1F9E0;BRAIN;So;0;ON;;;;;N;;;;; +1F9E1;ORANGE HEART;So;0;ON;;;;;N;;;;; +1F9E2;BILLED CAP;So;0;ON;;;;;N;;;;; +1F9E3;SCARF;So;0;ON;;;;;N;;;;; +1F9E4;GLOVES;So;0;ON;;;;;N;;;;; +1F9E5;COAT;So;0;ON;;;;;N;;;;; +1F9E6;SOCKS;So;0;ON;;;;;N;;;;; 20000;;Lo;0;L;;;;;N;;;;; 2A6D6;;Lo;0;L;;;;;N;;;;; 2A700;;Lo;0;L;;;;;N;;;;; @@ -29707,6 +30731,8 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 2B81D;;Lo;0;L;;;;;N;;;;; 2B820;;Lo;0;L;;;;;N;;;;; 2CEA1;;Lo;0;L;;;;;N;;;;; +2CEB0;;Lo;0;L;;;;;N;;;;; +2EBE0;;Lo;0;L;;;;;N;;;;; 2F800;CJK COMPATIBILITY IDEOGRAPH-2F800;Lo;0;L;4E3D;;;;N;;;;; 2F801;CJK COMPATIBILITY IDEOGRAPH-2F801;Lo;0;L;4E38;;;;N;;;;; 2F802;CJK COMPATIBILITY IDEOGRAPH-2F802;Lo;0;L;4E41;;;;N;;;;; diff --git a/unicode/emoji-data.txt b/unicode/emoji-data.txt index 731b62c4c1..3ad46c081e 100644 --- a/unicode/emoji-data.txt +++ b/unicode/emoji-data.txt @@ -1,362 +1,383 @@ # emoji-data.txt -# Date: 2016-06-02, 09:26:10 GMT -# © 2016 Unicode®, Inc. +# Date: 2017-03-27, 07:29:32 GMT +# © 2017 Unicode®, Inc. # Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. # For terms of use, see http://www.unicode.org/terms_of_use.html # # Emoji Data for UTR #51 -# Version: 3.0 +# Version: 5.0 # # For documentation and usage, see http://www.unicode.org/reports/tr51 # # Warning: the format has changed from Version 1.0 # Format: -# codepoint(s) ; property(=Yes) # version [count] name(s) +# codepoint(s) ; property(=Yes) # comments +# +# Characters and sequences are listed in code point order. Users should be shown a more natural order. +# See the CLDR collation order for Emoji. + # ================================================ # All omitted code points have Emoji=No # @missing: 0000..10FFFF ; Emoji ; No -0023 ; Emoji # 1.1 [1] (#) NUMBER SIGN -002A ; Emoji # 1.1 [1] (*) ASTERISK -0030..0039 ; Emoji # 1.1 [10] (0..9) DIGIT ZERO..DIGIT NINE -00A9 ; Emoji # 1.1 [1] (©) COPYRIGHT SIGN -00AE ; Emoji # 1.1 [1] (®) REGISTERED SIGN -203C ; Emoji # 1.1 [1] (‼) DOUBLE EXCLAMATION MARK -2049 ; Emoji # 3.0 [1] (⁉) EXCLAMATION QUESTION MARK -2122 ; Emoji # 1.1 [1] (™) TRADE MARK SIGN -2139 ; Emoji # 3.0 [1] (ℹ) INFORMATION SOURCE -2194..2199 ; Emoji # 1.1 [6] (↔..↙) LEFT RIGHT ARROW..SOUTH WEST ARROW -21A9..21AA ; Emoji # 1.1 [2] (↩..↪) LEFTWARDS ARROW WITH HOOK..RIGHTWARDS ARROW WITH HOOK -231A..231B ; Emoji # 1.1 [2] (⌚..⌛) WATCH..HOURGLASS -2328 ; Emoji # 1.1 [1] (⌨) KEYBOARD -23CF ; Emoji # 4.0 [1] (⏏) EJECT SYMBOL -23E9..23F3 ; Emoji # 6.0 [11] (⏩..⏳) BLACK RIGHT-POINTING DOUBLE TRIANGLE..HOURGLASS WITH FLOWING SAND -23F8..23FA ; Emoji # 7.0 [3] (⏸..⏺) DOUBLE VERTICAL BAR..BLACK CIRCLE FOR RECORD -24C2 ; Emoji # 1.1 [1] (Ⓜ) CIRCLED LATIN CAPITAL LETTER M -25AA..25AB ; Emoji # 1.1 [2] (▪..▫) BLACK SMALL SQUARE..WHITE SMALL SQUARE -25B6 ; Emoji # 1.1 [1] (▶) BLACK RIGHT-POINTING TRIANGLE -25C0 ; Emoji # 1.1 [1] (◀) BLACK LEFT-POINTING TRIANGLE -25FB..25FE ; Emoji # 3.2 [4] (◻..◾) WHITE MEDIUM SQUARE..BLACK MEDIUM SMALL SQUARE -2600..2604 ; Emoji # 1.1 [5] (☀..☄) BLACK SUN WITH RAYS..COMET -260E ; Emoji # 1.1 [1] (☎) BLACK TELEPHONE -2611 ; Emoji # 1.1 [1] (☑) BALLOT BOX WITH CHECK -2614..2615 ; Emoji # 4.0 [2] (☔..☕) UMBRELLA WITH RAIN DROPS..HOT BEVERAGE -2618 ; Emoji # 4.1 [1] (☘) SHAMROCK -261D ; Emoji # 1.1 [1] (☝) WHITE UP POINTING INDEX -2620 ; Emoji # 1.1 [1] (☠) SKULL AND CROSSBONES -2622..2623 ; Emoji # 1.1 [2] (☢..☣) RADIOACTIVE SIGN..BIOHAZARD SIGN -2626 ; Emoji # 1.1 [1] (☦) ORTHODOX CROSS -262A ; Emoji # 1.1 [1] (☪) STAR AND CRESCENT -262E..262F ; Emoji # 1.1 [2] (☮..☯) PEACE SYMBOL..YIN YANG -2638..263A ; Emoji # 1.1 [3] (☸..☺) WHEEL OF DHARMA..WHITE SMILING FACE -2648..2653 ; Emoji # 1.1 [12] (♈..♓) ARIES..PISCES -2660 ; Emoji # 1.1 [1] (♠) BLACK SPADE SUIT -2663 ; Emoji # 1.1 [1] (♣) BLACK CLUB SUIT -2665..2666 ; Emoji # 1.1 [2] (♥..♦) BLACK HEART SUIT..BLACK DIAMOND SUIT -2668 ; Emoji # 1.1 [1] (♨) HOT SPRINGS -267B ; Emoji # 3.2 [1] (♻) BLACK UNIVERSAL RECYCLING SYMBOL -267F ; Emoji # 4.1 [1] (♿) WHEELCHAIR SYMBOL -2692..2694 ; Emoji # 4.1 [3] (⚒..⚔) HAMMER AND PICK..CROSSED SWORDS -2696..2697 ; Emoji # 4.1 [2] (⚖..⚗) SCALES..ALEMBIC -2699 ; Emoji # 4.1 [1] (⚙) GEAR -269B..269C ; Emoji # 4.1 [2] (⚛..⚜) ATOM SYMBOL..FLEUR-DE-LIS -26A0..26A1 ; Emoji # 4.0 [2] (⚠..⚡) WARNING SIGN..HIGH VOLTAGE SIGN -26AA..26AB ; Emoji # 4.1 [2] (⚪..⚫) MEDIUM WHITE CIRCLE..MEDIUM BLACK CIRCLE -26B0..26B1 ; Emoji # 4.1 [2] (⚰..⚱) COFFIN..FUNERAL URN -26BD..26BE ; Emoji # 5.2 [2] (⚽..⚾) SOCCER BALL..BASEBALL -26C4..26C5 ; Emoji # 5.2 [2] (⛄..⛅) SNOWMAN WITHOUT SNOW..SUN BEHIND CLOUD -26C8 ; Emoji # 5.2 [1] (⛈) THUNDER CLOUD AND RAIN -26CE ; Emoji # 6.0 [1] (⛎) OPHIUCHUS -26CF ; Emoji # 5.2 [1] (⛏) PICK -26D1 ; Emoji # 5.2 [1] (⛑) HELMET WITH WHITE CROSS -26D3..26D4 ; Emoji # 5.2 [2] (⛓..⛔) CHAINS..NO ENTRY -26E9..26EA ; Emoji # 5.2 [2] (⛩..⛪) SHINTO SHRINE..CHURCH -26F0..26F5 ; Emoji # 5.2 [6] (⛰..⛵) MOUNTAIN..SAILBOAT -26F7..26FA ; Emoji # 5.2 [4] (⛷..⛺) SKIER..TENT -26FD ; Emoji # 5.2 [1] (⛽) FUEL PUMP -2702 ; Emoji # 1.1 [1] (✂) BLACK SCISSORS -2705 ; Emoji # 6.0 [1] (✅) WHITE HEAVY CHECK MARK -2708..2709 ; Emoji # 1.1 [2] (✈..✉) AIRPLANE..ENVELOPE -270A..270B ; Emoji # 6.0 [2] (✊..✋) RAISED FIST..RAISED HAND -270C..270D ; Emoji # 1.1 [2] (✌..✍) VICTORY HAND..WRITING HAND -270F ; Emoji # 1.1 [1] (✏) PENCIL -2712 ; Emoji # 1.1 [1] (✒) BLACK NIB -2714 ; Emoji # 1.1 [1] (✔) HEAVY CHECK MARK -2716 ; Emoji # 1.1 [1] (✖) HEAVY MULTIPLICATION X -271D ; Emoji # 1.1 [1] (✝) LATIN CROSS -2721 ; Emoji # 1.1 [1] (✡) STAR OF DAVID -2728 ; Emoji # 6.0 [1] (✨) SPARKLES -2733..2734 ; Emoji # 1.1 [2] (✳..✴) EIGHT SPOKED ASTERISK..EIGHT POINTED BLACK STAR -2744 ; Emoji # 1.1 [1] (❄) SNOWFLAKE -2747 ; Emoji # 1.1 [1] (❇) SPARKLE -274C ; Emoji # 6.0 [1] (❌) CROSS MARK -274E ; Emoji # 6.0 [1] (❎) NEGATIVE SQUARED CROSS MARK -2753..2755 ; Emoji # 6.0 [3] (❓..❕) BLACK QUESTION MARK ORNAMENT..WHITE EXCLAMATION MARK ORNAMENT -2757 ; Emoji # 5.2 [1] (❗) HEAVY EXCLAMATION MARK SYMBOL -2763..2764 ; Emoji # 1.1 [2] (❣..❤) HEAVY HEART EXCLAMATION MARK ORNAMENT..HEAVY BLACK HEART -2795..2797 ; Emoji # 6.0 [3] (➕..➗) HEAVY PLUS SIGN..HEAVY DIVISION SIGN -27A1 ; Emoji # 1.1 [1] (➡) BLACK RIGHTWARDS ARROW -27B0 ; Emoji # 6.0 [1] (➰) CURLY LOOP -27BF ; Emoji # 6.0 [1] (➿) DOUBLE CURLY LOOP -2934..2935 ; Emoji # 3.2 [2] (⤴..⤵) ARROW POINTING RIGHTWARDS THEN CURVING UPWARDS..ARROW POINTING RIGHTWARDS THEN CURVING DOWNWARDS -2B05..2B07 ; Emoji # 4.0 [3] (⬅..⬇) LEFTWARDS BLACK ARROW..DOWNWARDS BLACK ARROW -2B1B..2B1C ; Emoji # 5.1 [2] (⬛..⬜) BLACK LARGE SQUARE..WHITE LARGE SQUARE -2B50 ; Emoji # 5.1 [1] (⭐) WHITE MEDIUM STAR -2B55 ; Emoji # 5.2 [1] (⭕) HEAVY LARGE CIRCLE -3030 ; Emoji # 1.1 [1] (〰) WAVY DASH -303D ; Emoji # 3.2 [1] (〽) PART ALTERNATION MARK -3297 ; Emoji # 1.1 [1] (㊗) CIRCLED IDEOGRAPH CONGRATULATION -3299 ; Emoji # 1.1 [1] (㊙) CIRCLED IDEOGRAPH SECRET -1F004 ; Emoji # 5.1 [1] (🀄) MAHJONG TILE RED DRAGON -1F0CF ; Emoji # 6.0 [1] (🃏) PLAYING CARD BLACK JOKER -1F170..1F171 ; Emoji # 6.0 [2] (🅰..🅱) NEGATIVE SQUARED LATIN CAPITAL LETTER A..NEGATIVE SQUARED LATIN CAPITAL LETTER B -1F17E ; Emoji # 6.0 [1] (🅾) NEGATIVE SQUARED LATIN CAPITAL LETTER O -1F17F ; Emoji # 5.2 [1] (🅿) NEGATIVE SQUARED LATIN CAPITAL LETTER P -1F18E ; Emoji # 6.0 [1] (🆎) NEGATIVE SQUARED AB -1F191..1F19A ; Emoji # 6.0 [10] (🆑..🆚) SQUARED CL..SQUARED VS -1F1E6..1F1FF ; Emoji # 6.0 [26] (🇦..🇿) REGIONAL INDICATOR SYMBOL LETTER A..REGIONAL INDICATOR SYMBOL LETTER Z -1F201..1F202 ; Emoji # 6.0 [2] (🈁..🈂) SQUARED KATAKANA KOKO..SQUARED KATAKANA SA -1F21A ; Emoji # 5.2 [1] (🈚) SQUARED CJK UNIFIED IDEOGRAPH-7121 -1F22F ; Emoji # 5.2 [1] (🈯) SQUARED CJK UNIFIED IDEOGRAPH-6307 -1F232..1F23A ; Emoji # 6.0 [9] (🈲..🈺) SQUARED CJK UNIFIED IDEOGRAPH-7981..SQUARED CJK UNIFIED IDEOGRAPH-55B6 -1F250..1F251 ; Emoji # 6.0 [2] (🉐..🉑) CIRCLED IDEOGRAPH ADVANTAGE..CIRCLED IDEOGRAPH ACCEPT -1F300..1F320 ; Emoji # 6.0 [33] (🌀..🌠) CYCLONE..SHOOTING STAR -1F321 ; Emoji # 7.0 [1] (🌡) THERMOMETER -1F324..1F32C ; Emoji # 7.0 [9] (🌤..🌬) WHITE SUN WITH SMALL CLOUD..WIND BLOWING FACE -1F32D..1F32F ; Emoji # 8.0 [3] (🌭..🌯) HOT DOG..BURRITO -1F330..1F335 ; Emoji # 6.0 [6] (🌰..🌵) CHESTNUT..CACTUS -1F336 ; Emoji # 7.0 [1] (🌶) HOT PEPPER -1F337..1F37C ; Emoji # 6.0 [70] (🌷..🍼) TULIP..BABY BOTTLE -1F37D ; Emoji # 7.0 [1] (🍽) FORK AND KNIFE WITH PLATE -1F37E..1F37F ; Emoji # 8.0 [2] (🍾..🍿) BOTTLE WITH POPPING CORK..POPCORN -1F380..1F393 ; Emoji # 6.0 [20] (🎀..🎓) RIBBON..GRADUATION CAP -1F396..1F397 ; Emoji # 7.0 [2] (🎖..🎗) MILITARY MEDAL..REMINDER RIBBON -1F399..1F39B ; Emoji # 7.0 [3] (🎙..🎛) STUDIO MICROPHONE..CONTROL KNOBS -1F39E..1F39F ; Emoji # 7.0 [2] (🎞..🎟) FILM FRAMES..ADMISSION TICKETS -1F3A0..1F3C4 ; Emoji # 6.0 [37] (🎠..🏄) CAROUSEL HORSE..SURFER -1F3C5 ; Emoji # 7.0 [1] (🏅) SPORTS MEDAL -1F3C6..1F3CA ; Emoji # 6.0 [5] (🏆..🏊) TROPHY..SWIMMER -1F3CB..1F3CE ; Emoji # 7.0 [4] (🏋..🏎) WEIGHT LIFTER..RACING CAR -1F3CF..1F3D3 ; Emoji # 8.0 [5] (🏏..🏓) CRICKET BAT AND BALL..TABLE TENNIS PADDLE AND BALL -1F3D4..1F3DF ; Emoji # 7.0 [12] (🏔..🏟) SNOW CAPPED MOUNTAIN..STADIUM -1F3E0..1F3F0 ; Emoji # 6.0 [17] (🏠..🏰) HOUSE BUILDING..EUROPEAN CASTLE -1F3F3..1F3F5 ; Emoji # 7.0 [3] (🏳..🏵) WAVING WHITE FLAG..ROSETTE -1F3F7 ; Emoji # 7.0 [1] (🏷) LABEL -1F3F8..1F3FF ; Emoji # 8.0 [8] (🏸..🏿) BADMINTON RACQUET AND SHUTTLECOCK..EMOJI MODIFIER FITZPATRICK TYPE-6 -1F400..1F43E ; Emoji # 6.0 [63] (🐀..🐾) RAT..PAW PRINTS -1F43F ; Emoji # 7.0 [1] (🐿) CHIPMUNK -1F440 ; Emoji # 6.0 [1] (👀) EYES -1F441 ; Emoji # 7.0 [1] (👁) EYE -1F442..1F4F7 ; Emoji # 6.0[182] (👂..📷) EAR..CAMERA -1F4F8 ; Emoji # 7.0 [1] (📸) CAMERA WITH FLASH -1F4F9..1F4FC ; Emoji # 6.0 [4] (📹..📼) VIDEO CAMERA..VIDEOCASSETTE -1F4FD ; Emoji # 7.0 [1] (📽) FILM PROJECTOR -1F4FF ; Emoji # 8.0 [1] (📿) PRAYER BEADS -1F500..1F53D ; Emoji # 6.0 [62] (🔀..🔽) TWISTED RIGHTWARDS ARROWS..DOWN-POINTING SMALL RED TRIANGLE -1F549..1F54A ; Emoji # 7.0 [2] (🕉..🕊) OM SYMBOL..DOVE OF PEACE -1F54B..1F54E ; Emoji # 8.0 [4] (🕋..🕎) KAABA..MENORAH WITH NINE BRANCHES -1F550..1F567 ; Emoji # 6.0 [24] (🕐..🕧) CLOCK FACE ONE OCLOCK..CLOCK FACE TWELVE-THIRTY -1F56F..1F570 ; Emoji # 7.0 [2] (🕯..🕰) CANDLE..MANTELPIECE CLOCK -1F573..1F579 ; Emoji # 7.0 [7] (🕳..🕹) HOLE..JOYSTICK -1F57A ; Emoji # 9.0 [1] (🕺) MAN DANCING -1F587 ; Emoji # 7.0 [1] (🖇) LINKED PAPERCLIPS -1F58A..1F58D ; Emoji # 7.0 [4] (🖊..🖍) LOWER LEFT BALLPOINT PEN..LOWER LEFT CRAYON -1F590 ; Emoji # 7.0 [1] (🖐) RAISED HAND WITH FINGERS SPLAYED -1F595..1F596 ; Emoji # 7.0 [2] (🖕..🖖) REVERSED HAND WITH MIDDLE FINGER EXTENDED..RAISED HAND WITH PART BETWEEN MIDDLE AND RING FINGERS -1F5A4 ; Emoji # 9.0 [1] (🖤) BLACK HEART -1F5A5 ; Emoji # 7.0 [1] (🖥) DESKTOP COMPUTER -1F5A8 ; Emoji # 7.0 [1] (🖨) PRINTER -1F5B1..1F5B2 ; Emoji # 7.0 [2] (🖱..🖲) THREE BUTTON MOUSE..TRACKBALL -1F5BC ; Emoji # 7.0 [1] (🖼) FRAME WITH PICTURE -1F5C2..1F5C4 ; Emoji # 7.0 [3] (🗂..🗄) CARD INDEX DIVIDERS..FILE CABINET -1F5D1..1F5D3 ; Emoji # 7.0 [3] (🗑..🗓) WASTEBASKET..SPIRAL CALENDAR PAD -1F5DC..1F5DE ; Emoji # 7.0 [3] (🗜..🗞) COMPRESSION..ROLLED-UP NEWSPAPER -1F5E1 ; Emoji # 7.0 [1] (🗡) DAGGER KNIFE -1F5E3 ; Emoji # 7.0 [1] (🗣) SPEAKING HEAD IN SILHOUETTE -1F5E8 ; Emoji # 7.0 [1] (🗨) LEFT SPEECH BUBBLE -1F5EF ; Emoji # 7.0 [1] (🗯) RIGHT ANGER BUBBLE -1F5F3 ; Emoji # 7.0 [1] (🗳) BALLOT BOX WITH BALLOT -1F5FA ; Emoji # 7.0 [1] (🗺) WORLD MAP -1F5FB..1F5FF ; Emoji # 6.0 [5] (🗻..🗿) MOUNT FUJI..MOYAI -1F600 ; Emoji # 6.1 [1] (😀) GRINNING FACE -1F601..1F610 ; Emoji # 6.0 [16] (😁..😐) GRINNING FACE WITH SMILING EYES..NEUTRAL FACE -1F611 ; Emoji # 6.1 [1] (😑) EXPRESSIONLESS FACE -1F612..1F614 ; Emoji # 6.0 [3] (😒..😔) UNAMUSED FACE..PENSIVE FACE -1F615 ; Emoji # 6.1 [1] (😕) CONFUSED FACE -1F616 ; Emoji # 6.0 [1] (😖) CONFOUNDED FACE -1F617 ; Emoji # 6.1 [1] (😗) KISSING FACE -1F618 ; Emoji # 6.0 [1] (😘) FACE THROWING A KISS -1F619 ; Emoji # 6.1 [1] (😙) KISSING FACE WITH SMILING EYES -1F61A ; Emoji # 6.0 [1] (😚) KISSING FACE WITH CLOSED EYES -1F61B ; Emoji # 6.1 [1] (😛) FACE WITH STUCK-OUT TONGUE -1F61C..1F61E ; Emoji # 6.0 [3] (😜..😞) FACE WITH STUCK-OUT TONGUE AND WINKING EYE..DISAPPOINTED FACE -1F61F ; Emoji # 6.1 [1] (😟) WORRIED FACE -1F620..1F625 ; Emoji # 6.0 [6] (😠..😥) ANGRY FACE..DISAPPOINTED BUT RELIEVED FACE -1F626..1F627 ; Emoji # 6.1 [2] (😦..😧) FROWNING FACE WITH OPEN MOUTH..ANGUISHED FACE -1F628..1F62B ; Emoji # 6.0 [4] (😨..😫) FEARFUL FACE..TIRED FACE -1F62C ; Emoji # 6.1 [1] (😬) GRIMACING FACE -1F62D ; Emoji # 6.0 [1] (😭) LOUDLY CRYING FACE -1F62E..1F62F ; Emoji # 6.1 [2] (😮..😯) FACE WITH OPEN MOUTH..HUSHED FACE -1F630..1F633 ; Emoji # 6.0 [4] (😰..😳) FACE WITH OPEN MOUTH AND COLD SWEAT..FLUSHED FACE -1F634 ; Emoji # 6.1 [1] (😴) SLEEPING FACE -1F635..1F640 ; Emoji # 6.0 [12] (😵..🙀) DIZZY FACE..WEARY CAT FACE -1F641..1F642 ; Emoji # 7.0 [2] (🙁..🙂) SLIGHTLY FROWNING FACE..SLIGHTLY SMILING FACE -1F643..1F644 ; Emoji # 8.0 [2] (🙃..🙄) UPSIDE-DOWN FACE..FACE WITH ROLLING EYES -1F645..1F64F ; Emoji # 6.0 [11] (🙅..🙏) FACE WITH NO GOOD GESTURE..PERSON WITH FOLDED HANDS -1F680..1F6C5 ; Emoji # 6.0 [70] (🚀..🛅) ROCKET..LEFT LUGGAGE -1F6CB..1F6CF ; Emoji # 7.0 [5] (🛋..🛏) COUCH AND LAMP..BED -1F6D0 ; Emoji # 8.0 [1] (🛐) PLACE OF WORSHIP -1F6D1..1F6D2 ; Emoji # 9.0 [2] (🛑..🛒) OCTAGONAL SIGN..SHOPPING TROLLEY -1F6E0..1F6E5 ; Emoji # 7.0 [6] (🛠..🛥) HAMMER AND WRENCH..MOTOR BOAT -1F6E9 ; Emoji # 7.0 [1] (🛩) SMALL AIRPLANE -1F6EB..1F6EC ; Emoji # 7.0 [2] (🛫..🛬) AIRPLANE DEPARTURE..AIRPLANE ARRIVING -1F6F0 ; Emoji # 7.0 [1] (🛰) SATELLITE -1F6F3 ; Emoji # 7.0 [1] (🛳) PASSENGER SHIP -1F6F4..1F6F6 ; Emoji # 9.0 [3] (🛴..🛶) SCOOTER..CANOE -1F910..1F918 ; Emoji # 8.0 [9] (🤐..🤘) ZIPPER-MOUTH FACE..SIGN OF THE HORNS -1F919..1F91E ; Emoji # 9.0 [6] (🤙..🤞) CALL ME HAND..HAND WITH INDEX AND MIDDLE FINGERS CROSSED -1F920..1F927 ; Emoji # 9.0 [8] (🤠..🤧) FACE WITH COWBOY HAT..SNEEZING FACE -1F930 ; Emoji # 9.0 [1] (🤰) PREGNANT WOMAN -1F933..1F93A ; Emoji # 9.0 [8] (🤳..🤺) SELFIE..FENCER -1F93C..1F93E ; Emoji # 9.0 [3] (🤼..🤾) WRESTLERS..HANDBALL -1F940..1F945 ; Emoji # 9.0 [6] (🥀..🥅) WILTED FLOWER..GOAL NET -1F947..1F94B ; Emoji # 9.0 [5] (🥇..🥋) FIRST PLACE MEDAL..MARTIAL ARTS UNIFORM -1F950..1F95E ; Emoji # 9.0 [15] (🥐..🥞) CROISSANT..PANCAKES -1F980..1F984 ; Emoji # 8.0 [5] (🦀..🦄) CRAB..UNICORN FACE -1F985..1F991 ; Emoji # 9.0 [13] (🦅..🦑) EAGLE..SQUID -1F9C0 ; Emoji # 8.0 [1] (🧀) CHEESE WEDGE +0023 ; Emoji # 1.1 [1] (#️) number sign +002A ; Emoji # 1.1 [1] (*️) asterisk +0030..0039 ; Emoji # 1.1 [10] (0️..9️) digit zero..digit nine +00A9 ; Emoji # 1.1 [1] (©️) copyright +00AE ; Emoji # 1.1 [1] (®️) registered +203C ; Emoji # 1.1 [1] (‼️) double exclamation mark +2049 ; Emoji # 3.0 [1] (⁉️) exclamation question mark +2122 ; Emoji # 1.1 [1] (™️) trade mark +2139 ; Emoji # 3.0 [1] (ℹ️) information +2194..2199 ; Emoji # 1.1 [6] (↔️..↙️) left-right arrow..down-left arrow +21A9..21AA ; Emoji # 1.1 [2] (↩️..↪️) right arrow curving left..left arrow curving right +231A..231B ; Emoji # 1.1 [2] (⌚..⌛) watch..hourglass +2328 ; Emoji # 1.1 [1] (⌨️) keyboard +23CF ; Emoji # 4.0 [1] (⏏️) eject button +23E9..23F3 ; Emoji # 6.0 [11] (⏩..⏳) fast-forward button..hourglass with flowing sand +23F8..23FA ; Emoji # 7.0 [3] (⏸️..⏺️) pause button..record button +24C2 ; Emoji # 1.1 [1] (Ⓜ️) circled M +25AA..25AB ; Emoji # 1.1 [2] (▪️..▫️) black small square..white small square +25B6 ; Emoji # 1.1 [1] (▶️) play button +25C0 ; Emoji # 1.1 [1] (◀️) reverse button +25FB..25FE ; Emoji # 3.2 [4] (◻️..◾) white medium square..black medium-small square +2600..2604 ; Emoji # 1.1 [5] (☀️..☄️) sun..comet +260E ; Emoji # 1.1 [1] (☎️) telephone +2611 ; Emoji # 1.1 [1] (☑️) ballot box with check +2614..2615 ; Emoji # 4.0 [2] (☔..☕) umbrella with rain drops..hot beverage +2618 ; Emoji # 4.1 [1] (☘️) shamrock +261D ; Emoji # 1.1 [1] (☝️) index pointing up +2620 ; Emoji # 1.1 [1] (☠️) skull and crossbones +2622..2623 ; Emoji # 1.1 [2] (☢️..☣️) radioactive..biohazard +2626 ; Emoji # 1.1 [1] (☦️) orthodox cross +262A ; Emoji # 1.1 [1] (☪️) star and crescent +262E..262F ; Emoji # 1.1 [2] (☮️..☯️) peace symbol..yin yang +2638..263A ; Emoji # 1.1 [3] (☸️..☺️) wheel of dharma..smiling face +2640 ; Emoji # 1.1 [1] (♀️) female sign +2642 ; Emoji # 1.1 [1] (♂️) male sign +2648..2653 ; Emoji # 1.1 [12] (♈..♓) Aries..Pisces +2660 ; Emoji # 1.1 [1] (♠️) spade suit +2663 ; Emoji # 1.1 [1] (♣️) club suit +2665..2666 ; Emoji # 1.1 [2] (♥️..♦️) heart suit..diamond suit +2668 ; Emoji # 1.1 [1] (♨️) hot springs +267B ; Emoji # 3.2 [1] (♻️) recycling symbol +267F ; Emoji # 4.1 [1] (♿) wheelchair symbol +2692..2697 ; Emoji # 4.1 [6] (⚒️..⚗️) hammer and pick..alembic +2699 ; Emoji # 4.1 [1] (⚙️) gear +269B..269C ; Emoji # 4.1 [2] (⚛️..⚜️) atom symbol..fleur-de-lis +26A0..26A1 ; Emoji # 4.0 [2] (⚠️..⚡) warning..high voltage +26AA..26AB ; Emoji # 4.1 [2] (⚪..⚫) white circle..black circle +26B0..26B1 ; Emoji # 4.1 [2] (⚰️..⚱️) coffin..funeral urn +26BD..26BE ; Emoji # 5.2 [2] (⚽..⚾) soccer ball..baseball +26C4..26C5 ; Emoji # 5.2 [2] (⛄..⛅) snowman without snow..sun behind cloud +26C8 ; Emoji # 5.2 [1] (⛈️) cloud with lightning and rain +26CE ; Emoji # 6.0 [1] (⛎) Ophiuchus +26CF ; Emoji # 5.2 [1] (⛏️) pick +26D1 ; Emoji # 5.2 [1] (⛑️) rescue worker’s helmet +26D3..26D4 ; Emoji # 5.2 [2] (⛓️..⛔) chains..no entry +26E9..26EA ; Emoji # 5.2 [2] (⛩️..⛪) shinto shrine..church +26F0..26F5 ; Emoji # 5.2 [6] (⛰️..⛵) mountain..sailboat +26F7..26FA ; Emoji # 5.2 [4] (⛷️..⛺) skier..tent +26FD ; Emoji # 5.2 [1] (⛽) fuel pump +2702 ; Emoji # 1.1 [1] (✂️) scissors +2705 ; Emoji # 6.0 [1] (✅) white heavy check mark +2708..2709 ; Emoji # 1.1 [2] (✈️..✉️) airplane..envelope +270A..270B ; Emoji # 6.0 [2] (✊..✋) raised fist..raised hand +270C..270D ; Emoji # 1.1 [2] (✌️..✍️) victory hand..writing hand +270F ; Emoji # 1.1 [1] (✏️) pencil +2712 ; Emoji # 1.1 [1] (✒️) black nib +2714 ; Emoji # 1.1 [1] (✔️) heavy check mark +2716 ; Emoji # 1.1 [1] (✖️) heavy multiplication x +271D ; Emoji # 1.1 [1] (✝️) latin cross +2721 ; Emoji # 1.1 [1] (✡️) star of David +2728 ; Emoji # 6.0 [1] (✨) sparkles +2733..2734 ; Emoji # 1.1 [2] (✳️..✴️) eight-spoked asterisk..eight-pointed star +2744 ; Emoji # 1.1 [1] (❄️) snowflake +2747 ; Emoji # 1.1 [1] (❇️) sparkle +274C ; Emoji # 6.0 [1] (❌) cross mark +274E ; Emoji # 6.0 [1] (❎) cross mark button +2753..2755 ; Emoji # 6.0 [3] (❓..❕) question mark..white exclamation mark +2757 ; Emoji # 5.2 [1] (❗) exclamation mark +2763..2764 ; Emoji # 1.1 [2] (❣️..❤️) heavy heart exclamation..red heart +2795..2797 ; Emoji # 6.0 [3] (➕..➗) heavy plus sign..heavy division sign +27A1 ; Emoji # 1.1 [1] (➡️) right arrow +27B0 ; Emoji # 6.0 [1] (➰) curly loop +27BF ; Emoji # 6.0 [1] (➿) double curly loop +2934..2935 ; Emoji # 3.2 [2] (⤴️..⤵️) right arrow curving up..right arrow curving down +2B05..2B07 ; Emoji # 4.0 [3] (⬅️..⬇️) left arrow..down arrow +2B1B..2B1C ; Emoji # 5.1 [2] (⬛..⬜) black large square..white large square +2B50 ; Emoji # 5.1 [1] (⭐) white medium star +2B55 ; Emoji # 5.2 [1] (⭕) heavy large circle +3030 ; Emoji # 1.1 [1] (〰️) wavy dash +303D ; Emoji # 3.2 [1] (〽️) part alternation mark +3297 ; Emoji # 1.1 [1] (㊗️) Japanese “congratulations” button +3299 ; Emoji # 1.1 [1] (㊙️) Japanese “secret” button +1F004 ; Emoji # 5.1 [1] (🀄) mahjong red dragon +1F0CF ; Emoji # 6.0 [1] (🃏) joker +1F170..1F171 ; Emoji # 6.0 [2] (🅰️..🅱️) A button (blood type)..B button (blood type) +1F17E ; Emoji # 6.0 [1] (🅾️) O button (blood type) +1F17F ; Emoji # 5.2 [1] (🅿️) P button +1F18E ; Emoji # 6.0 [1] (🆎) AB button (blood type) +1F191..1F19A ; Emoji # 6.0 [10] (🆑..🆚) CL button..VS button +1F1E6..1F1FF ; Emoji # 6.0 [26] (🇦..🇿) regional indicator symbol letter a..regional indicator symbol letter z +1F201..1F202 ; Emoji # 6.0 [2] (🈁..🈂️) Japanese “here” button..Japanese “service charge” button +1F21A ; Emoji # 5.2 [1] (🈚) Japanese “free of charge” button +1F22F ; Emoji # 5.2 [1] (🈯) Japanese “reserved” button +1F232..1F23A ; Emoji # 6.0 [9] (🈲..🈺) Japanese “prohibited” button..Japanese “open for business” button +1F250..1F251 ; Emoji # 6.0 [2] (🉐..🉑) Japanese “bargain” button..Japanese “acceptable” button +1F300..1F320 ; Emoji # 6.0 [33] (🌀..🌠) cyclone..shooting star +1F321 ; Emoji # 7.0 [1] (🌡️) thermometer +1F324..1F32C ; Emoji # 7.0 [9] (🌤️..🌬️) sun behind small cloud..wind face +1F32D..1F32F ; Emoji # 8.0 [3] (🌭..🌯) hot dog..burrito +1F330..1F335 ; Emoji # 6.0 [6] (🌰..🌵) chestnut..cactus +1F336 ; Emoji # 7.0 [1] (🌶️) hot pepper +1F337..1F37C ; Emoji # 6.0 [70] (🌷..🍼) tulip..baby bottle +1F37D ; Emoji # 7.0 [1] (🍽️) fork and knife with plate +1F37E..1F37F ; Emoji # 8.0 [2] (🍾..🍿) bottle with popping cork..popcorn +1F380..1F393 ; Emoji # 6.0 [20] (🎀..🎓) ribbon..graduation cap +1F396..1F397 ; Emoji # 7.0 [2] (🎖️..🎗️) military medal..reminder ribbon +1F399..1F39B ; Emoji # 7.0 [3] (🎙️..🎛️) studio microphone..control knobs +1F39E..1F39F ; Emoji # 7.0 [2] (🎞️..🎟️) film frames..admission tickets +1F3A0..1F3C4 ; Emoji # 6.0 [37] (🎠..🏄) carousel horse..person surfing +1F3C5 ; Emoji # 7.0 [1] (🏅) sports medal +1F3C6..1F3CA ; Emoji # 6.0 [5] (🏆..🏊) trophy..person swimming +1F3CB..1F3CE ; Emoji # 7.0 [4] (🏋️..🏎️) person lifting weights..racing car +1F3CF..1F3D3 ; Emoji # 8.0 [5] (🏏..🏓) cricket..ping pong +1F3D4..1F3DF ; Emoji # 7.0 [12] (🏔️..🏟️) snow-capped mountain..stadium +1F3E0..1F3F0 ; Emoji # 6.0 [17] (🏠..🏰) house..castle +1F3F3..1F3F5 ; Emoji # 7.0 [3] (🏳️..🏵️) white flag..rosette +1F3F7 ; Emoji # 7.0 [1] (🏷️) label +1F3F8..1F3FF ; Emoji # 8.0 [8] (🏸..🏿) badminton..dark skin tone +1F400..1F43E ; Emoji # 6.0 [63] (🐀..🐾) rat..paw prints +1F43F ; Emoji # 7.0 [1] (🐿️) chipmunk +1F440 ; Emoji # 6.0 [1] (👀) eyes +1F441 ; Emoji # 7.0 [1] (👁️) eye +1F442..1F4F7 ; Emoji # 6.0[182] (👂..📷) ear..camera +1F4F8 ; Emoji # 7.0 [1] (📸) camera with flash +1F4F9..1F4FC ; Emoji # 6.0 [4] (📹..📼) video camera..videocassette +1F4FD ; Emoji # 7.0 [1] (📽️) film projector +1F4FF ; Emoji # 8.0 [1] (📿) prayer beads +1F500..1F53D ; Emoji # 6.0 [62] (🔀..🔽) shuffle tracks button..down button +1F549..1F54A ; Emoji # 7.0 [2] (🕉️..🕊️) om..dove +1F54B..1F54E ; Emoji # 8.0 [4] (🕋..🕎) kaaba..menorah +1F550..1F567 ; Emoji # 6.0 [24] (🕐..🕧) one o’clock..twelve-thirty +1F56F..1F570 ; Emoji # 7.0 [2] (🕯️..🕰️) candle..mantelpiece clock +1F573..1F579 ; Emoji # 7.0 [7] (🕳️..🕹️) hole..joystick +1F57A ; Emoji # 9.0 [1] (🕺) man dancing +1F587 ; Emoji # 7.0 [1] (🖇️) linked paperclips +1F58A..1F58D ; Emoji # 7.0 [4] (🖊️..🖍️) pen..crayon +1F590 ; Emoji # 7.0 [1] (🖐️) raised hand with fingers splayed +1F595..1F596 ; Emoji # 7.0 [2] (🖕..🖖) middle finger..vulcan salute +1F5A4 ; Emoji # 9.0 [1] (🖤) black heart +1F5A5 ; Emoji # 7.0 [1] (🖥️) desktop computer +1F5A8 ; Emoji # 7.0 [1] (🖨️) printer +1F5B1..1F5B2 ; Emoji # 7.0 [2] (🖱️..🖲️) computer mouse..trackball +1F5BC ; Emoji # 7.0 [1] (🖼️) framed picture +1F5C2..1F5C4 ; Emoji # 7.0 [3] (🗂️..🗄️) card index dividers..file cabinet +1F5D1..1F5D3 ; Emoji # 7.0 [3] (🗑️..🗓️) wastebasket..spiral calendar +1F5DC..1F5DE ; Emoji # 7.0 [3] (🗜️..🗞️) clamp..rolled-up newspaper +1F5E1 ; Emoji # 7.0 [1] (🗡️) dagger +1F5E3 ; Emoji # 7.0 [1] (🗣️) speaking head +1F5E8 ; Emoji # 7.0 [1] (🗨️) left speech bubble +1F5EF ; Emoji # 7.0 [1] (🗯️) right anger bubble +1F5F3 ; Emoji # 7.0 [1] (🗳️) ballot box with ballot +1F5FA ; Emoji # 7.0 [1] (🗺️) world map +1F5FB..1F5FF ; Emoji # 6.0 [5] (🗻..🗿) mount fuji..moai +1F600 ; Emoji # 6.1 [1] (😀) grinning face +1F601..1F610 ; Emoji # 6.0 [16] (😁..😐) grinning face with smiling eyes..neutral face +1F611 ; Emoji # 6.1 [1] (😑) expressionless face +1F612..1F614 ; Emoji # 6.0 [3] (😒..😔) unamused face..pensive face +1F615 ; Emoji # 6.1 [1] (😕) confused face +1F616 ; Emoji # 6.0 [1] (😖) confounded face +1F617 ; Emoji # 6.1 [1] (😗) kissing face +1F618 ; Emoji # 6.0 [1] (😘) face blowing a kiss +1F619 ; Emoji # 6.1 [1] (😙) kissing face with smiling eyes +1F61A ; Emoji # 6.0 [1] (😚) kissing face with closed eyes +1F61B ; Emoji # 6.1 [1] (😛) face with stuck-out tongue +1F61C..1F61E ; Emoji # 6.0 [3] (😜..😞) face with stuck-out tongue & winking eye..disappointed face +1F61F ; Emoji # 6.1 [1] (😟) worried face +1F620..1F625 ; Emoji # 6.0 [6] (😠..😥) angry face..disappointed but relieved face +1F626..1F627 ; Emoji # 6.1 [2] (😦..😧) frowning face with open mouth..anguished face +1F628..1F62B ; Emoji # 6.0 [4] (😨..😫) fearful face..tired face +1F62C ; Emoji # 6.1 [1] (😬) grimacing face +1F62D ; Emoji # 6.0 [1] (😭) loudly crying face +1F62E..1F62F ; Emoji # 6.1 [2] (😮..😯) face with open mouth..hushed face +1F630..1F633 ; Emoji # 6.0 [4] (😰..😳) face with open mouth & cold sweat..flushed face +1F634 ; Emoji # 6.1 [1] (😴) sleeping face +1F635..1F640 ; Emoji # 6.0 [12] (😵..🙀) dizzy face..weary cat face +1F641..1F642 ; Emoji # 7.0 [2] (🙁..🙂) slightly frowning face..slightly smiling face +1F643..1F644 ; Emoji # 8.0 [2] (🙃..🙄) upside-down face..face with rolling eyes +1F645..1F64F ; Emoji # 6.0 [11] (🙅..🙏) person gesturing NO..folded hands +1F680..1F6C5 ; Emoji # 6.0 [70] (🚀..🛅) rocket..left luggage +1F6CB..1F6CF ; Emoji # 7.0 [5] (🛋️..🛏️) couch and lamp..bed +1F6D0 ; Emoji # 8.0 [1] (🛐) place of worship +1F6D1..1F6D2 ; Emoji # 9.0 [2] (🛑..🛒) stop sign..shopping cart +1F6E0..1F6E5 ; Emoji # 7.0 [6] (🛠️..🛥️) hammer and wrench..motor boat +1F6E9 ; Emoji # 7.0 [1] (🛩️) small airplane +1F6EB..1F6EC ; Emoji # 7.0 [2] (🛫..🛬) airplane departure..airplane arrival +1F6F0 ; Emoji # 7.0 [1] (🛰️) satellite +1F6F3 ; Emoji # 7.0 [1] (🛳️) passenger ship +1F6F4..1F6F6 ; Emoji # 9.0 [3] (🛴..🛶) kick scooter..canoe +1F6F7..1F6F8 ; Emoji # 10.0 [2] (🛷..🛸) sled..flying saucer +1F910..1F918 ; Emoji # 8.0 [9] (🤐..🤘) zipper-mouth face..sign of the horns +1F919..1F91E ; Emoji # 9.0 [6] (🤙..🤞) call me hand..crossed fingers +1F91F ; Emoji # 10.0 [1] (🤟) love-you gesture +1F920..1F927 ; Emoji # 9.0 [8] (🤠..🤧) cowboy hat face..sneezing face +1F928..1F92F ; Emoji # 10.0 [8] (🤨..🤯) face with raised eyebrow..exploding head +1F930 ; Emoji # 9.0 [1] (🤰) pregnant woman +1F931..1F932 ; Emoji # 10.0 [2] (🤱..🤲) breast-feeding..palms up together +1F933..1F93A ; Emoji # 9.0 [8] (🤳..🤺) selfie..person fencing +1F93C..1F93E ; Emoji # 9.0 [3] (🤼..🤾) people wrestling..person playing handball +1F940..1F945 ; Emoji # 9.0 [6] (🥀..🥅) wilted flower..goal net +1F947..1F94B ; Emoji # 9.0 [5] (🥇..🥋) 1st place medal..martial arts uniform +1F94C ; Emoji # 10.0 [1] (🥌) curling stone +1F950..1F95E ; Emoji # 9.0 [15] (🥐..🥞) croissant..pancakes +1F95F..1F96B ; Emoji # 10.0 [13] (🥟..🥫) dumpling..canned food +1F980..1F984 ; Emoji # 8.0 [5] (🦀..🦄) crab..unicorn face +1F985..1F991 ; Emoji # 9.0 [13] (🦅..🦑) eagle..squid +1F992..1F997 ; Emoji # 10.0 [6] (🦒..🦗) giraffe..cricket +1F9C0 ; Emoji # 8.0 [1] (🧀) cheese wedge +1F9D0..1F9E6 ; Emoji # 10.0 [23] (🧐..🧦) face with monocle..socks -# Total elements: 1123 +# Total elements: 1182 # ================================================ # All omitted code points have Emoji_Presentation=No # @missing: 0000..10FFFF ; Emoji_Presentation ; No -231A..231B ; Emoji_Presentation # 1.1 [2] (⌚..⌛) WATCH..HOURGLASS -23E9..23EC ; Emoji_Presentation # 6.0 [4] (⏩..⏬) BLACK RIGHT-POINTING DOUBLE TRIANGLE..BLACK DOWN-POINTING DOUBLE TRIANGLE -23F0 ; Emoji_Presentation # 6.0 [1] (⏰) ALARM CLOCK -23F3 ; Emoji_Presentation # 6.0 [1] (⏳) HOURGLASS WITH FLOWING SAND -25FD..25FE ; Emoji_Presentation # 3.2 [2] (◽..◾) WHITE MEDIUM SMALL SQUARE..BLACK MEDIUM SMALL SQUARE -2614..2615 ; Emoji_Presentation # 4.0 [2] (☔..☕) UMBRELLA WITH RAIN DROPS..HOT BEVERAGE -2648..2653 ; Emoji_Presentation # 1.1 [12] (♈..♓) ARIES..PISCES -267F ; Emoji_Presentation # 4.1 [1] (♿) WHEELCHAIR SYMBOL -2693 ; Emoji_Presentation # 4.1 [1] (⚓) ANCHOR -26A1 ; Emoji_Presentation # 4.0 [1] (⚡) HIGH VOLTAGE SIGN -26AA..26AB ; Emoji_Presentation # 4.1 [2] (⚪..⚫) MEDIUM WHITE CIRCLE..MEDIUM BLACK CIRCLE -26BD..26BE ; Emoji_Presentation # 5.2 [2] (⚽..⚾) SOCCER BALL..BASEBALL -26C4..26C5 ; Emoji_Presentation # 5.2 [2] (⛄..⛅) SNOWMAN WITHOUT SNOW..SUN BEHIND CLOUD -26CE ; Emoji_Presentation # 6.0 [1] (⛎) OPHIUCHUS -26D4 ; Emoji_Presentation # 5.2 [1] (⛔) NO ENTRY -26EA ; Emoji_Presentation # 5.2 [1] (⛪) CHURCH -26F2..26F3 ; Emoji_Presentation # 5.2 [2] (⛲..⛳) FOUNTAIN..FLAG IN HOLE -26F5 ; Emoji_Presentation # 5.2 [1] (⛵) SAILBOAT -26FA ; Emoji_Presentation # 5.2 [1] (⛺) TENT -26FD ; Emoji_Presentation # 5.2 [1] (⛽) FUEL PUMP -2705 ; Emoji_Presentation # 6.0 [1] (✅) WHITE HEAVY CHECK MARK -270A..270B ; Emoji_Presentation # 6.0 [2] (✊..✋) RAISED FIST..RAISED HAND -2728 ; Emoji_Presentation # 6.0 [1] (✨) SPARKLES -274C ; Emoji_Presentation # 6.0 [1] (❌) CROSS MARK -274E ; Emoji_Presentation # 6.0 [1] (❎) NEGATIVE SQUARED CROSS MARK -2753..2755 ; Emoji_Presentation # 6.0 [3] (❓..❕) BLACK QUESTION MARK ORNAMENT..WHITE EXCLAMATION MARK ORNAMENT -2757 ; Emoji_Presentation # 5.2 [1] (❗) HEAVY EXCLAMATION MARK SYMBOL -2795..2797 ; Emoji_Presentation # 6.0 [3] (➕..➗) HEAVY PLUS SIGN..HEAVY DIVISION SIGN -27B0 ; Emoji_Presentation # 6.0 [1] (➰) CURLY LOOP -27BF ; Emoji_Presentation # 6.0 [1] (➿) DOUBLE CURLY LOOP -2B1B..2B1C ; Emoji_Presentation # 5.1 [2] (⬛..⬜) BLACK LARGE SQUARE..WHITE LARGE SQUARE -2B50 ; Emoji_Presentation # 5.1 [1] (⭐) WHITE MEDIUM STAR -2B55 ; Emoji_Presentation # 5.2 [1] (⭕) HEAVY LARGE CIRCLE -1F004 ; Emoji_Presentation # 5.1 [1] (🀄) MAHJONG TILE RED DRAGON -1F0CF ; Emoji_Presentation # 6.0 [1] (🃏) PLAYING CARD BLACK JOKER -1F18E ; Emoji_Presentation # 6.0 [1] (🆎) NEGATIVE SQUARED AB -1F191..1F19A ; Emoji_Presentation # 6.0 [10] (🆑..🆚) SQUARED CL..SQUARED VS -1F1E6..1F1FF ; Emoji_Presentation # 6.0 [26] (🇦..🇿) REGIONAL INDICATOR SYMBOL LETTER A..REGIONAL INDICATOR SYMBOL LETTER Z -1F201 ; Emoji_Presentation # 6.0 [1] (🈁) SQUARED KATAKANA KOKO -1F21A ; Emoji_Presentation # 5.2 [1] (🈚) SQUARED CJK UNIFIED IDEOGRAPH-7121 -1F22F ; Emoji_Presentation # 5.2 [1] (🈯) SQUARED CJK UNIFIED IDEOGRAPH-6307 -1F232..1F236 ; Emoji_Presentation # 6.0 [5] (🈲..🈶) SQUARED CJK UNIFIED IDEOGRAPH-7981..SQUARED CJK UNIFIED IDEOGRAPH-6709 -1F238..1F23A ; Emoji_Presentation # 6.0 [3] (🈸..🈺) SQUARED CJK UNIFIED IDEOGRAPH-7533..SQUARED CJK UNIFIED IDEOGRAPH-55B6 -1F250..1F251 ; Emoji_Presentation # 6.0 [2] (🉐..🉑) CIRCLED IDEOGRAPH ADVANTAGE..CIRCLED IDEOGRAPH ACCEPT -1F300..1F320 ; Emoji_Presentation # 6.0 [33] (🌀..🌠) CYCLONE..SHOOTING STAR -1F32D..1F32F ; Emoji_Presentation # 8.0 [3] (🌭..🌯) HOT DOG..BURRITO -1F330..1F335 ; Emoji_Presentation # 6.0 [6] (🌰..🌵) CHESTNUT..CACTUS -1F337..1F37C ; Emoji_Presentation # 6.0 [70] (🌷..🍼) TULIP..BABY BOTTLE -1F37E..1F37F ; Emoji_Presentation # 8.0 [2] (🍾..🍿) BOTTLE WITH POPPING CORK..POPCORN -1F380..1F393 ; Emoji_Presentation # 6.0 [20] (🎀..🎓) RIBBON..GRADUATION CAP -1F3A0..1F3C4 ; Emoji_Presentation # 6.0 [37] (🎠..🏄) CAROUSEL HORSE..SURFER -1F3C5 ; Emoji_Presentation # 7.0 [1] (🏅) SPORTS MEDAL -1F3C6..1F3CA ; Emoji_Presentation # 6.0 [5] (🏆..🏊) TROPHY..SWIMMER -1F3CF..1F3D3 ; Emoji_Presentation # 8.0 [5] (🏏..🏓) CRICKET BAT AND BALL..TABLE TENNIS PADDLE AND BALL -1F3E0..1F3F0 ; Emoji_Presentation # 6.0 [17] (🏠..🏰) HOUSE BUILDING..EUROPEAN CASTLE -1F3F4 ; Emoji_Presentation # 7.0 [1] (🏴) WAVING BLACK FLAG -1F3F8..1F3FF ; Emoji_Presentation # 8.0 [8] (🏸..🏿) BADMINTON RACQUET AND SHUTTLECOCK..EMOJI MODIFIER FITZPATRICK TYPE-6 -1F400..1F43E ; Emoji_Presentation # 6.0 [63] (🐀..🐾) RAT..PAW PRINTS -1F440 ; Emoji_Presentation # 6.0 [1] (👀) EYES -1F442..1F4F7 ; Emoji_Presentation # 6.0[182] (👂..📷) EAR..CAMERA -1F4F8 ; Emoji_Presentation # 7.0 [1] (📸) CAMERA WITH FLASH -1F4F9..1F4FC ; Emoji_Presentation # 6.0 [4] (📹..📼) VIDEO CAMERA..VIDEOCASSETTE -1F4FF ; Emoji_Presentation # 8.0 [1] (📿) PRAYER BEADS -1F500..1F53D ; Emoji_Presentation # 6.0 [62] (🔀..🔽) TWISTED RIGHTWARDS ARROWS..DOWN-POINTING SMALL RED TRIANGLE -1F54B..1F54E ; Emoji_Presentation # 8.0 [4] (🕋..🕎) KAABA..MENORAH WITH NINE BRANCHES -1F550..1F567 ; Emoji_Presentation # 6.0 [24] (🕐..🕧) CLOCK FACE ONE OCLOCK..CLOCK FACE TWELVE-THIRTY -1F57A ; Emoji_Presentation # 9.0 [1] (🕺) MAN DANCING -1F595..1F596 ; Emoji_Presentation # 7.0 [2] (🖕..🖖) REVERSED HAND WITH MIDDLE FINGER EXTENDED..RAISED HAND WITH PART BETWEEN MIDDLE AND RING FINGERS -1F5A4 ; Emoji_Presentation # 9.0 [1] (🖤) BLACK HEART -1F5FB..1F5FF ; Emoji_Presentation # 6.0 [5] (🗻..🗿) MOUNT FUJI..MOYAI -1F600 ; Emoji_Presentation # 6.1 [1] (😀) GRINNING FACE -1F601..1F610 ; Emoji_Presentation # 6.0 [16] (😁..😐) GRINNING FACE WITH SMILING EYES..NEUTRAL FACE -1F611 ; Emoji_Presentation # 6.1 [1] (😑) EXPRESSIONLESS FACE -1F612..1F614 ; Emoji_Presentation # 6.0 [3] (😒..😔) UNAMUSED FACE..PENSIVE FACE -1F615 ; Emoji_Presentation # 6.1 [1] (😕) CONFUSED FACE -1F616 ; Emoji_Presentation # 6.0 [1] (😖) CONFOUNDED FACE -1F617 ; Emoji_Presentation # 6.1 [1] (😗) KISSING FACE -1F618 ; Emoji_Presentation # 6.0 [1] (😘) FACE THROWING A KISS -1F619 ; Emoji_Presentation # 6.1 [1] (😙) KISSING FACE WITH SMILING EYES -1F61A ; Emoji_Presentation # 6.0 [1] (😚) KISSING FACE WITH CLOSED EYES -1F61B ; Emoji_Presentation # 6.1 [1] (😛) FACE WITH STUCK-OUT TONGUE -1F61C..1F61E ; Emoji_Presentation # 6.0 [3] (😜..😞) FACE WITH STUCK-OUT TONGUE AND WINKING EYE..DISAPPOINTED FACE -1F61F ; Emoji_Presentation # 6.1 [1] (😟) WORRIED FACE -1F620..1F625 ; Emoji_Presentation # 6.0 [6] (😠..😥) ANGRY FACE..DISAPPOINTED BUT RELIEVED FACE -1F626..1F627 ; Emoji_Presentation # 6.1 [2] (😦..😧) FROWNING FACE WITH OPEN MOUTH..ANGUISHED FACE -1F628..1F62B ; Emoji_Presentation # 6.0 [4] (😨..😫) FEARFUL FACE..TIRED FACE -1F62C ; Emoji_Presentation # 6.1 [1] (😬) GRIMACING FACE -1F62D ; Emoji_Presentation # 6.0 [1] (😭) LOUDLY CRYING FACE -1F62E..1F62F ; Emoji_Presentation # 6.1 [2] (😮..😯) FACE WITH OPEN MOUTH..HUSHED FACE -1F630..1F633 ; Emoji_Presentation # 6.0 [4] (😰..😳) FACE WITH OPEN MOUTH AND COLD SWEAT..FLUSHED FACE -1F634 ; Emoji_Presentation # 6.1 [1] (😴) SLEEPING FACE -1F635..1F640 ; Emoji_Presentation # 6.0 [12] (😵..🙀) DIZZY FACE..WEARY CAT FACE -1F641..1F642 ; Emoji_Presentation # 7.0 [2] (🙁..🙂) SLIGHTLY FROWNING FACE..SLIGHTLY SMILING FACE -1F643..1F644 ; Emoji_Presentation # 8.0 [2] (🙃..🙄) UPSIDE-DOWN FACE..FACE WITH ROLLING EYES -1F645..1F64F ; Emoji_Presentation # 6.0 [11] (🙅..🙏) FACE WITH NO GOOD GESTURE..PERSON WITH FOLDED HANDS -1F680..1F6C5 ; Emoji_Presentation # 6.0 [70] (🚀..🛅) ROCKET..LEFT LUGGAGE -1F6CC ; Emoji_Presentation # 7.0 [1] (🛌) SLEEPING ACCOMMODATION -1F6D0 ; Emoji_Presentation # 8.0 [1] (🛐) PLACE OF WORSHIP -1F6D1..1F6D2 ; Emoji_Presentation # 9.0 [2] (🛑..🛒) OCTAGONAL SIGN..SHOPPING TROLLEY -1F6EB..1F6EC ; Emoji_Presentation # 7.0 [2] (🛫..🛬) AIRPLANE DEPARTURE..AIRPLANE ARRIVING -1F6F4..1F6F6 ; Emoji_Presentation # 9.0 [3] (🛴..🛶) SCOOTER..CANOE -1F910..1F918 ; Emoji_Presentation # 8.0 [9] (🤐..🤘) ZIPPER-MOUTH FACE..SIGN OF THE HORNS -1F919..1F91E ; Emoji_Presentation # 9.0 [6] (🤙..🤞) CALL ME HAND..HAND WITH INDEX AND MIDDLE FINGERS CROSSED -1F920..1F927 ; Emoji_Presentation # 9.0 [8] (🤠..🤧) FACE WITH COWBOY HAT..SNEEZING FACE -1F930 ; Emoji_Presentation # 9.0 [1] (🤰) PREGNANT WOMAN -1F933..1F93A ; Emoji_Presentation # 9.0 [8] (🤳..🤺) SELFIE..FENCER -1F93C..1F93E ; Emoji_Presentation # 9.0 [3] (🤼..🤾) WRESTLERS..HANDBALL -1F940..1F945 ; Emoji_Presentation # 9.0 [6] (🥀..🥅) WILTED FLOWER..GOAL NET -1F947..1F94B ; Emoji_Presentation # 9.0 [5] (🥇..🥋) FIRST PLACE MEDAL..MARTIAL ARTS UNIFORM -1F950..1F95E ; Emoji_Presentation # 9.0 [15] (🥐..🥞) CROISSANT..PANCAKES -1F980..1F984 ; Emoji_Presentation # 8.0 [5] (🦀..🦄) CRAB..UNICORN FACE -1F985..1F991 ; Emoji_Presentation # 9.0 [13] (🦅..🦑) EAGLE..SQUID -1F9C0 ; Emoji_Presentation # 8.0 [1] (🧀) CHEESE WEDGE +231A..231B ; Emoji_Presentation # 1.1 [2] (⌚..⌛) watch..hourglass +23E9..23EC ; Emoji_Presentation # 6.0 [4] (⏩..⏬) fast-forward button..fast down button +23F0 ; Emoji_Presentation # 6.0 [1] (⏰) alarm clock +23F3 ; Emoji_Presentation # 6.0 [1] (⏳) hourglass with flowing sand +25FD..25FE ; Emoji_Presentation # 3.2 [2] (◽..◾) white medium-small square..black medium-small square +2614..2615 ; Emoji_Presentation # 4.0 [2] (☔..☕) umbrella with rain drops..hot beverage +2648..2653 ; Emoji_Presentation # 1.1 [12] (♈..♓) Aries..Pisces +267F ; Emoji_Presentation # 4.1 [1] (♿) wheelchair symbol +2693 ; Emoji_Presentation # 4.1 [1] (⚓) anchor +26A1 ; Emoji_Presentation # 4.0 [1] (⚡) high voltage +26AA..26AB ; Emoji_Presentation # 4.1 [2] (⚪..⚫) white circle..black circle +26BD..26BE ; Emoji_Presentation # 5.2 [2] (⚽..⚾) soccer ball..baseball +26C4..26C5 ; Emoji_Presentation # 5.2 [2] (⛄..⛅) snowman without snow..sun behind cloud +26CE ; Emoji_Presentation # 6.0 [1] (⛎) Ophiuchus +26D4 ; Emoji_Presentation # 5.2 [1] (⛔) no entry +26EA ; Emoji_Presentation # 5.2 [1] (⛪) church +26F2..26F3 ; Emoji_Presentation # 5.2 [2] (⛲..⛳) fountain..flag in hole +26F5 ; Emoji_Presentation # 5.2 [1] (⛵) sailboat +26FA ; Emoji_Presentation # 5.2 [1] (⛺) tent +26FD ; Emoji_Presentation # 5.2 [1] (⛽) fuel pump +2705 ; Emoji_Presentation # 6.0 [1] (✅) white heavy check mark +270A..270B ; Emoji_Presentation # 6.0 [2] (✊..✋) raised fist..raised hand +2728 ; Emoji_Presentation # 6.0 [1] (✨) sparkles +274C ; Emoji_Presentation # 6.0 [1] (❌) cross mark +274E ; Emoji_Presentation # 6.0 [1] (❎) cross mark button +2753..2755 ; Emoji_Presentation # 6.0 [3] (❓..❕) question mark..white exclamation mark +2757 ; Emoji_Presentation # 5.2 [1] (❗) exclamation mark +2795..2797 ; Emoji_Presentation # 6.0 [3] (➕..➗) heavy plus sign..heavy division sign +27B0 ; Emoji_Presentation # 6.0 [1] (➰) curly loop +27BF ; Emoji_Presentation # 6.0 [1] (➿) double curly loop +2B1B..2B1C ; Emoji_Presentation # 5.1 [2] (⬛..⬜) black large square..white large square +2B50 ; Emoji_Presentation # 5.1 [1] (⭐) white medium star +2B55 ; Emoji_Presentation # 5.2 [1] (⭕) heavy large circle +1F004 ; Emoji_Presentation # 5.1 [1] (🀄) mahjong red dragon +1F0CF ; Emoji_Presentation # 6.0 [1] (🃏) joker +1F18E ; Emoji_Presentation # 6.0 [1] (🆎) AB button (blood type) +1F191..1F19A ; Emoji_Presentation # 6.0 [10] (🆑..🆚) CL button..VS button +1F1E6..1F1FF ; Emoji_Presentation # 6.0 [26] (🇦..🇿) regional indicator symbol letter a..regional indicator symbol letter z +1F201 ; Emoji_Presentation # 6.0 [1] (🈁) Japanese “here” button +1F21A ; Emoji_Presentation # 5.2 [1] (🈚) Japanese “free of charge” button +1F22F ; Emoji_Presentation # 5.2 [1] (🈯) Japanese “reserved” button +1F232..1F236 ; Emoji_Presentation # 6.0 [5] (🈲..🈶) Japanese “prohibited” button..Japanese “not free of charge” button +1F238..1F23A ; Emoji_Presentation # 6.0 [3] (🈸..🈺) Japanese “application” button..Japanese “open for business” button +1F250..1F251 ; Emoji_Presentation # 6.0 [2] (🉐..🉑) Japanese “bargain” button..Japanese “acceptable” button +1F300..1F320 ; Emoji_Presentation # 6.0 [33] (🌀..🌠) cyclone..shooting star +1F32D..1F32F ; Emoji_Presentation # 8.0 [3] (🌭..🌯) hot dog..burrito +1F330..1F335 ; Emoji_Presentation # 6.0 [6] (🌰..🌵) chestnut..cactus +1F337..1F37C ; Emoji_Presentation # 6.0 [70] (🌷..🍼) tulip..baby bottle +1F37E..1F37F ; Emoji_Presentation # 8.0 [2] (🍾..🍿) bottle with popping cork..popcorn +1F380..1F393 ; Emoji_Presentation # 6.0 [20] (🎀..🎓) ribbon..graduation cap +1F3A0..1F3C4 ; Emoji_Presentation # 6.0 [37] (🎠..🏄) carousel horse..person surfing +1F3C5 ; Emoji_Presentation # 7.0 [1] (🏅) sports medal +1F3C6..1F3CA ; Emoji_Presentation # 6.0 [5] (🏆..🏊) trophy..person swimming +1F3CF..1F3D3 ; Emoji_Presentation # 8.0 [5] (🏏..🏓) cricket..ping pong +1F3E0..1F3F0 ; Emoji_Presentation # 6.0 [17] (🏠..🏰) house..castle +1F3F4 ; Emoji_Presentation # 7.0 [1] (🏴) black flag +1F3F8..1F3FF ; Emoji_Presentation # 8.0 [8] (🏸..🏿) badminton..dark skin tone +1F400..1F43E ; Emoji_Presentation # 6.0 [63] (🐀..🐾) rat..paw prints +1F440 ; Emoji_Presentation # 6.0 [1] (👀) eyes +1F442..1F4F7 ; Emoji_Presentation # 6.0[182] (👂..📷) ear..camera +1F4F8 ; Emoji_Presentation # 7.0 [1] (📸) camera with flash +1F4F9..1F4FC ; Emoji_Presentation # 6.0 [4] (📹..📼) video camera..videocassette +1F4FF ; Emoji_Presentation # 8.0 [1] (📿) prayer beads +1F500..1F53D ; Emoji_Presentation # 6.0 [62] (🔀..🔽) shuffle tracks button..down button +1F54B..1F54E ; Emoji_Presentation # 8.0 [4] (🕋..🕎) kaaba..menorah +1F550..1F567 ; Emoji_Presentation # 6.0 [24] (🕐..🕧) one o’clock..twelve-thirty +1F57A ; Emoji_Presentation # 9.0 [1] (🕺) man dancing +1F595..1F596 ; Emoji_Presentation # 7.0 [2] (🖕..🖖) middle finger..vulcan salute +1F5A4 ; Emoji_Presentation # 9.0 [1] (🖤) black heart +1F5FB..1F5FF ; Emoji_Presentation # 6.0 [5] (🗻..🗿) mount fuji..moai +1F600 ; Emoji_Presentation # 6.1 [1] (😀) grinning face +1F601..1F610 ; Emoji_Presentation # 6.0 [16] (😁..😐) grinning face with smiling eyes..neutral face +1F611 ; Emoji_Presentation # 6.1 [1] (😑) expressionless face +1F612..1F614 ; Emoji_Presentation # 6.0 [3] (😒..😔) unamused face..pensive face +1F615 ; Emoji_Presentation # 6.1 [1] (😕) confused face +1F616 ; Emoji_Presentation # 6.0 [1] (😖) confounded face +1F617 ; Emoji_Presentation # 6.1 [1] (😗) kissing face +1F618 ; Emoji_Presentation # 6.0 [1] (😘) face blowing a kiss +1F619 ; Emoji_Presentation # 6.1 [1] (😙) kissing face with smiling eyes +1F61A ; Emoji_Presentation # 6.0 [1] (😚) kissing face with closed eyes +1F61B ; Emoji_Presentation # 6.1 [1] (😛) face with stuck-out tongue +1F61C..1F61E ; Emoji_Presentation # 6.0 [3] (😜..😞) face with stuck-out tongue & winking eye..disappointed face +1F61F ; Emoji_Presentation # 6.1 [1] (😟) worried face +1F620..1F625 ; Emoji_Presentation # 6.0 [6] (😠..😥) angry face..disappointed but relieved face +1F626..1F627 ; Emoji_Presentation # 6.1 [2] (😦..😧) frowning face with open mouth..anguished face +1F628..1F62B ; Emoji_Presentation # 6.0 [4] (😨..😫) fearful face..tired face +1F62C ; Emoji_Presentation # 6.1 [1] (😬) grimacing face +1F62D ; Emoji_Presentation # 6.0 [1] (😭) loudly crying face +1F62E..1F62F ; Emoji_Presentation # 6.1 [2] (😮..😯) face with open mouth..hushed face +1F630..1F633 ; Emoji_Presentation # 6.0 [4] (😰..😳) face with open mouth & cold sweat..flushed face +1F634 ; Emoji_Presentation # 6.1 [1] (😴) sleeping face +1F635..1F640 ; Emoji_Presentation # 6.0 [12] (😵..🙀) dizzy face..weary cat face +1F641..1F642 ; Emoji_Presentation # 7.0 [2] (🙁..🙂) slightly frowning face..slightly smiling face +1F643..1F644 ; Emoji_Presentation # 8.0 [2] (🙃..🙄) upside-down face..face with rolling eyes +1F645..1F64F ; Emoji_Presentation # 6.0 [11] (🙅..🙏) person gesturing NO..folded hands +1F680..1F6C5 ; Emoji_Presentation # 6.0 [70] (🚀..🛅) rocket..left luggage +1F6CC ; Emoji_Presentation # 7.0 [1] (🛌) person in bed +1F6D0 ; Emoji_Presentation # 8.0 [1] (🛐) place of worship +1F6D1..1F6D2 ; Emoji_Presentation # 9.0 [2] (🛑..🛒) stop sign..shopping cart +1F6EB..1F6EC ; Emoji_Presentation # 7.0 [2] (🛫..🛬) airplane departure..airplane arrival +1F6F4..1F6F6 ; Emoji_Presentation # 9.0 [3] (🛴..🛶) kick scooter..canoe +1F6F7..1F6F8 ; Emoji_Presentation # 10.0 [2] (🛷..🛸) sled..flying saucer +1F910..1F918 ; Emoji_Presentation # 8.0 [9] (🤐..🤘) zipper-mouth face..sign of the horns +1F919..1F91E ; Emoji_Presentation # 9.0 [6] (🤙..🤞) call me hand..crossed fingers +1F91F ; Emoji_Presentation # 10.0 [1] (🤟) love-you gesture +1F920..1F927 ; Emoji_Presentation # 9.0 [8] (🤠..🤧) cowboy hat face..sneezing face +1F928..1F92F ; Emoji_Presentation # 10.0 [8] (🤨..🤯) face with raised eyebrow..exploding head +1F930 ; Emoji_Presentation # 9.0 [1] (🤰) pregnant woman +1F931..1F932 ; Emoji_Presentation # 10.0 [2] (🤱..🤲) breast-feeding..palms up together +1F933..1F93A ; Emoji_Presentation # 9.0 [8] (🤳..🤺) selfie..person fencing +1F93C..1F93E ; Emoji_Presentation # 9.0 [3] (🤼..🤾) people wrestling..person playing handball +1F940..1F945 ; Emoji_Presentation # 9.0 [6] (🥀..🥅) wilted flower..goal net +1F947..1F94B ; Emoji_Presentation # 9.0 [5] (🥇..🥋) 1st place medal..martial arts uniform +1F94C ; Emoji_Presentation # 10.0 [1] (🥌) curling stone +1F950..1F95E ; Emoji_Presentation # 9.0 [15] (🥐..🥞) croissant..pancakes +1F95F..1F96B ; Emoji_Presentation # 10.0 [13] (🥟..🥫) dumpling..canned food +1F980..1F984 ; Emoji_Presentation # 8.0 [5] (🦀..🦄) crab..unicorn face +1F985..1F991 ; Emoji_Presentation # 9.0 [13] (🦅..🦑) eagle..squid +1F992..1F997 ; Emoji_Presentation # 10.0 [6] (🦒..🦗) giraffe..cricket +1F9C0 ; Emoji_Presentation # 8.0 [1] (🧀) cheese wedge +1F9D0..1F9E6 ; Emoji_Presentation # 10.0 [23] (🧐..🧦) face with monocle..socks -# Total elements: 910 +# Total elements: 966 # ================================================ # All omitted code points have Emoji_Modifier=No # @missing: 0000..10FFFF ; Emoji_Modifier ; No -1F3FB..1F3FF ; Emoji_Modifier # 8.0 [5] (🏻..🏿) EMOJI MODIFIER FITZPATRICK TYPE-1-2..EMOJI MODIFIER FITZPATRICK TYPE-6 +1F3FB..1F3FF ; Emoji_Modifier # 8.0 [5] (🏻..🏿) light skin tone..dark skin tone # Total elements: 5 @@ -365,39 +386,58 @@ # All omitted code points have Emoji_Modifier_Base=No # @missing: 0000..10FFFF ; Emoji_Modifier_Base ; No -261D ; Emoji_Modifier_Base # 1.1 [1] (☝) WHITE UP POINTING INDEX -26F9 ; Emoji_Modifier_Base # 5.2 [1] (⛹) PERSON WITH BALL -270A..270B ; Emoji_Modifier_Base # 6.0 [2] (✊..✋) RAISED FIST..RAISED HAND -270C..270D ; Emoji_Modifier_Base # 1.1 [2] (✌..✍) VICTORY HAND..WRITING HAND -1F385 ; Emoji_Modifier_Base # 6.0 [1] (🎅) FATHER CHRISTMAS -1F3C3..1F3C4 ; Emoji_Modifier_Base # 6.0 [2] (🏃..🏄) RUNNER..SURFER -1F3CA ; Emoji_Modifier_Base # 6.0 [1] (🏊) SWIMMER -1F3CB ; Emoji_Modifier_Base # 7.0 [1] (🏋) WEIGHT LIFTER -1F442..1F443 ; Emoji_Modifier_Base # 6.0 [2] (👂..👃) EAR..NOSE -1F446..1F450 ; Emoji_Modifier_Base # 6.0 [11] (👆..👐) WHITE UP POINTING BACKHAND INDEX..OPEN HANDS SIGN -1F466..1F469 ; Emoji_Modifier_Base # 6.0 [4] (👦..👩) BOY..WOMAN -1F46E ; Emoji_Modifier_Base # 6.0 [1] (👮) POLICE OFFICER -1F470..1F478 ; Emoji_Modifier_Base # 6.0 [9] (👰..👸) BRIDE WITH VEIL..PRINCESS -1F47C ; Emoji_Modifier_Base # 6.0 [1] (👼) BABY ANGEL -1F481..1F483 ; Emoji_Modifier_Base # 6.0 [3] (💁..💃) INFORMATION DESK PERSON..DANCER -1F485..1F487 ; Emoji_Modifier_Base # 6.0 [3] (💅..💇) NAIL POLISH..HAIRCUT -1F4AA ; Emoji_Modifier_Base # 6.0 [1] (💪) FLEXED BICEPS -1F575 ; Emoji_Modifier_Base # 7.0 [1] (🕵) SLEUTH OR SPY -1F57A ; Emoji_Modifier_Base # 9.0 [1] (🕺) MAN DANCING -1F590 ; Emoji_Modifier_Base # 7.0 [1] (🖐) RAISED HAND WITH FINGERS SPLAYED -1F595..1F596 ; Emoji_Modifier_Base # 7.0 [2] (🖕..🖖) REVERSED HAND WITH MIDDLE FINGER EXTENDED..RAISED HAND WITH PART BETWEEN MIDDLE AND RING FINGERS -1F645..1F647 ; Emoji_Modifier_Base # 6.0 [3] (🙅..🙇) FACE WITH NO GOOD GESTURE..PERSON BOWING DEEPLY -1F64B..1F64F ; Emoji_Modifier_Base # 6.0 [5] (🙋..🙏) HAPPY PERSON RAISING ONE HAND..PERSON WITH FOLDED HANDS -1F6A3 ; Emoji_Modifier_Base # 6.0 [1] (🚣) ROWBOAT -1F6B4..1F6B6 ; Emoji_Modifier_Base # 6.0 [3] (🚴..🚶) BICYCLIST..PEDESTRIAN -1F6C0 ; Emoji_Modifier_Base # 6.0 [1] (🛀) BATH -1F918 ; Emoji_Modifier_Base # 8.0 [1] (🤘) SIGN OF THE HORNS -1F919..1F91E ; Emoji_Modifier_Base # 9.0 [6] (🤙..🤞) CALL ME HAND..HAND WITH INDEX AND MIDDLE FINGERS CROSSED -1F926 ; Emoji_Modifier_Base # 9.0 [1] (🤦) FACE PALM -1F930 ; Emoji_Modifier_Base # 9.0 [1] (🤰) PREGNANT WOMAN -1F933..1F939 ; Emoji_Modifier_Base # 9.0 [7] (🤳..🤹) SELFIE..JUGGLING -1F93C..1F93E ; Emoji_Modifier_Base # 9.0 [3] (🤼..🤾) WRESTLERS..HANDBALL +261D ; Emoji_Modifier_Base # 1.1 [1] (☝️) index pointing up +26F9 ; Emoji_Modifier_Base # 5.2 [1] (⛹️) person bouncing ball +270A..270B ; Emoji_Modifier_Base # 6.0 [2] (✊..✋) raised fist..raised hand +270C..270D ; Emoji_Modifier_Base # 1.1 [2] (✌️..✍️) victory hand..writing hand +1F385 ; Emoji_Modifier_Base # 6.0 [1] (🎅) Santa Claus +1F3C2..1F3C4 ; Emoji_Modifier_Base # 6.0 [3] (🏂..🏄) snowboarder..person surfing +1F3C7 ; Emoji_Modifier_Base # 6.0 [1] (🏇) horse racing +1F3CA ; Emoji_Modifier_Base # 6.0 [1] (🏊) person swimming +1F3CB..1F3CC ; Emoji_Modifier_Base # 7.0 [2] (🏋️..🏌️) person lifting weights..person golfing +1F442..1F443 ; Emoji_Modifier_Base # 6.0 [2] (👂..👃) ear..nose +1F446..1F450 ; Emoji_Modifier_Base # 6.0 [11] (👆..👐) backhand index pointing up..open hands +1F466..1F469 ; Emoji_Modifier_Base # 6.0 [4] (👦..👩) boy..woman +1F46E ; Emoji_Modifier_Base # 6.0 [1] (👮) police officer +1F470..1F478 ; Emoji_Modifier_Base # 6.0 [9] (👰..👸) bride with veil..princess +1F47C ; Emoji_Modifier_Base # 6.0 [1] (👼) baby angel +1F481..1F483 ; Emoji_Modifier_Base # 6.0 [3] (💁..💃) person tipping hand..woman dancing +1F485..1F487 ; Emoji_Modifier_Base # 6.0 [3] (💅..💇) nail polish..person getting haircut +1F4AA ; Emoji_Modifier_Base # 6.0 [1] (💪) flexed biceps +1F574..1F575 ; Emoji_Modifier_Base # 7.0 [2] (🕴️..🕵️) man in business suit levitating..detective +1F57A ; Emoji_Modifier_Base # 9.0 [1] (🕺) man dancing +1F590 ; Emoji_Modifier_Base # 7.0 [1] (🖐️) raised hand with fingers splayed +1F595..1F596 ; Emoji_Modifier_Base # 7.0 [2] (🖕..🖖) middle finger..vulcan salute +1F645..1F647 ; Emoji_Modifier_Base # 6.0 [3] (🙅..🙇) person gesturing NO..person bowing +1F64B..1F64F ; Emoji_Modifier_Base # 6.0 [5] (🙋..🙏) person raising hand..folded hands +1F6A3 ; Emoji_Modifier_Base # 6.0 [1] (🚣) person rowing boat +1F6B4..1F6B6 ; Emoji_Modifier_Base # 6.0 [3] (🚴..🚶) person biking..person walking +1F6C0 ; Emoji_Modifier_Base # 6.0 [1] (🛀) person taking bath +1F6CC ; Emoji_Modifier_Base # 7.0 [1] (🛌) person in bed +1F918 ; Emoji_Modifier_Base # 8.0 [1] (🤘) sign of the horns +1F919..1F91C ; Emoji_Modifier_Base # 9.0 [4] (🤙..🤜) call me hand..right-facing fist +1F91E ; Emoji_Modifier_Base # 9.0 [1] (🤞) crossed fingers +1F91F ; Emoji_Modifier_Base # 10.0 [1] (🤟) love-you gesture +1F926 ; Emoji_Modifier_Base # 9.0 [1] (🤦) person facepalming +1F930 ; Emoji_Modifier_Base # 9.0 [1] (🤰) pregnant woman +1F931..1F932 ; Emoji_Modifier_Base # 10.0 [2] (🤱..🤲) breast-feeding..palms up together +1F933..1F939 ; Emoji_Modifier_Base # 9.0 [7] (🤳..🤹) selfie..person juggling +1F93D..1F93E ; Emoji_Modifier_Base # 9.0 [2] (🤽..🤾) person playing water polo..person playing handball +1F9D1..1F9DD ; Emoji_Modifier_Base # 10.0 [13] (🧑..🧝) adult..elf -# Total elements: 83 +# Total elements: 102 + +# ================================================ + +# All omitted code points have Emoji_Component=No +# @missing: 0000..10FFFF ; Emoji_Component ; No + +0023 ; Emoji_Component # 1.1 [1] (#️) number sign +002A ; Emoji_Component # 1.1 [1] (*️) asterisk +0030..0039 ; Emoji_Component # 1.1 [10] (0️..9️) digit zero..digit nine +1F1E6..1F1FF ; Emoji_Component # 6.0 [26] (🇦..🇿) regional indicator symbol letter a..regional indicator symbol letter z +1F3FB..1F3FF ; Emoji_Component # 8.0 [5] (🏻..🏿) light skin tone..dark skin tone + +# Total elements: 43 #EOF From 03fc0e3f4110740b95849cfc98d7714dedd1a9dd Mon Sep 17 00:00:00 2001 From: James McCoy Date: Thu, 29 Jun 2017 17:44:47 -0400 Subject: [PATCH 082/161] scripts: Tell curl to follow redirects --- scripts/download-unicode-files.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/download-unicode-files.sh b/scripts/download-unicode-files.sh index 5e9efebb43..5f38d0589a 100755 --- a/scripts/download-unicode-files.sh +++ b/scripts/download-unicode-files.sh @@ -22,7 +22,7 @@ UNIDIR=${1:-$UNIDIR_DEFAULT} DOWNLOAD_URL_BASE=${2:-$DOWNLOAD_URL_BASE_DEFAULT} for filename in $data_files ; do - curl -o "$UNIDIR/$filename" "$DOWNLOAD_URL_BASE/UNIDATA/$filename" + curl -L -o "$UNIDIR/$filename" "$DOWNLOAD_URL_BASE/UNIDATA/$filename" ( cd "$UNIDIR" git add $filename @@ -30,7 +30,7 @@ for filename in $data_files ; do done for filename in $emoji_files ; do - curl -o "$UNIDIR/$filename" "$DOWNLOAD_URL_BASE/emoji/latest/$filename" + curl -L -o "$UNIDIR/$filename" "$DOWNLOAD_URL_BASE/emoji/latest/$filename" ( cd "$UNIDIR" git add $filename From 57d691e81ac32163220fc4ff78011ce37be2006e Mon Sep 17 00:00:00 2001 From: KunMing Xie Date: Sun, 2 Jul 2017 00:48:17 +0800 Subject: [PATCH 083/161] test: handle single-char hostname (#6939) --- test/functional/eval/hostname_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/eval/hostname_spec.lua b/test/functional/eval/hostname_spec.lua index f1867846c4..6d5b64b929 100644 --- a/test/functional/eval/hostname_spec.lua +++ b/test/functional/eval/hostname_spec.lua @@ -8,7 +8,7 @@ describe('hostname()', function() it('returns hostname string', function() local actual = call('hostname') - ok(string.len(actual) > 1) + ok(string.len(actual) > 0) if call('executable', 'hostname') == 1 then local expected = string.gsub(call('system', 'hostname'), '[\n\r]', '') helpers.eq(expected, actual) From ca4633bfe4d0f58bd5fb7343d282fafb71f3a3ee Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 2 Jul 2017 00:30:00 +0200 Subject: [PATCH 084/161] ci/quickbuild: XXX: disable server_requests test (#6851) Temporarily disable this test which hangs quickbuild. From #6905: The hang occurs when calling nvim_set_current_line. References #6594 5a151555c8dce70bbf235e7f6d5bd1ced5e7c46c --- test/functional/api/server_requests_spec.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/functional/api/server_requests_spec.lua b/test/functional/api/server_requests_spec.lua index cf15062325..6a32f979ea 100644 --- a/test/functional/api/server_requests_spec.lua +++ b/test/functional/api/server_requests_spec.lua @@ -282,8 +282,13 @@ describe('server -> client', function() end) end) - describe('when connecting to its own pipe adress', function() - it('it does not deadlock', function() + describe('connecting to its own pipe address', function() + it('does not deadlock', function() + if not os.getenv("TRAVIS") and helpers.os_name() == "osx" then + -- It does, in fact, deadlock on QuickBuild. #6851 + pending("deadlocks on QuickBuild", function() end) + return + end local address = funcs.serverlist()[1] local first = string.sub(address,1,1) ok(first == '/' or first == '\\') From ac086d8ce2bf24ef643aeea428a81f5ec331bec0 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 2 Jul 2017 18:05:54 +0300 Subject: [PATCH 085/161] mbyte: Refactor mb_unescape Does not alter its usages. --- src/nvim/mbyte.c | 81 +++++++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 39 deletions(-) diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index d5907da2ed..5b00a4b9a8 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -1739,52 +1739,55 @@ int mb_charlen_len(char_u *str, int len) return count; } -/* - * Try to un-escape a multi-byte character. - * Used for the "to" and "from" part of a mapping. - * Return the un-escaped string if it is a multi-byte character, and advance - * "pp" to just after the bytes that formed it. - * Return NULL if no multi-byte char was found. - */ -char_u * mb_unescape(char_u **pp) +/// Try to unescape a multibyte character +/// +/// Used for the rhs and lhs of the mappings. +/// +/// @param[in,out] pp String to unescape. Is advanced to just after the bytes +/// that form a multibyte character. +/// +/// @return Unescaped string if it is a multibyte character, NULL if no +/// multibyte character was found. Returns a static buffer, always one +/// and the same. +const char *mb_unescape(const char **const pp) + FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL { - static char_u buf[6]; - int n; - int m = 0; - char_u *str = *pp; + static char buf[6]; + size_t buf_idx = 0; + uint8_t *str = (uint8_t *)(*pp); - /* Must translate K_SPECIAL KS_SPECIAL KE_FILLER to K_SPECIAL and CSI - * KS_EXTRA KE_CSI to CSI. - * Maximum length of a utf-8 character is 4 bytes. */ - for (n = 0; str[n] != NUL && m < 4; ++n) { - if (str[n] == K_SPECIAL - && str[n + 1] == KS_SPECIAL - && str[n + 2] == KE_FILLER) { - buf[m++] = K_SPECIAL; - n += 2; - } else if ((str[n] == K_SPECIAL - ) - && str[n + 1] == KS_EXTRA - && str[n + 2] == (int)KE_CSI) { - buf[m++] = CSI; - n += 2; - } else if (str[n] == K_SPECIAL - ) - break; /* a special key can't be a multibyte char */ - else - buf[m++] = str[n]; - buf[m] = NUL; + // Must translate K_SPECIAL KS_SPECIAL KE_FILLER to K_SPECIAL and CSI + // KS_EXTRA KE_CSI to CSI. + // Maximum length of a utf-8 character is 4 bytes. + for (size_t str_idx = 0; str[str_idx] != NUL && buf_idx < 4; str_idx++) { + if (str[str_idx] == K_SPECIAL + && str[str_idx + 1] == KS_SPECIAL + && str[str_idx + 2] == KE_FILLER) { + buf[buf_idx++] = (char)K_SPECIAL; + str_idx += 2; + } else if ((str[str_idx] == K_SPECIAL) + && str[str_idx + 1] == KS_EXTRA + && str[str_idx + 2] == KE_CSI) { + buf[buf_idx++] = (char)CSI; + str_idx += 2; + } else if (str[str_idx] == K_SPECIAL) { + break; // A special key can't be a multibyte char. + } else { + buf[buf_idx++] = (char)str[str_idx]; + } + buf[buf_idx] = NUL; - /* Return a multi-byte character if it's found. An illegal sequence - * will result in a 1 here. */ - if ((*mb_ptr2len)(buf) > 1) { - *pp = str + n + 1; + // Return a multi-byte character if it's found. An illegal sequence + // will result in a 1 here. + if (utf_ptr2len((const char_u *)buf) > 1) { + *pp = (const char *)str + buf_idx + 1; return buf; } - /* Bail out quickly for ASCII. */ - if (buf[0] < 128) + // Bail out quickly for ASCII. + if ((uint8_t)buf[0] < 128) { break; + } } return NULL; } From e9e1668ca6520936eaa0958823325c11a72fa923 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 2 Jul 2017 18:12:46 +0300 Subject: [PATCH 086/161] message: Refactor str2special_save and str2special Does not alter their usages as well. --- src/nvim/message.c | 120 +++++++++++++++++++++++---------------------- 1 file changed, 62 insertions(+), 58 deletions(-) diff --git a/src/nvim/message.c b/src/nvim/message.c index 057ce75f79..2263f9c00d 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1281,90 +1281,94 @@ msg_outtrans_special ( return retval; } -/* - * Return the lhs or rhs of a mapping, with the key codes turned into printable - * strings, in an allocated string. - */ -char_u * -str2special_save ( - char_u *str, - int is_lhs /* TRUE for lhs, FALSE for rhs */ -) +/// Convert string, replacing key codes with printables +/// +/// Used for lhs or rhs of mappings. +/// +/// @param[in] str String to convert. +/// @param[in] replace_spaces Convert spaces into , normally used for +/// lhs, but not rhs. +/// +/// @return [allocated] Converted string. +char *str2special_save(const char *const str, const bool replace_spaces) + FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_MALLOC + FUNC_ATTR_NONNULL_RET { garray_T ga; - char_u *p = str; - ga_init(&ga, 1, 40); - while (*p != NUL) - ga_concat(&ga, str2special(&p, is_lhs)); + + const char *p = str; + while (*p != NUL) { + ga_concat(&ga, (const char_u *)str2special(&p, replace_spaces)); + } ga_append(&ga, NUL); - return (char_u *)ga.ga_data; + return (char *)ga.ga_data; } -/* - * Return the printable string for the key codes at "*sp". - * Used for translating the lhs or rhs of a mapping to printable chars. - * Advances "sp" to the next code. - */ -char_u * -str2special ( - char_u **sp, - int from /* TRUE for lhs of mapping */ -) +/// Convert character, replacing key one key code with printable representation +/// +/// @param[in,out] sp String to convert. Is advanced to the next key code. +/// @param[in] replace_spaces Convert spaces into , normally used for +/// lhs, but not rhs. +/// +/// @return Converted key code, in a static buffer. Buffer is always one and the +/// same, so save converted string somewhere before running str2special +/// for the second time. +const char *str2special(const char **const sp, const bool replace_spaces) + FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_RET { - int c; - static char_u buf[7]; - char_u *str = *sp; - int modifiers = 0; - int special = FALSE; + static char buf[7]; - if (has_mbyte) { - char_u *p; - - /* Try to un-escape a multi-byte character. Return the un-escaped - * string if it is a multi-byte character. */ - p = mb_unescape(sp); - if (p != NULL) - return p; + // Try to un-escape a multi-byte character. Return the un-escaped + // string if it is a multi-byte character. + const char *const p = mb_unescape(sp); + if (p != NULL) { + return p; } - c = *str; + const char *str = *sp; + int c = (uint8_t)(*str); + int modifiers = 0; + bool special = false; if (c == K_SPECIAL && str[1] != NUL && str[2] != NUL) { - if (str[1] == KS_MODIFIER) { - modifiers = str[2]; + if ((uint8_t)str[1] == KS_MODIFIER) { + modifiers = (uint8_t)str[2]; str += 3; - c = *str; + c = (uint8_t)(*str); } if (c == K_SPECIAL && str[1] != NUL && str[2] != NUL) { - c = TO_SPECIAL(str[1], str[2]); + c = TO_SPECIAL((uint8_t)str[1], (uint8_t)str[2]); str += 2; - if (c == KS_ZERO) /* display as ^@ or */ + if (c == KS_ZERO) { // display as ^@ or c = NUL; + } + } + if (IS_SPECIAL(c) || modifiers) { // Special key. + special = true; } - if (IS_SPECIAL(c) || modifiers) /* special key */ - special = TRUE; } - if (has_mbyte && !IS_SPECIAL(c)) { - int len = (*mb_ptr2len)(str); + if (!IS_SPECIAL(c)) { + const int len = utf_ptr2len((const char_u *)str); - /* For multi-byte characters check for an illegal byte. */ - if (has_mbyte && MB_BYTE2LEN(*str) > len) { - transchar_nonprint(buf, c); + // Check for an illegal byte. + if (MB_BYTE2LEN((uint8_t)(*str)) > len) { + transchar_nonprint((char_u *)buf, c); *sp = str + 1; return buf; } - /* Since 'special' is TRUE the multi-byte character 'c' will be - * processed by get_special_key_name() */ - c = (*mb_ptr2char)(str); + // Since 'special' is TRUE the multi-byte character 'c' will be + // processed by get_special_key_name(). + c = utf_ptr2char((const char_u *)str); *sp = str + len; - } else + } else { *sp = str + 1; + } - /* Make unprintable characters in <> form, also and . - * Use only for lhs of a mapping. */ - if (special || char2cells(c) > 1 || (from && c == ' ')) - return get_special_key_name(c, modifiers); + // Make unprintable characters in <> form, also and . + if (special || char2cells(c) > 1 || (replace_spaces && c == ' ')) { + return (const char *)get_special_key_name(c, modifiers); + } buf[0] = c; buf[1] = NUL; return buf; From 832c158a663c7acb03a47fbd1e380ab7f835a9cd Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 2 Jul 2017 18:24:16 +0300 Subject: [PATCH 087/161] message: Refactor str2specialbuf Does not alter its usages. --- src/nvim/message.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/nvim/message.c b/src/nvim/message.c index 2263f9c00d..656f1adaf8 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1374,19 +1374,25 @@ const char *str2special(const char **const sp, const bool replace_spaces) return buf; } -/* - * Translate a key sequence into special key names. - */ -void str2specialbuf(char_u *sp, char_u *buf, int len) +/// Convert string, replacing key codes with printables +/// +/// @param[in] str String to convert. +/// @param[out] buf Buffer to save results to. +/// @param[in] len Buffer length. +void str2specialbuf(const char *sp, char *buf, size_t len) + FUNC_ATTR_NONNULL_ALL { - char_u *s; - - *buf = NUL; while (*sp) { - s = str2special(&sp, FALSE); - if ((int)(STRLEN(s) + STRLEN(buf)) < len) - STRCAT(buf, s); + const char *s = str2special(&sp, false); + const size_t s_len = strlen(s); + if (s_len <= len) { + break; + } + memcpy(buf, s, s_len); + buf += s_len; + len -= s_len; } + *buf = NUL; } /* From 6140396d97d700ab6390b4ecfc4fd7da0ebdfd9f Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 2 Jul 2017 18:29:42 +0300 Subject: [PATCH 088/161] *: Adjust usages of modified functions --- src/nvim/eval.c | 12 +++++++----- src/nvim/getchar.c | 10 ++++------ src/nvim/message.c | 2 +- src/nvim/option.c | 22 +++++++++++++--------- 4 files changed, 25 insertions(+), 21 deletions(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 18aa5bf763..c4baf3f653 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -12117,9 +12117,11 @@ static void get_maparg(typval_T *argvars, typval_T *rettv, int exact) xfree(keys_buf); if (!get_dict) { - /* Return a string. */ - if (rhs != NULL) - rettv->vval.v_string = str2special_save(rhs, FALSE); + // Return a string. + if (rhs != NULL) { + rettv->vval.v_string = (char_u *)str2special_save( + (const char *)rhs, false); + } } else { tv_dict_alloc_ret(rettv); @@ -12154,7 +12156,7 @@ void mapblock_fill_dict(dict_T *const dict, bool compatible) FUNC_ATTR_NONNULL_ALL { - char_u *lhs = str2special_save(mp->m_keys, true); + char *const lhs = str2special_save((const char *)mp->m_keys, true); char *const mapmode = map_mode_to_chars(mp->m_mode); varnumber_T noremap_value; @@ -12168,7 +12170,7 @@ void mapblock_fill_dict(dict_T *const dict, noremap_value = mp->m_noremap == REMAP_SCRIPT ? 2 : !!mp->m_noremap; } - tv_dict_add_str(dict, S_LEN("lhs"), (const char *)lhs); + tv_dict_add_str(dict, S_LEN("lhs"), lhs); tv_dict_add_str(dict, S_LEN("rhs"), (const char *)mp->m_orig_str); tv_dict_add_nr(dict, S_LEN("noremap"), noremap_value); tv_dict_add_nr(dict, S_LEN("expr"), mp->m_expr ? 1 : 0); diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 4e42042959..1d1af69c94 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -1806,7 +1806,7 @@ static int vgetorpeek(int advance) * and then changing 'encoding'. Beware * that 0x80 is escaped. */ char_u *p1 = mp->m_keys; - char_u *p2 = mb_unescape(&p1); + char_u *p2 = (char_u *)mb_unescape((const char **)&p1); if (has_mbyte && p2 != NULL && MB_BYTE2LEN(c1) > MB_PTR2LEN(p2)) mlen = 0; @@ -4000,11 +4000,9 @@ int put_escstr(FILE *fd, char_u *strstart, int what) } for (; *str != NUL; ++str) { - char_u *p; - - /* Check for a multi-byte character, which may contain escaped - * K_SPECIAL and CSI bytes */ - p = mb_unescape(&str); + // Check for a multi-byte character, which may contain escaped + // K_SPECIAL and CSI bytes. + const char *p = mb_unescape((const char **)&str); if (p != NULL) { while (*p != NUL) if (fputc(*p++, fd) < 0) diff --git a/src/nvim/message.c b/src/nvim/message.c index 656f1adaf8..feb2fb214e 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1269,7 +1269,7 @@ msg_outtrans_special ( string = ""; str++; } else { - string = (const char *)str2special((char_u **)&str, from); + string = str2special((const char **)&str, from); } const int len = vim_strsize((char_u *)string); // Highlight special keys diff --git a/src/nvim/option.c b/src/nvim/option.c index b48ffae85b..bc101ba703 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -5175,9 +5175,12 @@ static int put_setstring(FILE *fd, char *cmd, char *name, char_u **valuep, int e * CTRL-V or backslash */ if (valuep == &p_pt) { s = *valuep; - while (*s != NUL) - if (put_escstr(fd, str2special(&s, FALSE), 2) == FAIL) + while (*s != NUL) { + if (put_escstr(fd, (char_u *)str2special((const char **)&s, false), 2) + == FAIL) { return FAIL; + } + } } else if (expand) { buf = xmalloc(MAXPATHL); home_replace(NULL, *valuep, buf, MAXPATHL, FALSE); @@ -6173,15 +6176,16 @@ option_value2string ( } } else { // P_STRING varp = *(char_u **)(varp); - if (varp == NULL) /* just in case */ + if (varp == NULL) { // Just in case. NameBuff[0] = NUL; - else if (opp->flags & P_EXPAND) - home_replace(NULL, varp, NameBuff, MAXPATHL, FALSE); - /* Translate 'pastetoggle' into special key names */ - else if ((char_u **)opp->var == &p_pt) - str2specialbuf(p_pt, NameBuff, MAXPATHL); - else + } else if (opp->flags & P_EXPAND) { + home_replace(NULL, varp, NameBuff, MAXPATHL, false); + // Translate 'pastetoggle' into special key names. + } else if ((char_u **)opp->var == &p_pt) { + str2specialbuf((const char *)p_pt, (char *)NameBuff, MAXPATHL); + } else { STRLCPY(NameBuff, varp, MAXPATHL); + } } } From df040e55fbd3edc5a36462af927a7194d079d0b8 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 2 Jul 2017 19:01:09 +0300 Subject: [PATCH 089/161] eval/typval: Add tv_dict_add_allocated_str() function --- src/nvim/eval/typval.c | 23 ++++++++++++++++++++++- test/unit/eval/typval_spec.lua | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index 4521085519..c339a5cdd2 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -1386,12 +1386,33 @@ int tv_dict_add_str(dict_T *const d, const char *const key, const size_t key_len, const char *const val) FUNC_ATTR_NONNULL_ALL +{ + return tv_dict_add_allocated_str(d, key, key_len, xstrdup(val)); +} + +/// Add a string entry to dictionary +/// +/// Unlike tv_dict_add_str() saves val to the new dictionary item in place of +/// creating a new copy. +/// +/// @warning String will be freed even in case addition fails. +/// +/// @param[out] d Dictionary to add entry to. +/// @param[in] key Key to add. +/// @param[in] key_len Key length. +/// @param[in] val String to add. +/// +/// @return OK in case of success, FAIL when key already exists. +int tv_dict_add_allocated_str(dict_T *const d, + const char *const key, const size_t key_len, + char *const val) + FUNC_ATTR_NONNULL_ALL { dictitem_T *const item = tv_dict_item_alloc_len(key, key_len); item->di_tv.v_lock = VAR_UNLOCKED; item->di_tv.v_type = VAR_STRING; - item->di_tv.vval.v_string = (char_u *)xstrdup(val); + item->di_tv.vval.v_string = (char_u *)val; if (tv_dict_add(d, item) == FAIL) { tv_dict_item_free(item); return FAIL; diff --git a/test/unit/eval/typval_spec.lua b/test/unit/eval/typval_spec.lua index 5d543f914f..33d5bb28be 100644 --- a/test/unit/eval/typval_spec.lua +++ b/test/unit/eval/typval_spec.lua @@ -1963,6 +1963,38 @@ describe('typval.c', function() alloc_log:check({}) end) end) + describe('allocated_str()', function() + itp('works', function() + local d = dict({test=10}) + eq({test=10}, dct2tbl(d)) + alloc_log:clear() + local s1 = lib.xstrdup('TEST') + local s2 = lib.xstrdup('TEST') + local s3 = lib.xstrdup('TEST') + alloc_log:check({ + a.str(s1, 'TEST'), + a.str(s2, 'TEST'), + a.str(s3, 'TEST'), + }) + eq(OK, lib.tv_dict_add_allocated_str(d, 'testt', 3, s1)) + local dis = dict_items(d) + alloc_log:check({ + a.di(dis.tes, 'tes'), + }) + eq({test=10, tes='TEST'}, dct2tbl(d)) + eq(FAIL, check_emsg(function() return lib.tv_dict_add_allocated_str(d, 'testt', 3, s2) end, + 'E685: Internal error: hash_add()')) + alloc_log:clear() + lib.emsg_skip = lib.emsg_skip + 1 + eq(FAIL, check_emsg(function() return lib.tv_dict_add_allocated_str(d, 'testt', 3, s3) end, + nil)) + lib.emsg_skip = lib.emsg_skip - 1 + alloc_log:clear_tmp_allocs() + alloc_log:check({ + a.freed(s3), + }) + end) + end) end) describe('clear()', function() itp('works', function() From 85a6329a2b73924006eaccf8fd9ab59ec5c3ec46 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 2 Jul 2017 19:02:15 +0300 Subject: [PATCH 090/161] eval: Use tv_dict_add_allocated_str() for mapblock_fill_dict --- src/nvim/eval.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index c4baf3f653..32ba514d27 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -12170,7 +12170,7 @@ void mapblock_fill_dict(dict_T *const dict, noremap_value = mp->m_noremap == REMAP_SCRIPT ? 2 : !!mp->m_noremap; } - tv_dict_add_str(dict, S_LEN("lhs"), lhs); + tv_dict_add_allocated_str(dict, S_LEN("lhs"), lhs); tv_dict_add_str(dict, S_LEN("rhs"), (const char *)mp->m_orig_str); tv_dict_add_nr(dict, S_LEN("noremap"), noremap_value); tv_dict_add_nr(dict, S_LEN("expr"), mp->m_expr ? 1 : 0); @@ -12178,10 +12178,7 @@ void mapblock_fill_dict(dict_T *const dict, tv_dict_add_nr(dict, S_LEN("sid"), (varnumber_T)mp->m_script_ID); tv_dict_add_nr(dict, S_LEN("buffer"), (varnumber_T)buffer_value); tv_dict_add_nr(dict, S_LEN("nowait"), mp->m_nowait ? 1 : 0); - tv_dict_add_str(dict, S_LEN("mode"), mapmode); - - xfree(lhs); - xfree(mapmode); + tv_dict_add_allocated_str(dict, S_LEN("mode"), mapmode); } /* From 936c070059f8c60085fa83fa7ea2ee4797d69f7b Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 2 Jul 2017 19:15:14 +0300 Subject: [PATCH 091/161] eval: Make nvim_get_keymap output more robust --- src/nvim/eval.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 32ba514d27..8ea0969dd5 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -12156,7 +12156,8 @@ void mapblock_fill_dict(dict_T *const dict, bool compatible) FUNC_ATTR_NONNULL_ALL { - char *const lhs = str2special_save((const char *)mp->m_keys, true); + char *const lhs = str2special_save((const char *)mp->m_keys, + compatible ? true : false); char *const mapmode = map_mode_to_chars(mp->m_mode); varnumber_T noremap_value; @@ -12170,8 +12171,13 @@ void mapblock_fill_dict(dict_T *const dict, noremap_value = mp->m_noremap == REMAP_SCRIPT ? 2 : !!mp->m_noremap; } + if (compatible) { + tv_dict_add_str(dict, S_LEN("rhs"), (const char *)mp->m_orig_str); + } else { + tv_dict_add_allocated_str(dict, S_LEN("rhs"), + str2special_save((const char *)mp->m_str, false)); + } tv_dict_add_allocated_str(dict, S_LEN("lhs"), lhs); - tv_dict_add_str(dict, S_LEN("rhs"), (const char *)mp->m_orig_str); tv_dict_add_nr(dict, S_LEN("noremap"), noremap_value); tv_dict_add_nr(dict, S_LEN("expr"), mp->m_expr ? 1 : 0); tv_dict_add_nr(dict, S_LEN("silent"), mp->m_silent ? 1 : 0); From 4b8bdd953e2b7928af80e8b97118d52f99f0d95a Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 2 Jul 2017 19:21:21 +0300 Subject: [PATCH 092/161] functests: Remove local_copy function --- test/functional/api/keymap_spec.lua | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/test/functional/api/keymap_spec.lua b/test/functional/api/keymap_spec.lua index 833e0d2f3c..7d6445f49c 100644 --- a/test/functional/api/keymap_spec.lua +++ b/test/functional/api/keymap_spec.lua @@ -1,5 +1,6 @@ - local helpers = require('test.functional.helpers')(after_each) +local global_helpers = require('test.helpers') + local clear = helpers.clear local command = helpers.command local curbufmeths = helpers.curbufmeths @@ -8,13 +9,7 @@ local funcs = helpers.funcs local meths = helpers.meths local source = helpers.source -local function local_copy(t) - local copy = {} - for k,v in pairs(t) do - copy[k] = v - end - return copy -end +local shallowcopy = global_helpers.shallowcopy describe('get_keymap', function() before_each(clear) @@ -50,7 +45,7 @@ describe('get_keymap', function() -- Add another mapping command('nnoremap foo_longer bar_longer') - local foolong_bar_map_table = local_copy(foo_bar_map_table) + local foolong_bar_map_table = shallowcopy(foo_bar_map_table) foolong_bar_map_table['lhs'] = 'foo_longer' foolong_bar_map_table['rhs'] = 'bar_longer' @@ -72,7 +67,7 @@ describe('get_keymap', function() command('inoremap foo bar') -- The table will be the same except for the mode - local insert_table = local_copy(foo_bar_map_table) + local insert_table = shallowcopy(foo_bar_map_table) insert_table['mode'] = 'i' eq({insert_table}, meths.get_keymap('i')) @@ -81,11 +76,11 @@ describe('get_keymap', function() it('considers scope', function() -- change the map slightly command('nnoremap foo_longer bar_longer') - local foolong_bar_map_table = local_copy(foo_bar_map_table) + local foolong_bar_map_table = shallowcopy(foo_bar_map_table) foolong_bar_map_table['lhs'] = 'foo_longer' foolong_bar_map_table['rhs'] = 'bar_longer' - local buffer_table = local_copy(foo_bar_map_table) + local buffer_table = shallowcopy(foo_bar_map_table) buffer_table['buffer'] = 1 command('nnoremap foo bar') @@ -98,7 +93,7 @@ describe('get_keymap', function() it('considers scope for overlapping maps', function() command('nnoremap foo bar') - local buffer_table = local_copy(foo_bar_map_table) + local buffer_table = shallowcopy(foo_bar_map_table) buffer_table['buffer'] = 1 command('nnoremap foo bar') @@ -121,7 +116,7 @@ describe('get_keymap', function() command('nnoremap foo bar') -- Final buffer will have buffer mappings - local buffer_table = local_copy(foo_bar_map_table) + local buffer_table = shallowcopy(foo_bar_map_table) buffer_table['buffer'] = final_buffer eq({buffer_table}, meths.buf_get_keymap(final_buffer, 'n')) eq({buffer_table}, meths.buf_get_keymap(0, 'n')) From a1fee487ba5199ff672a87c5830732c224fa59eb Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 2 Jul 2017 19:28:44 +0300 Subject: [PATCH 093/161] functests: Add tests for new behaviour Apparently it is not working yet. --- test/functional/api/keymap_spec.lua | 72 +++++++++++++++++++++++++---- 1 file changed, 62 insertions(+), 10 deletions(-) diff --git a/test/functional/api/keymap_spec.lua b/test/functional/api/keymap_spec.lua index 7d6445f49c..b7858888c4 100644 --- a/test/functional/api/keymap_spec.lua +++ b/test/functional/api/keymap_spec.lua @@ -17,16 +17,16 @@ describe('get_keymap', function() -- Basic mapping and table to be used to describe results local foo_bar_string = 'nnoremap foo bar' local foo_bar_map_table = { - lhs='foo', - silent=0, - rhs='bar', - expr=0, - sid=0, - buffer=0, - nowait=0, - mode='n', - noremap=1, - } + lhs='foo', + silent=0, + rhs='bar', + expr=0, + sid=0, + buffer=0, + nowait=0, + mode='n', + noremap=1, + } it('returns empty list when no map', function() eq({}, meths.get_keymap('n')) @@ -238,4 +238,56 @@ describe('get_keymap', function() eq('', meths.get_keymap('n')[1]['lhs']) eq(':let g:maparg_test_var = 1', meths.get_keymap('n')[1]['rhs']) end) + + it('works correctly despite various &cpo settings', function() + local cpo_table = { + silent=0, + expr=0, + sid=0, + buffer=0, + nowait=0, + noremap=1, + } + local function cpomap(lhs, rhs, mode) + local ret = shallowcopy(cpo_table) + ret.lhs = lhs + ret.rhs = rhs + ret.mode = mode + return ret + end + + command('set cpo-=< cpo+=B') + command('nnoremap \\ \\') + command('nnoremap \\ \\') + + command('set cpo+=B<') + command('xnoremap \\ \\') + command('xnoremap \\ \\') + + command('set cpo-=B<') + command('snoremap \\ \\') + command('snoremap \\ \\') + + command('set cpo-=B cpo+=<') + command('onoremap \\ \\') + command('onoremap \\ \\') + + for _, cmd in ipairs({ + 'set cpo-=B cpo+=<', + 'set cpo-=B<', + 'set cpo+=B<', + 'set cpo-=< cpo+=B', + }) do + command(cmd) + eq({cpomap('\\', '\\', 'n'), cpomap('\\', '\\', 'n')}, + meths.get_keymap('n')) + -- FIXME + -- eq({cpomap('\\', '\\', 'x'), cpomap('\\C-A>', '\\C-B>', 'x')}, + -- meths.get_keymap('x')) + -- eq({cpomap('C-C>', 'C-D>', 's'), cpomap('C-A>', 'C-B>', 's')}, + -- meths.get_keymap('x')) + -- eq({cpomap('C-C>', 'C-D>', 'o'), cpomap('C-A>', 'C-B>', 'o')}, + -- meths.get_keymap('x')) + end + end) end) From 24f0056ca5cb392f1e1bf38d648a6037acf1f1ef Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 2 Jul 2017 19:37:21 +0300 Subject: [PATCH 094/161] message: Add support for replacing `<` to str2special --- src/nvim/eval.c | 7 ++++--- src/nvim/message.c | 21 ++++++++++++++------- src/nvim/option.c | 3 ++- test/functional/api/keymap_spec.lua | 13 ++++++------- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 8ea0969dd5..662270e788 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -12120,7 +12120,7 @@ static void get_maparg(typval_T *argvars, typval_T *rettv, int exact) // Return a string. if (rhs != NULL) { rettv->vval.v_string = (char_u *)str2special_save( - (const char *)rhs, false); + (const char *)rhs, false, false); } } else { @@ -12157,7 +12157,7 @@ void mapblock_fill_dict(dict_T *const dict, FUNC_ATTR_NONNULL_ALL { char *const lhs = str2special_save((const char *)mp->m_keys, - compatible ? true : false); + compatible, !compatible); char *const mapmode = map_mode_to_chars(mp->m_mode); varnumber_T noremap_value; @@ -12175,7 +12175,8 @@ void mapblock_fill_dict(dict_T *const dict, tv_dict_add_str(dict, S_LEN("rhs"), (const char *)mp->m_orig_str); } else { tv_dict_add_allocated_str(dict, S_LEN("rhs"), - str2special_save((const char *)mp->m_str, false)); + str2special_save((const char *)mp->m_str, false, + true)); } tv_dict_add_allocated_str(dict, S_LEN("lhs"), lhs); tv_dict_add_nr(dict, S_LEN("noremap"), noremap_value); diff --git a/src/nvim/message.c b/src/nvim/message.c index feb2fb214e..8a9d8e1bc6 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1269,7 +1269,7 @@ msg_outtrans_special ( string = ""; str++; } else { - string = str2special((const char **)&str, from); + string = str2special((const char **)&str, from, false); } const int len = vim_strsize((char_u *)string); // Highlight special keys @@ -1286,11 +1286,13 @@ msg_outtrans_special ( /// Used for lhs or rhs of mappings. /// /// @param[in] str String to convert. -/// @param[in] replace_spaces Convert spaces into , normally used for +/// @param[in] replace_spaces Convert spaces into ``, normally used fo /// lhs, but not rhs. +/// @param[in] replace_lt Convert `<` into ``. /// /// @return [allocated] Converted string. -char *str2special_save(const char *const str, const bool replace_spaces) +char *str2special_save(const char *const str, const bool replace_spaces, + const bool replace_lt) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_MALLOC FUNC_ATTR_NONNULL_RET { @@ -1299,7 +1301,7 @@ char *str2special_save(const char *const str, const bool replace_spaces) const char *p = str; while (*p != NUL) { - ga_concat(&ga, (const char_u *)str2special(&p, replace_spaces)); + ga_concat(&ga, (const char_u *)str2special(&p, replace_spaces, replace_lt)); } ga_append(&ga, NUL); return (char *)ga.ga_data; @@ -1310,11 +1312,13 @@ char *str2special_save(const char *const str, const bool replace_spaces) /// @param[in,out] sp String to convert. Is advanced to the next key code. /// @param[in] replace_spaces Convert spaces into , normally used for /// lhs, but not rhs. +/// @param[in] replace_lt Convert `<` into ``. /// /// @return Converted key code, in a static buffer. Buffer is always one and the /// same, so save converted string somewhere before running str2special /// for the second time. -const char *str2special(const char **const sp, const bool replace_spaces) +const char *str2special(const char **const sp, const bool replace_spaces, + const bool replace_lt) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_RET { static char buf[7]; @@ -1366,7 +1370,10 @@ const char *str2special(const char **const sp, const bool replace_spaces) } // Make unprintable characters in <> form, also and . - if (special || char2cells(c) > 1 || (replace_spaces && c == ' ')) { + if (special + || char2cells(c) > 1 + || (replace_spaces && c == ' ') + || (replace_lt && c == '<')) { return (const char *)get_special_key_name(c, modifiers); } buf[0] = c; @@ -1383,7 +1390,7 @@ void str2specialbuf(const char *sp, char *buf, size_t len) FUNC_ATTR_NONNULL_ALL { while (*sp) { - const char *s = str2special(&sp, false); + const char *s = str2special(&sp, false, false); const size_t s_len = strlen(s); if (s_len <= len) { break; diff --git a/src/nvim/option.c b/src/nvim/option.c index bc101ba703..7287db6eb8 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -5176,7 +5176,8 @@ static int put_setstring(FILE *fd, char *cmd, char *name, char_u **valuep, int e if (valuep == &p_pt) { s = *valuep; while (*s != NUL) { - if (put_escstr(fd, (char_u *)str2special((const char **)&s, false), 2) + if (put_escstr(fd, (char_u *)str2special((const char **)&s, false, + false), 2) == FAIL) { return FAIL; } diff --git a/test/functional/api/keymap_spec.lua b/test/functional/api/keymap_spec.lua index b7858888c4..fc3ab2d179 100644 --- a/test/functional/api/keymap_spec.lua +++ b/test/functional/api/keymap_spec.lua @@ -281,13 +281,12 @@ describe('get_keymap', function() command(cmd) eq({cpomap('\\', '\\', 'n'), cpomap('\\', '\\', 'n')}, meths.get_keymap('n')) - -- FIXME - -- eq({cpomap('\\', '\\', 'x'), cpomap('\\C-A>', '\\C-B>', 'x')}, - -- meths.get_keymap('x')) - -- eq({cpomap('C-C>', 'C-D>', 's'), cpomap('C-A>', 'C-B>', 's')}, - -- meths.get_keymap('x')) - -- eq({cpomap('C-C>', 'C-D>', 'o'), cpomap('C-A>', 'C-B>', 'o')}, - -- meths.get_keymap('x')) + eq({cpomap('\\', '\\', 'x'), cpomap('\\C-a>', '\\C-b>', 'x')}, + meths.get_keymap('x')) + eq({cpomap('C-c>', 'C-d>', 's'), cpomap('C-a>', 'C-b>', 's')}, + meths.get_keymap('s')) + eq({cpomap('C-c>', 'C-d>', 'o'), cpomap('C-a>', 'C-b>', 'o')}, + meths.get_keymap('o')) end end) end) From 5fe5d712aae512c62083754bc364030848d67987 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 2 Jul 2017 19:49:40 +0300 Subject: [PATCH 095/161] functests: Use more extensive testing Fixes #6937 --- test/functional/api/keymap_spec.lua | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/test/functional/api/keymap_spec.lua b/test/functional/api/keymap_spec.lua index fc3ab2d179..f1c4d7bdf3 100644 --- a/test/functional/api/keymap_spec.lua +++ b/test/functional/api/keymap_spec.lua @@ -257,20 +257,20 @@ describe('get_keymap', function() end command('set cpo-=< cpo+=B') - command('nnoremap \\ \\') - command('nnoremap \\ \\') + command('nnoremap \\C-a>\\ \\C-b>\\') + command('nnoremap \\C-c>\\ \\C-d>\\') command('set cpo+=B<') - command('xnoremap \\ \\') - command('xnoremap \\ \\') + command('xnoremap \\C-a>\\ \\C-b>\\') + command('xnoremap \\C-c>\\ \\C-d>\\') command('set cpo-=B<') - command('snoremap \\ \\') - command('snoremap \\ \\') + command('snoremap \\C-a>\\ \\C-b>\\') + command('snoremap \\C-c>\\ \\C-d>\\') command('set cpo-=B cpo+=<') - command('onoremap \\ \\') - command('onoremap \\ \\') + command('onoremap \\C-a>\\ \\C-b>\\') + command('onoremap \\C-c>\\ \\C-d>\\') for _, cmd in ipairs({ 'set cpo-=B cpo+=<', @@ -279,13 +279,17 @@ describe('get_keymap', function() 'set cpo-=< cpo+=B', }) do command(cmd) - eq({cpomap('\\', '\\', 'n'), cpomap('\\', '\\', 'n')}, + eq({cpomap('\\C-c>\\', '\\C-d>\\', 'n'), + cpomap('\\C-a>\\', '\\C-b>\\', 'n')}, meths.get_keymap('n')) - eq({cpomap('\\', '\\', 'x'), cpomap('\\C-a>', '\\C-b>', 'x')}, + eq({cpomap('\\C-c>\\', '\\C-d>\\', 'x'), + cpomap('\\C-a>C-a>LT>C-a>\\', '\\C-b>C-b>LT>C-b>\\', 'x')}, meths.get_keymap('x')) - eq({cpomap('C-c>', 'C-d>', 's'), cpomap('C-a>', 'C-b>', 's')}, + eq({cpomap('C-c>C-c> ', 'C-d>C-d>', 's'), + cpomap('C-a>C-a> ', 'C-b>C-b>', 's')}, meths.get_keymap('s')) - eq({cpomap('C-c>', 'C-d>', 'o'), cpomap('C-a>', 'C-b>', 'o')}, + eq({cpomap('C-c>C-c> ', 'C-d>C-d>', 'o'), + cpomap('C-a>C-a>LT>C-a> ', 'C-b>C-b>LT>C-b>', 'o')}, meths.get_keymap('o')) end end) From b97df0bdad63ba5da87982ea74ca171854e65dee Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 2 Jul 2017 19:52:04 +0300 Subject: [PATCH 096/161] getchar: Fix linter error --- src/nvim/getchar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 1d1af69c94..fc1b8ccfcb 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -3999,7 +3999,7 @@ int put_escstr(FILE *fd, char_u *strstart, int what) return OK; } - for (; *str != NUL; ++str) { + for (; *str != NUL; str++) { // Check for a multi-byte character, which may contain escaped // K_SPECIAL and CSI bytes. const char *p = mb_unescape((const char **)&str); From 4d017256996fe7c7e19944f78c67d9fcb156ada7 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sun, 2 Jul 2017 12:51:06 -0400 Subject: [PATCH 097/161] test: expand_env_esc: Pass correct buffer size for outlen and assertion Running this test with a mocked passwd file whose $HOME was set to /home/jamessan/src/debian.org/pkg-vim/deb-packages/neovim/neovim-0.2.0/debian/fakehome caused the test to fail, since the expanded result was >= 99 bytes. The test should be reflecting the actual size of the buffer, instead of some arbitrary other number, anwyay. --- test/unit/os/env_spec.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/os/env_spec.lua b/test/unit/os/env_spec.lua index cefd0315b7..c54d5a9b77 100644 --- a/test/unit/os/env_spec.lua +++ b/test/unit/os/env_spec.lua @@ -229,10 +229,10 @@ describe('env.c', function() local src = to_cstr("~"..curuser.."/Vcs/django-rest-framework/rest_framework/renderers.py") local dst = cstr(256, "~"..curuser) - cimp.expand_env_esc(src, dst, 1024, false, false, NULL) + cimp.expand_env_esc(src, dst, 256, false, false, NULL) local len = string.len(ffi.string(dst)) assert.True(len > 56) - assert.True(len < 99) + assert.True(len < 256) end) itp('respects `dstlen` without expansion', function() From d5916a823a37a1c0fb1d3d2f52db7cad4107b924 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 2 Jul 2017 20:08:00 +0300 Subject: [PATCH 098/161] functests: Test how spaces appear in get_keymap output --- test/functional/api/keymap_spec.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/functional/api/keymap_spec.lua b/test/functional/api/keymap_spec.lua index f1c4d7bdf3..aa556b563d 100644 --- a/test/functional/api/keymap_spec.lua +++ b/test/functional/api/keymap_spec.lua @@ -293,4 +293,20 @@ describe('get_keymap', function() meths.get_keymap('o')) end end) + + it('always uses space for space and bar for bar', function() + local space_table = { + lhs='| |', + rhs='| |', + mode='n', + silent=0, + expr=0, + sid=0, + buffer=0, + nowait=0, + noremap=1, + } + command('nnoremap \\| \\| ') + eq({space_table}, meths.get_keymap('n')) + end) end) From 35898cff5d1d6dc60e0d7b87bfe106539453b031 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 2 Jul 2017 20:18:15 +0300 Subject: [PATCH 099/161] unittests: Fix allocation ordering for tv_dict_add_str() --- test/unit/eval/typval_spec.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/eval/typval_spec.lua b/test/unit/eval/typval_spec.lua index 33d5bb28be..bec74f05fc 100644 --- a/test/unit/eval/typval_spec.lua +++ b/test/unit/eval/typval_spec.lua @@ -1948,8 +1948,8 @@ describe('typval.c', function() eq(OK, lib.tv_dict_add_str(d, 'testt', 3, 'TEST')) local dis = dict_items(d) alloc_log:check({ + a.str(dis.tes.di_tv.vval.v_string, 'TEST'), a.di(dis.tes, 'tes'), - a.str(dis.tes.di_tv.vval.v_string, 'TEST') }) eq({test=10, tes='TEST'}, dct2tbl(d)) eq(FAIL, check_emsg(function() return lib.tv_dict_add_str(d, 'testt', 3, 'TEST') end, @@ -2007,7 +2007,7 @@ describe('typval.c', function() local dis = dict_items(d) local di = dis.TES local di_s = di.di_tv.vval.v_string - alloc_log:check({a.di(di), a.str(di_s)}) + alloc_log:check({a.str(di_s), a.di(di)}) eq({TES='tEsT'}, dct2tbl(d)) lib.tv_dict_clear(d) alloc_log:check({a.freed(di_s), a.freed(di)}) From e333957a1a9ae64b7daa36e08fd1df583114d4ba Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Mon, 3 Jul 2017 23:03:30 +0200 Subject: [PATCH 100/161] dict_get_value(): name the missing key (#6952) --- src/nvim/api/private/helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index d401ae52a0..1ed2bc013e 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -95,7 +95,7 @@ Object dict_get_value(dict_T *dict, String key, Error *err) dictitem_T *const di = tv_dict_find(dict, key.data, (ptrdiff_t)key.size); if (di == NULL) { - api_set_error(err, kErrorTypeValidation, "Key not found"); + api_set_error(err, kErrorTypeValidation, "Key '%s' not found", key.data); return (Object)OBJECT_INIT; } From b199194a2cde4e296d26c07e5c6d88cee477487c Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 02:06:04 +0300 Subject: [PATCH 101/161] functests: Copy eval/string_spec.lua to ex_cmds/echo_spec.lua --- test/functional/ex_cmds/echo_spec.lua | 277 ++++++++++++++++++++++++++ 1 file changed, 277 insertions(+) create mode 100644 test/functional/ex_cmds/echo_spec.lua diff --git a/test/functional/ex_cmds/echo_spec.lua b/test/functional/ex_cmds/echo_spec.lua new file mode 100644 index 0000000000..adc1af9b8e --- /dev/null +++ b/test/functional/ex_cmds/echo_spec.lua @@ -0,0 +1,277 @@ +local helpers = require('test.functional.helpers')(after_each) +local clear = helpers.clear +local eq = helpers.eq +local command = helpers.command +local meths = helpers.meths +local eval = helpers.eval +local exc_exec = helpers.exc_exec +local redir_exec = helpers.redir_exec +local funcs = helpers.funcs +local NIL = helpers.NIL +local source = helpers.source +local dedent = helpers.dedent + +describe('string() function', function() + before_each(clear) + + describe('used to represent floating-point values', function() + it('dumps NaN values', function() + eq('str2float(\'nan\')', eval('string(str2float(\'nan\'))')) + end) + + it('dumps infinite values', function() + eq('str2float(\'inf\')', eval('string(str2float(\'inf\'))')) + eq('-str2float(\'inf\')', eval('string(str2float(\'-inf\'))')) + end) + + it('dumps regular values', function() + eq('1.5', funcs.string(1.5)) + eq('1.56e-20', funcs.string(1.56000e-020)) + eq('0.0', eval('string(0.0)')) + end) + + it('dumps special v: values', function() + eq('v:true', eval('string(v:true)')) + eq('v:false', eval('string(v:false)')) + eq('v:null', eval('string(v:null)')) + eq('v:true', funcs.string(true)) + eq('v:false', funcs.string(false)) + eq('v:null', funcs.string(NIL)) + end) + + it('dumps values with at most six digits after the decimal point', + function() + eq('1.234568e-20', funcs.string(1.23456789123456789123456789e-020)) + eq('1.234568', funcs.string(1.23456789123456789123456789)) + end) + + it('dumps values with at most seven digits before the decimal point', + function() + eq('1234567.891235', funcs.string(1234567.89123456789123456789)) + eq('1.234568e7', funcs.string(12345678.9123456789123456789)) + end) + + it('dumps negative values', function() + eq('-1.5', funcs.string(-1.5)) + eq('-1.56e-20', funcs.string(-1.56000e-020)) + eq('-1.234568e-20', funcs.string(-1.23456789123456789123456789e-020)) + eq('-1.234568', funcs.string(-1.23456789123456789123456789)) + eq('-1234567.891235', funcs.string(-1234567.89123456789123456789)) + eq('-1.234568e7', funcs.string(-12345678.9123456789123456789)) + end) + end) + + describe('used to represent numbers', function() + it('dumps regular values', function() + eq('0', funcs.string(0)) + eq('-1', funcs.string(-1)) + eq('1', funcs.string(1)) + end) + + it('dumps large values', function() + eq('2147483647', funcs.string(2^31-1)) + eq('-2147483648', funcs.string(-2^31)) + end) + end) + + describe('used to represent strings', function() + it('dumps regular strings', function() + eq('\'test\'', funcs.string('test')) + end) + + it('dumps empty strings', function() + eq('\'\'', funcs.string('')) + end) + + it('dumps strings with \' inside', function() + eq('\'\'\'\'\'\'\'\'', funcs.string('\'\'\'')) + eq('\'a\'\'b\'\'\'\'\'', funcs.string('a\'b\'\'')) + eq('\'\'\'b\'\'\'\'d\'', funcs.string('\'b\'\'d')) + eq('\'a\'\'b\'\'c\'\'d\'', funcs.string('a\'b\'c\'d')) + end) + + it('dumps NULL strings', function() + eq('\'\'', eval('string($XXX_UNEXISTENT_VAR_XXX)')) + end) + + it('dumps NULL lists', function() + eq('[]', eval('string(v:_null_list)')) + end) + + it('dumps NULL dictionaries', function() + eq('{}', eval('string(v:_null_dict)')) + end) + end) + + describe('used to represent funcrefs', function() + before_each(function() + source([[ + function Test1() + endfunction + + function s:Test2() dict + endfunction + + function g:Test3() dict + endfunction + + let g:Test2_f = function('s:Test2') + ]]) + end) + + it('dumps references to built-in functions', function() + eq('function(\'function\')', eval('string(function("function"))')) + end) + + it('dumps references to user functions', function() + eq('function(\'Test1\')', eval('string(function("Test1"))')) + eq('function(\'g:Test3\')', eval('string(function("g:Test3"))')) + end) + + it('dumps references to script functions', function() + eq('function(\'1_Test2\')', eval('string(Test2_f)')) + end) + + it('dumps partials with self referencing a partial', function() + source([[ + function TestDict() dict + endfunction + let d = {} + let TestDictRef = function('TestDict', d) + let d.tdr = TestDictRef + ]]) + eq("\nE724: unable to correctly dump variable with self-referencing container\nfunction('TestDict', {'tdr': function('TestDict', {E724@1})})", + redir_exec('echo string(d.tdr)')) + end) + + it('dumps automatically created partials', function() + eq('function(\'1_Test2\', {\'f\': function(\'1_Test2\')})', + eval('string({"f": Test2_f}.f)')) + eq('function(\'1_Test2\', [1], {\'f\': function(\'1_Test2\', [1])})', + eval('string({"f": function(Test2_f, [1])}.f)')) + end) + + it('dumps manually created partials', function() + eq('function(\'Test3\', [1, 2], {})', + eval('string(function("Test3", [1, 2], {}))')) + eq('function(\'Test3\', {})', + eval('string(function("Test3", {}))')) + eq('function(\'Test3\', [1, 2])', + eval('string(function("Test3", [1, 2]))')) + end) + + it('does not crash or halt when dumping partials with reference cycles in self', + function() + meths.set_var('d', {v=true}) + eq(dedent([[ + + E724: unable to correctly dump variable with self-referencing container + {'p': function('1_Test2', {E724@0}), 'f': function('1_Test2'), 'v': v:true}]]), + redir_exec('echo string(extend(extend(g:d, {"f": g:Test2_f}), {"p": g:d.f}))')) + end) + + it('does not show errors when dumping partials referencing the same dictionary', + function() + command('let d = {}') + -- Regression for “eval/typval_encode: Dump empty dictionary before + -- checking for refcycle”, results in error. + eq('[function(\'tr\', {}), function(\'tr\', {})]', eval('string([function("tr", d), function("tr", d)])')) + -- Regression for “eval: Work with reference cycles in partials (self) + -- properly”, results in crash. + eval('extend(d, {"a": 1})') + eq('[function(\'tr\', {\'a\': 1}), function(\'tr\', {\'a\': 1})]', eval('string([function("tr", d), function("tr", d)])')) + end) + + it('does not crash or halt when dumping partials with reference cycles in arguments', + function() + meths.set_var('l', {}) + eval('add(l, l)') + -- Regression: the below line used to crash (add returns original list and + -- there was error in dumping partials). Tested explicitly in + -- test/unit/api/private_helpers_spec.lua. + eval('add(l, function("Test1", l))') + eq(dedent([=[ + + E724: unable to correctly dump variable with self-referencing container + function('Test1', [[{E724@2}, function('Test1', [{E724@2}])], function('Test1', [[{E724@4}, function('Test1', [{E724@4}])]])])]=]), + redir_exec('echo string(function("Test1", l))')) + end) + + it('does not crash or halt when dumping partials with reference cycles in self and arguments', + function() + meths.set_var('d', {v=true}) + meths.set_var('l', {}) + eval('add(l, l)') + eval('add(l, function("Test1", l))') + eval('add(l, function("Test1", d))') + eq(dedent([=[ + + E724: unable to correctly dump variable with self-referencing container + {'p': function('1_Test2', [[{E724@3}, function('Test1', [{E724@3}]), function('Test1', {E724@0})], function('Test1', [[{E724@5}, function('Test1', [{E724@5}]), function('Test1', {E724@0})]]), function('Test1', {E724@0})], {E724@0}), 'f': function('1_Test2'), 'v': v:true}]=]), + redir_exec('echo string(extend(extend(g:d, {"f": g:Test2_f}), {"p": function(g:d.f, l)}))')) + end) + end) + + describe('used to represent lists', function() + it('dumps empty list', function() + eq('[]', funcs.string({})) + end) + + it('dumps nested lists', function() + eq('[[[[[]]]]]', funcs.string({{{{{}}}}})) + end) + + it('dumps nested non-empty lists', function() + eq('[1, [[3, [[5], 4]], 2]]', funcs.string({1, {{3, {{5}, 4}}, 2}})) + end) + + it('errors when dumping recursive lists', function() + meths.set_var('l', {}) + eval('add(l, l)') + eq('Vim(echo):E724: unable to correctly dump variable with self-referencing container', + exc_exec('echo string(l)')) + end) + + it('dumps recursive lists despite the error', function() + meths.set_var('l', {}) + eval('add(l, l)') + eq('\nE724: unable to correctly dump variable with self-referencing container\n[{E724@0}]', + redir_exec('echo string(l)')) + eq('\nE724: unable to correctly dump variable with self-referencing container\n[[{E724@1}]]', + redir_exec('echo string([l])')) + end) + end) + + describe('used to represent dictionaries', function() + it('dumps empty dictionary', function() + eq('{}', eval('string({})')) + end) + + it('dumps list with two same empty dictionaries, also in partials', function() + command('let d = {}') + eq('[{}, {}]', eval('string([d, d])')) + eq('[function(\'tr\', {}), {}]', eval('string([function("tr", d), d])')) + eq('[{}, function(\'tr\', {})]', eval('string([d, function("tr", d)])')) + end) + + it('dumps non-empty dictionary', function() + eq('{\'t\'\'est\': 1}', funcs.string({['t\'est']=1})) + end) + + it('errors when dumping recursive dictionaries', function() + meths.set_var('d', {d=1}) + eval('extend(d, {"d": d})') + eq('Vim(echo):E724: unable to correctly dump variable with self-referencing container', + exc_exec('echo string(d)')) + end) + + it('dumps recursive dictionaries despite the error', function() + meths.set_var('d', {d=1}) + eval('extend(d, {"d": d})') + eq('\nE724: unable to correctly dump variable with self-referencing container\n{\'d\': {E724@0}}', + redir_exec('echo string(d)')) + eq('\nE724: unable to correctly dump variable with self-referencing container\n{\'out\': {\'d\': {E724@1}}}', + redir_exec('echo string({"out": d})')) + end) + end) +end) From e07e46f53921aa75bc826290098491e4b5622448 Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 02:06:40 +0300 Subject: [PATCH 102/161] message: Fix `:echo "\x80"` printing `~@<80>` --- src/nvim/message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/message.c b/src/nvim/message.c index 8a9d8e1bc6..36f9ca84ed 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1196,7 +1196,7 @@ int msg_outtrans_len_attr(char_u *msgstr, int len, int attr) len -= mb_l - 1; str += mb_l; } else { - s = transchar_byte(*str); + s = transchar_byte((uint8_t)(*str)); if (s[1] != NUL) { // Unprintable char: print the printable chars so far and the // translation of the unprintable char. From d113d3d737641d7668361b2e08cea53411308146 Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 02:22:26 +0300 Subject: [PATCH 103/161] functests: Make ex_cmds/echo actually use :echo --- test/functional/ex_cmds/echo_spec.lua | 189 +++++++++++++------------- 1 file changed, 98 insertions(+), 91 deletions(-) diff --git a/test/functional/ex_cmds/echo_spec.lua b/test/functional/ex_cmds/echo_spec.lua index adc1af9b8e..06436fb87e 100644 --- a/test/functional/ex_cmds/echo_spec.lua +++ b/test/functional/ex_cmds/echo_spec.lua @@ -1,105 +1,113 @@ local helpers = require('test.functional.helpers')(after_each) -local clear = helpers.clear + local eq = helpers.eq -local command = helpers.command -local meths = helpers.meths -local eval = helpers.eval -local exc_exec = helpers.exc_exec -local redir_exec = helpers.redir_exec -local funcs = helpers.funcs local NIL = helpers.NIL +local eval = helpers.eval +local clear = helpers.clear +local meths = helpers.meths +local funcs = helpers.funcs local source = helpers.source local dedent = helpers.dedent +local command = helpers.command +local exc_exec = helpers.exc_exec +local redir_exec = helpers.redir_exec -describe('string() function', function() - before_each(clear) +describe(':echo', function() + before_each(function() + clear() + source([[ + function String(s) + return execute('echo a:s')[1:] + endfunction + ]]) + end) describe('used to represent floating-point values', function() it('dumps NaN values', function() - eq('str2float(\'nan\')', eval('string(str2float(\'nan\'))')) + eq('str2float(\'nan\')', eval('String(str2float(\'nan\'))')) end) it('dumps infinite values', function() - eq('str2float(\'inf\')', eval('string(str2float(\'inf\'))')) - eq('-str2float(\'inf\')', eval('string(str2float(\'-inf\'))')) + eq('str2float(\'inf\')', eval('String(str2float(\'inf\'))')) + eq('-str2float(\'inf\')', eval('String(str2float(\'-inf\'))')) end) it('dumps regular values', function() - eq('1.5', funcs.string(1.5)) - eq('1.56e-20', funcs.string(1.56000e-020)) - eq('0.0', eval('string(0.0)')) + eq('1.5', funcs.String(1.5)) + eq('1.56e-20', funcs.String(1.56000e-020)) + eq('0.0', eval('String(0.0)')) end) it('dumps special v: values', function() - eq('v:true', eval('string(v:true)')) - eq('v:false', eval('string(v:false)')) - eq('v:null', eval('string(v:null)')) - eq('v:true', funcs.string(true)) - eq('v:false', funcs.string(false)) - eq('v:null', funcs.string(NIL)) + eq('v:true', eval('String(v:true)')) + eq('v:false', eval('String(v:false)')) + eq('v:null', eval('String(v:null)')) + eq('v:true', funcs.String(true)) + eq('v:false', funcs.String(false)) + eq('v:null', funcs.String(NIL)) end) it('dumps values with at most six digits after the decimal point', function() - eq('1.234568e-20', funcs.string(1.23456789123456789123456789e-020)) - eq('1.234568', funcs.string(1.23456789123456789123456789)) + eq('1.234568e-20', funcs.String(1.23456789123456789123456789e-020)) + eq('1.234568', funcs.String(1.23456789123456789123456789)) end) it('dumps values with at most seven digits before the decimal point', function() - eq('1234567.891235', funcs.string(1234567.89123456789123456789)) - eq('1.234568e7', funcs.string(12345678.9123456789123456789)) + eq('1234567.891235', funcs.String(1234567.89123456789123456789)) + eq('1.234568e7', funcs.String(12345678.9123456789123456789)) end) it('dumps negative values', function() - eq('-1.5', funcs.string(-1.5)) - eq('-1.56e-20', funcs.string(-1.56000e-020)) - eq('-1.234568e-20', funcs.string(-1.23456789123456789123456789e-020)) - eq('-1.234568', funcs.string(-1.23456789123456789123456789)) - eq('-1234567.891235', funcs.string(-1234567.89123456789123456789)) - eq('-1.234568e7', funcs.string(-12345678.9123456789123456789)) + eq('-1.5', funcs.String(-1.5)) + eq('-1.56e-20', funcs.String(-1.56000e-020)) + eq('-1.234568e-20', funcs.String(-1.23456789123456789123456789e-020)) + eq('-1.234568', funcs.String(-1.23456789123456789123456789)) + eq('-1234567.891235', funcs.String(-1234567.89123456789123456789)) + eq('-1.234568e7', funcs.String(-12345678.9123456789123456789)) end) end) describe('used to represent numbers', function() it('dumps regular values', function() - eq('0', funcs.string(0)) - eq('-1', funcs.string(-1)) - eq('1', funcs.string(1)) + eq('0', funcs.String(0)) + eq('-1', funcs.String(-1)) + eq('1', funcs.String(1)) end) it('dumps large values', function() - eq('2147483647', funcs.string(2^31-1)) - eq('-2147483648', funcs.string(-2^31)) + eq('2147483647', funcs.String(2^31-1)) + eq('-2147483648', funcs.String(-2^31)) end) end) describe('used to represent strings', function() it('dumps regular strings', function() - eq('\'test\'', funcs.string('test')) + eq('test', funcs.String('test')) end) it('dumps empty strings', function() - eq('\'\'', funcs.string('')) + eq('', funcs.String('')) end) it('dumps strings with \' inside', function() - eq('\'\'\'\'\'\'\'\'', funcs.string('\'\'\'')) - eq('\'a\'\'b\'\'\'\'\'', funcs.string('a\'b\'\'')) - eq('\'\'\'b\'\'\'\'d\'', funcs.string('\'b\'\'d')) - eq('\'a\'\'b\'\'c\'\'d\'', funcs.string('a\'b\'c\'d')) + eq('\'\'\'', funcs.String('\'\'\'')) + eq('a\'b\'\'', funcs.String('a\'b\'\'')) + eq('\'b\'\'d', funcs.String('\'b\'\'d')) + eq('a\'b\'c\'d', funcs.String('a\'b\'c\'d')) end) it('dumps NULL strings', function() - eq('\'\'', eval('string($XXX_UNEXISTENT_VAR_XXX)')) + eq('', eval('String($XXX_UNEXISTENT_VAR_XXX)')) end) it('dumps NULL lists', function() - eq('[]', eval('string(v:_null_list)')) + eq('[]', eval('String(v:_null_list)')) end) it('dumps NULL dictionaries', function() - eq('{}', eval('string(v:_null_dict)')) + eq('{}', eval('String(v:_null_dict)')) end) end) @@ -120,16 +128,16 @@ describe('string() function', function() end) it('dumps references to built-in functions', function() - eq('function(\'function\')', eval('string(function("function"))')) + eq('function', eval('String(function("function"))')) end) it('dumps references to user functions', function() - eq('function(\'Test1\')', eval('string(function("Test1"))')) - eq('function(\'g:Test3\')', eval('string(function("g:Test3"))')) + eq('Test1', eval('String(function("Test1"))')) + eq('g:Test3', eval('String(function("g:Test3"))')) end) it('dumps references to script functions', function() - eq('function(\'1_Test2\')', eval('string(Test2_f)')) + eq('1_Test2', eval('String(Test2_f)')) end) it('dumps partials with self referencing a partial', function() @@ -140,24 +148,27 @@ describe('string() function', function() let TestDictRef = function('TestDict', d) let d.tdr = TestDictRef ]]) - eq("\nE724: unable to correctly dump variable with self-referencing container\nfunction('TestDict', {'tdr': function('TestDict', {E724@1})})", - redir_exec('echo string(d.tdr)')) + eq(dedent([[ + + function('TestDict', {'tdr': function('TestDict', {...@1})}) + function('TestDict', {'tdr': function('TestDict', {...@1})})]]), + redir_exec('echo String(d.tdr)')) end) it('dumps automatically created partials', function() eq('function(\'1_Test2\', {\'f\': function(\'1_Test2\')})', - eval('string({"f": Test2_f}.f)')) + eval('String({"f": Test2_f}.f)')) eq('function(\'1_Test2\', [1], {\'f\': function(\'1_Test2\', [1])})', - eval('string({"f": function(Test2_f, [1])}.f)')) + eval('String({"f": function(Test2_f, [1])}.f)')) end) it('dumps manually created partials', function() eq('function(\'Test3\', [1, 2], {})', - eval('string(function("Test3", [1, 2], {}))')) + eval('String(function("Test3", [1, 2], {}))')) eq('function(\'Test3\', {})', - eval('string(function("Test3", {}))')) + eval('String(function("Test3", {}))')) eq('function(\'Test3\', [1, 2])', - eval('string(function("Test3", [1, 2]))')) + eval('String(function("Test3", [1, 2]))')) end) it('does not crash or halt when dumping partials with reference cycles in self', @@ -165,9 +176,9 @@ describe('string() function', function() meths.set_var('d', {v=true}) eq(dedent([[ - E724: unable to correctly dump variable with self-referencing container - {'p': function('1_Test2', {E724@0}), 'f': function('1_Test2'), 'v': v:true}]]), - redir_exec('echo string(extend(extend(g:d, {"f": g:Test2_f}), {"p": g:d.f}))')) + {'p': function('1_Test2', {...@0}), 'f': function('1_Test2'), 'v': v:true} + {'p': function('1_Test2', {...@0}), 'f': function('1_Test2'), 'v': v:true}]]), + redir_exec('echo String(extend(extend(g:d, {"f": g:Test2_f}), {"p": g:d.f}))')) end) it('does not show errors when dumping partials referencing the same dictionary', @@ -175,11 +186,11 @@ describe('string() function', function() command('let d = {}') -- Regression for “eval/typval_encode: Dump empty dictionary before -- checking for refcycle”, results in error. - eq('[function(\'tr\', {}), function(\'tr\', {})]', eval('string([function("tr", d), function("tr", d)])')) + eq('[function(\'tr\', {}), function(\'tr\', {})]', eval('String([function("tr", d), function("tr", d)])')) -- Regression for “eval: Work with reference cycles in partials (self) -- properly”, results in crash. eval('extend(d, {"a": 1})') - eq('[function(\'tr\', {\'a\': 1}), function(\'tr\', {\'a\': 1})]', eval('string([function("tr", d), function("tr", d)])')) + eq('[function(\'tr\', {\'a\': 1}), function(\'tr\', {\'a\': 1})]', eval('String([function("tr", d), function("tr", d)])')) end) it('does not crash or halt when dumping partials with reference cycles in arguments', @@ -192,9 +203,9 @@ describe('string() function', function() eval('add(l, function("Test1", l))') eq(dedent([=[ - E724: unable to correctly dump variable with self-referencing container - function('Test1', [[{E724@2}, function('Test1', [{E724@2}])], function('Test1', [[{E724@4}, function('Test1', [{E724@4}])]])])]=]), - redir_exec('echo string(function("Test1", l))')) + function('Test1', [[[...@2], function('Test1', [[...@2]])], function('Test1', [[[...@4], function('Test1', [[...@4]])]])]) + function('Test1', [[[...@2], function('Test1', [[...@2]])], function('Test1', [[[...@4], function('Test1', [[...@4]])]])])]=]), + redir_exec('echo String(function("Test1", l))')) end) it('does not crash or halt when dumping partials with reference cycles in self and arguments', @@ -206,72 +217,68 @@ describe('string() function', function() eval('add(l, function("Test1", d))') eq(dedent([=[ - E724: unable to correctly dump variable with self-referencing container - {'p': function('1_Test2', [[{E724@3}, function('Test1', [{E724@3}]), function('Test1', {E724@0})], function('Test1', [[{E724@5}, function('Test1', [{E724@5}]), function('Test1', {E724@0})]]), function('Test1', {E724@0})], {E724@0}), 'f': function('1_Test2'), 'v': v:true}]=]), - redir_exec('echo string(extend(extend(g:d, {"f": g:Test2_f}), {"p": function(g:d.f, l)}))')) + {'p': function('1_Test2', [[[...@3], function('Test1', [[...@3]]), function('Test1', {...@0})], function('Test1', [[[...@5], function('Test1', [[...@5]]), function('Test1', {...@0})]]), function('Test1', {...@0})], {...@0}), 'f': function('1_Test2'), 'v': v:true} + {'p': function('1_Test2', [[[...@3], function('Test1', [[...@3]]), function('Test1', {...@0})], function('Test1', [[[...@5], function('Test1', [[...@5]]), function('Test1', {...@0})]]), function('Test1', {...@0})], {...@0}), 'f': function('1_Test2'), 'v': v:true}]=]), + redir_exec('echo String(extend(extend(g:d, {"f": g:Test2_f}), {"p": function(g:d.f, l)}))')) end) end) describe('used to represent lists', function() it('dumps empty list', function() - eq('[]', funcs.string({})) + eq('[]', funcs.String({})) end) it('dumps nested lists', function() - eq('[[[[[]]]]]', funcs.string({{{{{}}}}})) + eq('[[[[[]]]]]', funcs.String({{{{{}}}}})) end) it('dumps nested non-empty lists', function() - eq('[1, [[3, [[5], 4]], 2]]', funcs.string({1, {{3, {{5}, 4}}, 2}})) + eq('[1, [[3, [[5], 4]], 2]]', funcs.String({1, {{3, {{5}, 4}}, 2}})) end) - it('errors when dumping recursive lists', function() + it('does not error when dumping recursive lists', function() meths.set_var('l', {}) eval('add(l, l)') - eq('Vim(echo):E724: unable to correctly dump variable with self-referencing container', - exc_exec('echo string(l)')) + eq(0, exc_exec('echo String(l)')) end) - it('dumps recursive lists despite the error', function() + it('dumps recursive lists without error', function() meths.set_var('l', {}) eval('add(l, l)') - eq('\nE724: unable to correctly dump variable with self-referencing container\n[{E724@0}]', - redir_exec('echo string(l)')) - eq('\nE724: unable to correctly dump variable with self-referencing container\n[[{E724@1}]]', - redir_exec('echo string([l])')) + eq('\n[[...@0]]\n[[...@0]]', redir_exec('echo String(l)')) + eq('\n[[[...@1]]]\n[[[...@1]]]', redir_exec('echo String([l])')) end) end) describe('used to represent dictionaries', function() it('dumps empty dictionary', function() - eq('{}', eval('string({})')) + eq('{}', eval('String({})')) end) it('dumps list with two same empty dictionaries, also in partials', function() command('let d = {}') - eq('[{}, {}]', eval('string([d, d])')) - eq('[function(\'tr\', {}), {}]', eval('string([function("tr", d), d])')) - eq('[{}, function(\'tr\', {})]', eval('string([d, function("tr", d)])')) + eq('[{}, {}]', eval('String([d, d])')) + eq('[function(\'tr\', {}), {}]', eval('String([function("tr", d), d])')) + eq('[{}, function(\'tr\', {})]', eval('String([d, function("tr", d)])')) end) it('dumps non-empty dictionary', function() - eq('{\'t\'\'est\': 1}', funcs.string({['t\'est']=1})) + eq('{\'t\'\'est\': 1}', funcs.String({['t\'est']=1})) end) - it('errors when dumping recursive dictionaries', function() + it('does not error when dumping recursive dictionaries', function() meths.set_var('d', {d=1}) eval('extend(d, {"d": d})') - eq('Vim(echo):E724: unable to correctly dump variable with self-referencing container', - exc_exec('echo string(d)')) + eq(0, exc_exec('echo String(d)')) end) - it('dumps recursive dictionaries despite the error', function() + it('dumps recursive dictionaries without the error', function() meths.set_var('d', {d=1}) eval('extend(d, {"d": d})') - eq('\nE724: unable to correctly dump variable with self-referencing container\n{\'d\': {E724@0}}', - redir_exec('echo string(d)')) - eq('\nE724: unable to correctly dump variable with self-referencing container\n{\'out\': {\'d\': {E724@1}}}', - redir_exec('echo string({"out": d})')) + eq('\n{\'d\': {...@0}}\n{\'d\': {...@0}}', + redir_exec('echo String(d)')) + eq('\n{\'out\': {\'d\': {...@1}}}\n{\'out\': {\'d\': {...@1}}}', + redir_exec('echo String({"out": d})')) end) end) end) From 480598dcda990fd19900b9fe3a01f519cd9b50d0 Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 02:38:30 +0300 Subject: [PATCH 104/161] functests: Add some more :echo tests which also check for regression Fixes #6954 --- test/functional/ex_cmds/echo_spec.lua | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/test/functional/ex_cmds/echo_spec.lua b/test/functional/ex_cmds/echo_spec.lua index 06436fb87e..4936c5af8c 100644 --- a/test/functional/ex_cmds/echo_spec.lua +++ b/test/functional/ex_cmds/echo_spec.lua @@ -281,4 +281,41 @@ describe(':echo', function() redir_exec('echo String({"out": d})')) end) end) + + describe('used to represent special values', function() + local function chr(n) + return ('%c'):format(n) + end + local function ctrl(c) + return ('%c'):format(c:upper():byte() - 0x40) + end + it('displays hex as hex', function() + -- Regression: due to missing (uint8_t) cast \x80 was represented as + -- ~@<80>. + eq('<80>', funcs.String(chr(0x80))) + eq('<81>', funcs.String(chr(0x81))) + eq('<8e>', funcs.String(chr(0x8e))) + eq('', funcs.String(('«'):sub(1, 1))) + eq('«', funcs.String(('«'):sub(1, 2))) + end) + it('displays ASCII control characters using ^X notation', function() + eq('^C', funcs.String(ctrl('c'))) + eq('^A', funcs.String(ctrl('a'))) + eq('^F', funcs.String(ctrl('f'))) + end) + it('prints CR, NL and tab as-is', function() + eq('\n', funcs.String('\n')) + eq('\r', funcs.String('\r')) + eq('\t', funcs.String('\t')) + end) + it('prints non-printable UTF-8 in <> notation', function() + -- SINGLE SHIFT TWO, unicode control + eq('<8e>', funcs.String(funcs.nr2char(0x8E))) + -- Surrogate pair: U+1F0A0 PLAYING CARD BACK is represented in UTF-16 as + -- 0xD83C 0xDCA0. This is not valid in UTF-8. + eq('', funcs.String(funcs.nr2char(0xD83C))) + eq('', funcs.String(funcs.nr2char(0xDCA0))) + eq('', funcs.String(funcs.nr2char(0xD83C) .. funcs.nr2char(0xDCA0))) + end) + end) end) From 2208b64891d57a4ab79143183888149be9ee228d Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 15:15:23 +0300 Subject: [PATCH 105/161] functests: Ensure different SIDs on successive source() calls --- test/functional/ex_cmds/echo_spec.lua | 14 +++++++------- test/functional/helpers.lua | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/test/functional/ex_cmds/echo_spec.lua b/test/functional/ex_cmds/echo_spec.lua index 4936c5af8c..10c7230896 100644 --- a/test/functional/ex_cmds/echo_spec.lua +++ b/test/functional/ex_cmds/echo_spec.lua @@ -137,7 +137,7 @@ describe(':echo', function() end) it('dumps references to script functions', function() - eq('1_Test2', eval('String(Test2_f)')) + eq('2_Test2', eval('String(Test2_f)')) end) it('dumps partials with self referencing a partial', function() @@ -156,9 +156,9 @@ describe(':echo', function() end) it('dumps automatically created partials', function() - eq('function(\'1_Test2\', {\'f\': function(\'1_Test2\')})', + eq('function(\'2_Test2\', {\'f\': function(\'2_Test2\')})', eval('String({"f": Test2_f}.f)')) - eq('function(\'1_Test2\', [1], {\'f\': function(\'1_Test2\', [1])})', + eq('function(\'2_Test2\', [1], {\'f\': function(\'2_Test2\', [1])})', eval('String({"f": function(Test2_f, [1])}.f)')) end) @@ -176,8 +176,8 @@ describe(':echo', function() meths.set_var('d', {v=true}) eq(dedent([[ - {'p': function('1_Test2', {...@0}), 'f': function('1_Test2'), 'v': v:true} - {'p': function('1_Test2', {...@0}), 'f': function('1_Test2'), 'v': v:true}]]), + {'p': function('2_Test2', {...@0}), 'f': function('2_Test2'), 'v': v:true} + {'p': function('2_Test2', {...@0}), 'f': function('2_Test2'), 'v': v:true}]]), redir_exec('echo String(extend(extend(g:d, {"f": g:Test2_f}), {"p": g:d.f}))')) end) @@ -217,8 +217,8 @@ describe(':echo', function() eval('add(l, function("Test1", d))') eq(dedent([=[ - {'p': function('1_Test2', [[[...@3], function('Test1', [[...@3]]), function('Test1', {...@0})], function('Test1', [[[...@5], function('Test1', [[...@5]]), function('Test1', {...@0})]]), function('Test1', {...@0})], {...@0}), 'f': function('1_Test2'), 'v': v:true} - {'p': function('1_Test2', [[[...@3], function('Test1', [[...@3]]), function('Test1', {...@0})], function('Test1', [[[...@5], function('Test1', [[...@5]]), function('Test1', {...@0})]]), function('Test1', {...@0})], {...@0}), 'f': function('1_Test2'), 'v': v:true}]=]), + {'p': function('2_Test2', [[[...@3], function('Test1', [[...@3]]), function('Test1', {...@0})], function('Test1', [[[...@5], function('Test1', [[...@5]]), function('Test1', {...@0})]]), function('Test1', {...@0})], {...@0}), 'f': function('2_Test2'), 'v': v:true} + {'p': function('2_Test2', [[[...@3], function('Test1', [[...@3]]), function('Test1', {...@0})], function('Test1', [[[...@5], function('Test1', [[...@5]]), function('Test1', {...@0})]]), function('Test1', {...@0})], {...@0}), 'f': function('2_Test2'), 'v': v:true}]=]), redir_exec('echo String(extend(extend(g:d, {"f": g:Test2_f}), {"p": function(g:d.f, l)}))')) end) end) diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 4a170d993b..d7858cacd5 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -337,11 +337,23 @@ local function read_file(name) return ret end +local sourced_fnames = {} local function source(code) local fname = tmpname() write_file(fname, code) nvim_command('source '..fname) - os.remove(fname) + -- DO NOT REMOVE FILE HERE. + -- do_source() has a habit of checking whether files are “same” by using inode + -- and device IDs. If you run two source() calls in quick succession there is + -- a good chance that underlying filesystem will reuse the inode, making files + -- appear as “symlinks” to do_source when it checks FileIDs. With current + -- setup linux machines (both QB, travis and mine(ZyX-I) with XFS) do reuse + -- inodes, Mac OS machines (again, both QB and travis) do not. + -- + -- Files appearing as “symlinks” mean that both the first and the second + -- source() calls will use same SID, which may fail some tests which check for + -- exact numbers after `` in e.g. function names. + sourced_fnames[#sourced_fnames + 1] = fname return fname end @@ -673,6 +685,9 @@ local module = { return function(after_each) if after_each then after_each(function() + for _, fname in ipairs(sourced_fnames) do + os.remove(fname) + end check_logs() check_cores('build/bin/nvim') end) From 91b9ad7d8294532939db51db1045605abfff49c2 Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 15:41:59 +0300 Subject: [PATCH 106/161] shada: Make sure that code does not attempt to read too long items Fixes #6957 --- src/nvim/shada.c | 10 +++++++++- test/functional/helpers.lua | 9 ++++++++- test/functional/shada/errors_spec.lua | 18 ++++++++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/nvim/shada.c b/src/nvim/shada.c index 4788b1e7d0..728a3f65be 100644 --- a/src/nvim/shada.c +++ b/src/nvim/shada.c @@ -3413,7 +3413,15 @@ shada_read_next_item_start: return mru_ret; } - const size_t length = (size_t) length_u64; + if (length_u64 > PTRDIFF_MAX) { + emsgf(_(RCERR "Error while reading ShaDa file: " + "there is an item at position %" PRIu64 " " + "that is stated to be too long"), + initial_fpos); + return kSDReadStatusNotShaDa; + } + + const size_t length = (size_t)length_u64; entry->timestamp = (Timestamp) timestamp_u64; if (type_u64 == 0) { diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 4a170d993b..6baf77bd3a 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -319,7 +319,14 @@ end -- Dedent the given text and write it to the file name. local function write_file(name, text, dont_dedent) local file = io.open(name, 'w') - if not dont_dedent then + if type(text) == 'table' then + -- Byte blob + local bytes = text + text = '' + for _, char in ipairs(bytes) do + text = ('%s%c'):format(text, char) + end + elseif not dont_dedent then text = dedent(text) end file:write(text) diff --git a/test/functional/shada/errors_spec.lua b/test/functional/shada/errors_spec.lua index 2b6b26b433..66c8c4ad2f 100644 --- a/test/functional/shada/errors_spec.lua +++ b/test/functional/shada/errors_spec.lua @@ -510,4 +510,22 @@ $ .. '\nE574: Failed to write variable L', redir_exec('wshada')) end) + + it('errors with too large items', function() + wshada({ + 1, 206, 70, 90, 31, 179, 86, 133, 169, 103, 101, 110, 101, 114, 97, + 116, 111, 114, 196, 4, 145, 145, 145, 145, 145, 145, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 145, 145, 145, 145, 111, 110, 196, 25, 78, 86, 73, 77, 32, + 118, 1, 46, 50, 46, 48, 45, 51, 48, 51, 45, 103, 98, 54, 55, + 52, 102, 100, 50, 99, 169, 109, 97, 120, 95, 107, 98, 121, 116, 101, + 10, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 16, 8, 206, 89, 90, 30, 253, + 35, 129, 161, 102, 196, 30, 47, 100, 101, 118, 47, 115, 104, 109, 47, + 102, 117, 122, 122, 105, 110, 103, 45, 110, 118, 105, 109, 45, 115, 104, + 97, 100, 97, 47, 108, 115, 2, 206, 89, 90, 30, 251, 13, 130, 162, + 115, 112, 196, 3, 102, 111, 111, 162, 115, 99, 195, 3, 146, 10, 0, + }) + eq('Vim(rshada):E576: Error while reading ShaDa file: there is an item at position 93 that is stated to be too long', exc_exec(sdrcmd())) + end) end) From 2e89aaf3bdec8329537b290af1bd02de470929be Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 16:08:52 +0300 Subject: [PATCH 107/161] charset: Fix V728: excessive check --- src/nvim/charset.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/nvim/charset.c b/src/nvim/charset.c index 48db1030a6..403ef65c4f 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -981,10 +981,8 @@ int win_lbr_chartabsize(win_T *wp, char_u *line, char_u *s, colnr_T col, int *he mb_ptr_adv(s); c = *s; - if (!((c != NUL) - && (vim_isbreak(c) - || (!vim_isbreak(c) - && ((col2 == col) || !vim_isbreak(*ps)))))) { + if (!(c != NUL + && (vim_isbreak(c) || col2 == col || !vim_isbreak(*ps)))) { break; } From c930f32ab94c7d4e4a037ebb15006753dc3fa5e5 Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 16:21:17 +0300 Subject: [PATCH 108/161] socket: Silence V641: buf size is not multiple of what it is cast to --- src/nvim/event/socket.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/nvim/event/socket.c b/src/nvim/event/socket.c index a796f303ab..6f45b09fce 100644 --- a/src/nvim/event/socket.c +++ b/src/nvim/event/socket.c @@ -105,9 +105,10 @@ int socket_watcher_start(SocketWatcher *watcher, int backlog, socket_cb cb) // contain 0 in this case, unless uv_tcp_getsockname() is used first. uv_tcp_getsockname(&watcher->uv.tcp.handle, (struct sockaddr *)&sas, &(int){ sizeof(sas) }); - uint16_t port = (uint16_t)((sas.ss_family == AF_INET) - ? ((struct sockaddr_in *)&sas)->sin_port - : ((struct sockaddr_in6 *)&sas)->sin6_port); + uint16_t port = (uint16_t)( + (sas.ss_family == AF_INET) + ? (STRUCT_CAST(struct sockaddr_in, &sas))->sin_port + : (STRUCT_CAST(struct sockaddr_in6, &sas))->sin6_port); // v:servername uses the string from watcher->addr size_t len = strlen(watcher->addr); snprintf(watcher->addr+len, sizeof(watcher->addr)-len, ":%" PRIu16, @@ -247,7 +248,7 @@ tcp_retry: uv_pipe_t *pipe = &stream->uv.pipe; uv_pipe_init(&loop->uv, pipe, 0); uv_pipe_connect(&req, pipe, address, connect_cb); - uv_stream = (uv_stream_t *)pipe; + uv_stream = STRUCT_CAST(uv_stream_t, pipe); } status = 1; LOOP_PROCESS_EVENTS_UNTIL(&main_loop, NULL, timeout, status != 1); From 1f05ec95c04f7fd300ce3696b40f09e057d4fb06 Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 16:24:48 +0300 Subject: [PATCH 109/161] ex_getln: Silent V519: value is assigned twice successively MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is usual “passing data via global” false positive. --- src/nvim/ex_getln.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 7793081957..0ba6c79a71 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -306,7 +306,7 @@ static uint8_t *command_line_enter(int firstc, long count, int indent) curwin->w_cursor = s->save_cursor; setpcmark(); } - curwin->w_cursor = s->search_start; + curwin->w_cursor = s->search_start; // -V519 } curwin->w_curswant = s->old_curswant; curwin->w_leftcol = s->old_leftcol; From 63f72ac27c54d63fee049e45a5518d2d07fd379b Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 17:47:45 +0300 Subject: [PATCH 110/161] shada: Fix linter error --- src/nvim/shada.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/shada.c b/src/nvim/shada.c index 728a3f65be..736d6bf162 100644 --- a/src/nvim/shada.c +++ b/src/nvim/shada.c @@ -3422,7 +3422,7 @@ shada_read_next_item_start: } const size_t length = (size_t)length_u64; - entry->timestamp = (Timestamp) timestamp_u64; + entry->timestamp = (Timestamp)timestamp_u64; if (type_u64 == 0) { // kSDItemUnknown cannot possibly pass that far because it is -1 and that From 94bd0f9915b0515fde449e3ee003ecbff3ad1b42 Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 16:47:07 +0300 Subject: [PATCH 111/161] main: Fix V522: potential NULL dereference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is useless to use sbuffer here and print that to stdout, just using “fbuffer” instead. --- src/nvim/main.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/nvim/main.c b/src/nvim/main.c index 19a661d7db..5c0cda978f 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -766,16 +766,18 @@ static void command_line_scan(mparm_T *parmp) version(); mch_exit(0); } else if (STRICMP(argv[0] + argv_idx, "api-info") == 0) { - msgpack_sbuffer* b = msgpack_sbuffer_new(); - msgpack_packer* p = msgpack_packer_new(b, msgpack_sbuffer_write); + msgpack_packer *p = msgpack_packer_new(stdout, + msgpack_fbuffer_write); + + if (p == NULL) { + emsgf(_(e_outofmem)); + } + Object md = DICTIONARY_OBJ(api_metadata()); msgpack_rpc_from_object(md, p); - for (size_t i = 0; i < b->size; i++) { - putchar(b->data[i]); - } - msgpack_packer_free(p); + file_close(&fp, false); mch_exit(0); } else if (STRICMP(argv[0] + argv_idx, "headless") == 0) { parmp->headless = true; From 5ab9e9f617934fae8f85ceb6db398dbf1e93471d Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 17:03:07 +0300 Subject: [PATCH 112/161] os/fileio: Add msgpack_file_write function --- src/nvim/os/fileio.c | 21 +++++++++++++++++++++ test/unit/os/fileio_spec.lua | 16 ++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/src/nvim/os/fileio.c b/src/nvim/os/fileio.c index 4309ac723c..d16746b7bf 100644 --- a/src/nvim/os/fileio.c +++ b/src/nvim/os/fileio.c @@ -26,6 +26,7 @@ #include "nvim/globals.h" #include "nvim/rbuffer.h" #include "nvim/macros.h" +#include "nvim/message.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "os/fileio.c.generated.h" @@ -345,3 +346,23 @@ ptrdiff_t file_skip(FileDescriptor *const fp, const size_t size) return (ptrdiff_t)read_bytes; } + +/// Msgpack callback for writing to a file +/// +/// @param data File to write to. +/// @param[in] buf Data to write. +/// @param[in] len Length of the data to write. +/// +/// @return 0 in case of success, -1 in case of error. +int msgpack_file_write(void *data, const char *buf, size_t len) + FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT +{ + assert(len < PTRDIFF_MAX); + const ptrdiff_t written_bytes = file_write((FileDescriptor *)data, buf, len); + if (written_bytes < 0) { + emsgf(_("E5420: Failed to write to file: %s"), + os_strerror((int)written_bytes)); + return -1; + } + return 0; +} diff --git a/test/unit/os/fileio_spec.lua b/test/unit/os/fileio_spec.lua index e3c8e616ce..a33a9637ee 100644 --- a/test/unit/os/fileio_spec.lua +++ b/test/unit/os/fileio_spec.lua @@ -62,6 +62,10 @@ local function file_write(fp, buf) return m.file_write(fp, buf, #buf) end +local function msgpack_file_write(fp, buf) + return m.msgpack_file_write(fp, buf, #buf) +end + local function file_read(fp, size) local buf = nil if size == nil then @@ -393,6 +397,18 @@ describe('file_write', function() end) end) +describe('msgpack_file_write', function() + itp('can write the whole file at once', function() + local err, fp = file_open(filec, m.kFileCreateOnly, 384) + eq(0, err) + eq(true, fp.wr) + local wr = msgpack_file_write(fp, fcontents) + eq(0, wr) + eq(0, m.file_close(fp, false)) + eq(fcontents, io.open(filec):read('*a')) + end) +end) + describe('file_skip', function() itp('can skip 3 bytes', function() local err, fp = file_open(file1, 0, 384) From 72b3fd96642e7b2c268e17953de3b2ed995eb3b4 Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 17:08:43 +0300 Subject: [PATCH 113/161] os/fileio: Add ability to use os/fileio.c for file descriptors Code imported from #6299 --- src/nvim/os/fileio.c | 46 +++++++++++++++++++++++++++-- test/unit/os/fileio_spec.lua | 56 +++++++++++++++++++++++++++++++++++- 2 files changed, 98 insertions(+), 4 deletions(-) diff --git a/src/nvim/os/fileio.c b/src/nvim/os/fileio.c index d16746b7bf..0ed0ae87e3 100644 --- a/src/nvim/os/fileio.c +++ b/src/nvim/os/fileio.c @@ -49,7 +49,6 @@ int file_open(FileDescriptor *const ret_fp, const char *const fname, FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT { int os_open_flags = 0; - int fd; TriState wr = kNone; // -V:FLAG:501 #define FLAG(flags, flag, fcntl_flags, wrval, cond) \ @@ -74,14 +73,35 @@ int file_open(FileDescriptor *const ret_fp, const char *const fname, FLAG(flags, kFileNoSymlink, O_NOFOLLOW, kNone, true); #endif #undef FLAG + // wr is used for kFileReadOnly flag, but on + // QB:neovim-qb-slave-ubuntu-12-04-64bit it still errors out with + // `error: variable ‘wr’ set but not used [-Werror=unused-but-set-variable]` + (void)wr; - fd = os_open(fname, os_open_flags, mode); + const int fd = os_open(fname, os_open_flags, mode); if (fd < 0) { return fd; } + return file_open_fd(ret_fp, fd, (wr == kTrue)); +} - ret_fp->wr = (wr == kTrue); +/// Wrap file descriptor with FileDescriptor structure +/// +/// @warning File descriptor wrapped like this must not be accessed by other +/// means. +/// +/// @param[out] ret_fp Address where information needed for reading from or +/// writing to a file is saved +/// @param[in] fd File descriptor to wrap. +/// @param[in] wr True if fd is opened for writing only, false if it is read +/// only. +/// +/// @return Error code (@see os_strerror()) or 0. Currently always returns 0. +int file_open_fd(FileDescriptor *const ret_fp, const int fd, const bool wr) + FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT +{ + ret_fp->wr = wr; ret_fp->fd = fd; ret_fp->eof = false; ret_fp->rv = rbuffer_new(kRWBufferSize); @@ -115,6 +135,26 @@ FileDescriptor *file_open_new(int *const error, const char *const fname, return fp; } +/// Like file_open_fd(), but allocate and return ret_fp +/// +/// @param[out] error Error code, @see os_strerror(). Is set to zero on +/// success. +/// @param[in] fd File descriptor to wrap. +/// @param[in] wr True if fd is opened for writing only, false if it is read +/// only. +/// +/// @return [allocated] Opened file or NULL in case of error. +FileDescriptor *file_open_fd_new(int *const error, const int fd, const bool wr) + FUNC_ATTR_NONNULL_ALL FUNC_ATTR_MALLOC FUNC_ATTR_WARN_UNUSED_RESULT +{ + FileDescriptor *const fp = xmalloc(sizeof(*fp)); + if ((*error = file_open_fd(fp, fd, wr)) != 0) { + xfree(fp); + return NULL; + } + return fp; +} + /// Close file and free its buffer /// /// @param[in,out] fp File to close. diff --git a/test/unit/os/fileio_spec.lua b/test/unit/os/fileio_spec.lua index a33a9637ee..d9c98e8afa 100644 --- a/test/unit/os/fileio_spec.lua +++ b/test/unit/os/fileio_spec.lua @@ -6,8 +6,10 @@ local itp = helpers.gen_itp(it) local eq = helpers.eq local ffi = helpers.ffi local cimport = helpers.cimport +local cppimport = helpers.cppimport -local m = cimport('./src/nvim/os/fileio.h') +local m = cimport('./src/nvim/os/os.h', './src/nvim/os/fileio.h') +cppimport('fcntl.h') local fcontents = '' for i = 0, 255 do @@ -58,6 +60,18 @@ local function file_open_new(fname, flags, mode) return ret1[0], ret2 end +local function file_open_fd(fd, flags) + local ret2 = ffi.new('FileDescriptor') + local ret1 = m.file_open_fd(ret2, fd, flags) + return ret1, ret2 +end + +local function file_open_fd_new(fd, flags) + local ret1 = ffi.new('int[?]', 1, {0}) + local ret2 = ffi.gc(m.file_open_fd_new(ret1, fd, flags), nil) + return ret1[0], ret2 +end + local function file_write(fp, buf) return m.file_write(fp, buf, #buf) end @@ -96,6 +110,46 @@ local function file_skip(fp, size) return m.file_skip(fp, size) end +describe('file_open_fd', function() + itp('can use file descriptor returned by os_open for reading', function() + local fd = m.os_open(file1, m.kO_RDONLY, 0) + local err, fp = file_open_fd(fd, false) + eq(0, err) + eq({#fcontents, fcontents}, {file_read(fp, #fcontents)}) + eq(0, m.file_close(fp, false)) + end) + itp('can use file descriptor returned by os_open for writing', function() + eq(nil, lfs.attributes(filec)) + local fd = m.os_open(filec, m.kO_WRONLY + m.kO_CREAT, 384) + local err, fp = file_open_fd(fd, true) + eq(0, err) + eq(4, file_write(fp, 'test')) + eq(0, m.file_close(fp, false)) + eq(4, lfs.attributes(filec).size) + eq('test', io.open(filec):read('*a')) + end) +end) + +describe('file_open_fd_new', function() + itp('can use file descriptor returned by os_open for reading', function() + local fd = m.os_open(file1, m.kO_RDONLY, 0) + local err, fp = file_open_fd_new(fd, false) + eq(0, err) + eq({#fcontents, fcontents}, {file_read(fp, #fcontents)}) + eq(0, m.file_free(fp, false)) + end) + itp('can use file descriptor returned by os_open for writing', function() + eq(nil, lfs.attributes(filec)) + local fd = m.os_open(filec, m.kO_WRONLY + m.kO_CREAT, 384) + local err, fp = file_open_fd_new(fd, true) + eq(0, err) + eq(4, file_write(fp, 'test')) + eq(0, m.file_free(fp, false)) + eq(4, lfs.attributes(filec).size) + eq('test', io.open(filec):read('*a')) + end) +end) + describe('file_open', function() itp('can create a rwx------ file with kFileCreate', function() local err, fp = file_open(filec, m.kFileCreate, 448) From f0b3029ad33cbba284c4e677a08b0e2488bf062b Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 17:12:00 +0300 Subject: [PATCH 114/161] os: Add OS_STD*_FILENO constants --- src/nvim/os/os_defs.h | 7 +++++++ src/nvim/os/win_defs.h | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/nvim/os/os_defs.h b/src/nvim/os/os_defs.h index f81785675e..923a362b41 100644 --- a/src/nvim/os/os_defs.h +++ b/src/nvim/os/os_defs.h @@ -13,6 +13,13 @@ # include "nvim/os/unix_defs.h" #endif +/// File descriptor number used for standard IO streams +enum { + OS_STDIN_FILENO = STDIN_FILENO, + OS_STDOUT_FILENO = STDOUT_FILENO, + OS_STDERR_FILENO = STDERR_FILENO, +}; + #define BASENAMELEN (NAME_MAX - 5) // Use the system path length if it makes sense. diff --git a/src/nvim/os/win_defs.h b/src/nvim/os/win_defs.h index 7c980c3768..7ed70f6092 100644 --- a/src/nvim/os/win_defs.h +++ b/src/nvim/os/win_defs.h @@ -91,4 +91,14 @@ typedef SSIZE_T ssize_t; # define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) #endif +#ifndef STDIN_FILENO +# define STDIN_FILENO 0 +#endif +#ifndef STDOUT_FILENO +# define STDOUT_FILENO 1 +#endif +#ifndef STDERR_FILENO +# define STDERR_FILENO 2 +#endif + #endif // NVIM_OS_WIN_DEFS_H From 605c8fb49cac3d9e8b3621fd4dfe55b882b85247 Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 17:20:00 +0300 Subject: [PATCH 115/161] =?UTF-8?q?main:=20Use=20msgpack=5Ffile=5Fwrite=20?= =?UTF-8?q?in=20place=20of=20=E2=80=9Cfbuffer=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apparently the latter is not a part of the public C API. --- src/nvim/main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/nvim/main.c b/src/nvim/main.c index 5c0cda978f..f55f876608 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -57,6 +57,7 @@ #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/os/time.h" +#include "nvim/os/fileio.h" #include "nvim/event/loop.h" #include "nvim/os/signal.h" #include "nvim/event/process.h" @@ -766,8 +767,13 @@ static void command_line_scan(mparm_T *parmp) version(); mch_exit(0); } else if (STRICMP(argv[0] + argv_idx, "api-info") == 0) { - msgpack_packer *p = msgpack_packer_new(stdout, - msgpack_fbuffer_write); + FileDescriptor fp; + const int fof_ret = file_open_fd(&fp, OS_STDOUT_FILENO, true); + msgpack_packer *p = msgpack_packer_new(&fp, msgpack_file_write); + + if (fof_ret != 0) { + emsgf(_("E5421: Failed to open stdin: %s"), os_strerror(fof_ret)); + } if (p == NULL) { emsgf(_(e_outofmem)); From 6552768c4faa1fcc81be49859815966123476e04 Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 17:26:08 +0300 Subject: [PATCH 116/161] normal: Fix V728: excessive check --- src/nvim/normal.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 39cd2c6631..d891c74fd2 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -1451,9 +1451,8 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank) /* Never redo "zf" (define fold). */ if ((vim_strchr(p_cpo, CPO_YANK) != NULL || oap->op_type != OP_YANK) && ((!VIsual_active || oap->motion_force) - /* Also redo Operator-pending Visual mode mappings */ - || (VIsual_active && cap->cmdchar == ':' - && oap->op_type != OP_COLON)) + // Also redo Operator-pending Visual mode mappings. + || (cap->cmdchar == ':' && oap->op_type != OP_COLON)) && cap->cmdchar != 'D' && oap->op_type != OP_FOLD && oap->op_type != OP_FOLDOPEN From f81d1ce003010892859898ec0436f81a883d4f3c Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 17:28:33 +0300 Subject: [PATCH 117/161] regexp: Silence V595: potential null dereference The code uses 2-iteration loop antipattern: retval is NULL on first iteration, not NULL on second, yet this is still a false positive. --- src/nvim/regexp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 5448cc7131..41070aebf4 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -6928,9 +6928,10 @@ char_u *reg_submatch(int no) STRNCPY(retval + len, reg_getline_submatch(lnum), submatch_mmatch->endpos[no].col); len += submatch_mmatch->endpos[no].col; - if (round == 2) - retval[len] = NUL; - ++len; + if (round == 2) { + retval[len] = NUL; // -V595 + } + len++; } if (retval == NULL) { From 4cb63179008efbbef2f4134da448ae5bd7251281 Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 17:29:57 +0300 Subject: [PATCH 118/161] spell: Fix V728: excessive check --- src/nvim/spell.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 25ae562e65..5785ee1a00 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -1433,12 +1433,10 @@ spell_move_to ( // the cursor. if (dir == BACKWARD || lnum != wp->w_cursor.lnum - || (lnum == wp->w_cursor.lnum - && (wrapped - || ((colnr_T)(curline - ? p - buf + (ptrdiff_t)len - : p - buf) - > wp->w_cursor.col)))) { + || wrapped + || ((colnr_T)(curline + ? p - buf + (ptrdiff_t)len + : p - buf) > wp->w_cursor.col)) { if (has_syntax) { col = (int)(p - buf); (void)syn_get_id(wp, lnum, (colnr_T)col, From aaab5e39005ab5a1273092ae4cef7f1a27a5097a Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 17:31:45 +0300 Subject: [PATCH 119/161] spell: Silence V512: buffer underflow --- src/nvim/spell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 5785ee1a00..715228cb4b 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -3633,7 +3633,7 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so // word). depth = 0; sp = &stack[0]; - memset(sp, 0, sizeof(trystate_T)); + memset(sp, 0, sizeof(trystate_T)); // -V512 sp->ts_curi = 1; if (soundfold) { From af1f17f1dcd68ce75cfe06a0ebcb3b34d85f98bf Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 17:39:26 +0300 Subject: [PATCH 120/161] syntax: Fix V763: parameter always rewritten before being used This is the result of malloc error handling elimination: push_current_state() used to (not) return OK depending on whether growing garray failed or not and this return was checked, if errorred out push_next_match() will simply return its argument unchanged. Now when allocations are supposed to either always succeed or crash Neovim this check was returned, push_current_state() was stripped of its return value and moved out of if() condition, resulting in V763. --- src/nvim/syntax.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index a4bb260183..f0171fa525 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -1666,8 +1666,9 @@ syn_current_attr ( * If we found a match after the last column, use it. */ if (next_match_idx >= 0 && next_match_col >= (int)current_col - && next_match_col != MAXCOL) - (void)push_next_match(NULL); + && next_match_col != MAXCOL) { + (void)push_next_match(); + } current_finished = TRUE; current_state_stored = FALSE; @@ -1985,9 +1986,10 @@ syn_current_attr ( * endless loop). */ GA_APPEND(int, &zero_width_next_ga, next_match_idx); next_match_idx = -1; - } else - cur_si = push_next_match(cur_si); - found_match = TRUE; + } else { + cur_si = push_next_match(); + } + found_match = true; } } } @@ -2167,9 +2169,10 @@ static int did_match_already(int idx, garray_T *gap) /* * Push the next match onto the stack. */ -static stateitem_T *push_next_match(stateitem_T *cur_si) +static stateitem_T *push_next_match(void) { - synpat_T *spp; + stateitem_T *cur_si; + synpat_T *spp; int save_flags; spp = &(SYN_ITEMS(syn_block)[next_match_idx]); From 28f6bd822b26ae92701ca553d29693d35864753f Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 17:42:10 +0300 Subject: [PATCH 121/161] terminal: Silence -V666 error: value not correspond with string length Looks like calling this function below with 4-character first strings made PVS think that OPT_LOCAL (it is equal to 4) is a string length. --- src/nvim/terminal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index 1882f263db..099f49f09b 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -229,7 +229,7 @@ Terminal *terminal_open(TerminalOptions opts) rv->invalid_start = 0; rv->invalid_end = opts.height; refresh_screen(rv, curbuf); - set_option_value("buftype", 0, "terminal", OPT_LOCAL); + set_option_value("buftype", 0, "terminal", OPT_LOCAL); // -V666 // Default settings for terminal buffers curbuf->b_p_ma = false; // 'nomodifiable' From aa3e3b4ca641cd87b1c051f740f16bd11f57197d Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 19:22:48 +0300 Subject: [PATCH 122/161] pvscheck: Add --environment-cc switch To be used to make bot-ci able to use clang-4.0 without hacks. [ci skip] --- scripts/pvscheck.sh | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/scripts/pvscheck.sh b/scripts/pvscheck.sh index dfdc539bf9..e4536b3dce 100755 --- a/scripts/pvscheck.sh +++ b/scripts/pvscheck.sh @@ -19,8 +19,11 @@ get_jobs_num() { help() { echo 'Usage:' - echo ' pvscheck.sh [--pvs URL] [--deps] [target-directory [branch]]' - echo ' pvscheck.sh [--pvs URL] [--recheck|--only-analyse] [target-directory]' + echo ' pvscheck.sh [--pvs URL] [--deps] [--environment-cc]' + echo ' [target-directory [branch]]' + echo ' pvscheck.sh [--pvs URL] [--recheck] [--environment-cc]' + echo ' [target-directory]' + echo ' pvscheck.sh [--pvs URL] --only-analyse [target-directory]' echo ' pvscheck.sh [--pvs URL] --pvs-install {target-directory}' echo ' pvscheck.sh --patch [--only-build]' echo @@ -35,6 +38,9 @@ help() { echo ' Without this it assumes all dependencies are already' echo ' installed.' echo + echo ' --environment-cc: (for regular run and --recheck) Do not export' + echo ' CC=clang. Build is still run with CFLAGS=-O0.' + echo echo ' --only-build: (for --patch) Only patch files in ./build directory.' echo echo ' --pvs-install: Only install PVS-studio to the specified location.' @@ -270,8 +276,11 @@ install_pvs() {( create_compile_commands() {( local tgt="$1" ; shift local deps="$1" ; shift + local environment_cc="$1" ; shift - export CC=clang + if test -z "$environment_cc" ; then + export CC=clang + fi export CFLAGS=' -O0 ' if test -z "$deps" ; then @@ -356,19 +365,21 @@ do_check() { local branch="$1" ; shift local pvs_url="$1" ; shift local deps="$1" ; shift + local environment_cc="$1" ; shift git clone --branch="$branch" . "$tgt" install_pvs "$tgt" "$pvs_url" - do_recheck "$tgt" "$deps" + do_recheck "$tgt" "$deps" "$environment_cc" } do_recheck() { local tgt="$1" ; shift local deps="$1" ; shift + local environment_cc="$1" ; shift - create_compile_commands "$tgt" "$deps" + create_compile_commands "$tgt" "$deps" "$environment_cc" do_analysis "$tgt" } @@ -408,6 +419,7 @@ main() { only-analyse store_const \ pvs-install store_const \ deps store_const \ + environment-cc store_const \ -- \ 'modify realdir tgt "$PWD/../neovim-pvs"' \ 'store branch master' \ @@ -426,11 +438,11 @@ main() { elif test -n "$pvs_install" ; then install_pvs "$tgt" "$pvs_url" elif test -n "$recheck" ; then - do_recheck "$tgt" "$deps" + do_recheck "$tgt" "$deps" "$environment_cc" elif test -n "$only_analyse" ; then do_analysis "$tgt" else - do_check "$tgt" "$branch" "$pvs_url" "$deps" + do_check "$tgt" "$branch" "$pvs_url" "$deps" "$environment_cc" fi } From 7109f63e3cf70ffc4581f3dfb6132632413e4817 Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 19:48:26 +0300 Subject: [PATCH 123/161] main: Flush file in place of closing it, also do error reporting Apparently on travis OS X systems it crashes when cleaning up streams with stdout closed: (lldb) bt all * thread #1: tid = 0x0000, 0x00007fff8703df06 libsystem_kernel.dylib`__pthread_kill + 10, stop reason = signal SIGSTOP * frame #0: 0x00007fff8703df06 libsystem_kernel.dylib`__pthread_kill + 10 frame #1: 0x00007fff93a764ec libsystem_pthread.dylib`pthread_kill + 90 frame #2: 0x00007fff97c056df libsystem_c.dylib`abort + 129 frame #3: 0x00007fff97bccdd8 libsystem_c.dylib`__assert_rtn + 321 frame #4: 0x0000000107a4e106 nvim`uv__close(fd=) + 102 at core.c:521 frame #5: 0x0000000107a5307d nvim`uv__loop_close(loop=0x00007fff5847c018) + 77 at loop.c:118 frame #6: 0x0000000107a4d149 nvim`uv_loop_close(loop=0x00007fff5847c018) + 57 at uv-common.c:626 frame #7: 0x000000010783e5bc nvim`stream_set_blocking(fd=0, blocking=true) + 204 at stream.c:34 frame #8: 0x000000010795d66b nvim`mch_exit(r=0) + 91 at os_unix.c:147 frame #9: 0x00000001078d5663 nvim`command_line_scan(parmp=0x00007fff5847c760) + 1779 at main.c:787 frame #10: 0x00000001078d4393 nvim`main(argc=2, argv=0x00007fff5847c898) + 163 at main.c:249 frame #11: 0x00007fff8cdd65ad libdyld.dylib`start + 1 frame #12: 0x00007fff8cdd65ad libdyld.dylib`start + 1 --- src/nvim/main.c | 5 ++++- src/nvim/os/fileio.c | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/nvim/main.c b/src/nvim/main.c index f55f876608..7dcf00c26b 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -783,7 +783,10 @@ static void command_line_scan(mparm_T *parmp) msgpack_rpc_from_object(md, p); msgpack_packer_free(p); - file_close(&fp, false); + const int ff_ret = file_flush(&fp); + if (ff_ret < 0) { + msgpack_file_write_error(ff_ret); + } mch_exit(0); } else if (STRICMP(argv[0] + argv_idx, "headless") == 0) { parmp->headless = true; diff --git a/src/nvim/os/fileio.c b/src/nvim/os/fileio.c index 0ed0ae87e3..5d68473982 100644 --- a/src/nvim/os/fileio.c +++ b/src/nvim/os/fileio.c @@ -400,9 +400,18 @@ int msgpack_file_write(void *data, const char *buf, size_t len) assert(len < PTRDIFF_MAX); const ptrdiff_t written_bytes = file_write((FileDescriptor *)data, buf, len); if (written_bytes < 0) { - emsgf(_("E5420: Failed to write to file: %s"), - os_strerror((int)written_bytes)); - return -1; + return msgpack_file_write_error((int)written_bytes); } return 0; } + +/// Print error which occurs when failing to write msgpack data +/// +/// @param[in] error Error code of the error to print. +/// +/// @return -1 (error return for msgpack_packer callbacks). +int msgpack_file_write_error(const int error) +{ + emsgf(_("E5420: Failed to write to file: %s"), os_strerror(error)); + return -1; +} From ce30998221a53e208a6a68b4b0a3f76db9a5eac3 Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 4 Jul 2017 20:05:32 +0300 Subject: [PATCH 124/161] bufhl_defs: Silence V512: buffer underflow --- src/nvim/bufhl_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/bufhl_defs.h b/src/nvim/bufhl_defs.h index 24bd6b7f29..14b1afa7d9 100644 --- a/src/nvim/bufhl_defs.h +++ b/src/nvim/bufhl_defs.h @@ -29,6 +29,6 @@ typedef struct { } BufhlLineInfo; #define BUFHL_CMP(a, b) ((int)(((a)->line - (b)->line))) -KBTREE_INIT(bufhl, BufhlLine *, BUFHL_CMP, 10) +KBTREE_INIT(bufhl, BufhlLine *, BUFHL_CMP, 10) // -V512 typedef kbtree_t(bufhl) BufhlInfo; #endif // NVIM_BUFHL_DEFS_H From e4dc878f8930e4c41f1ef4fc59fea567d98b76b1 Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Mon, 3 Apr 2017 17:00:47 +0100 Subject: [PATCH 125/161] options: Default to 'ttimeout' and 'ttimeoutlen=50' This gives libtermkey 50msec to reassemble split multibyte sequences like DCSes. --- runtime/doc/options.txt | 4 ++-- src/nvim/options.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index bb5cfb4a80..8506418c6c 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -6272,7 +6272,7 @@ A jump table for the options with a short description can be found at |Q_op|. for any key that can follow in a mapping. *'ttimeout'* *'nottimeout'* -'ttimeout' boolean (default off) +'ttimeout' boolean (default on) global This option and 'ttimeoutlen' determine the behavior when part of a key code sequence has been received by the terminal UI. For example, @@ -6287,7 +6287,7 @@ A jump table for the options with a short description can be found at |Q_op|. complete. *'ttimeoutlen'* *'ttm'* -'ttimeoutlen' 'ttm' number (default -1) +'ttimeoutlen' 'ttm' number (default 50) global The time in milliseconds that is waited for a key code sequence to complete. Also used for CTRL-\ CTRL-N and CTRL-\ CTRL-G diff --git a/src/nvim/options.lua b/src/nvim/options.lua index c2778a6329..103227f6b5 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -2513,14 +2513,14 @@ return { vi_def=true, vim=true, varname='p_ttimeout', - defaults={if_true={vi=false}} + defaults={if_true={vi=true}} }, { full_name='ttimeoutlen', abbreviation='ttm', type='number', scope={'global'}, vi_def=true, varname='p_ttm', - defaults={if_true={vi=-1}} + defaults={if_true={vi=50}} }, { full_name='ttyfast', abbreviation='tf', From de8a9f6c338b5264d5204e7ce47eb6972eb1e783 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Thu, 15 Jun 2017 20:23:52 +0100 Subject: [PATCH 126/161] tui: Coding style changes only Per warnings about house style from automated tools. --- src/nvim/tui/tui.c | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index a85f119ef4..7616299a19 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -55,7 +55,9 @@ // separator. bool terminfo_is_term_family(const char *term, const char *family) { - if (!term) return false; + if (!term) { + return false; + } size_t tlen = strlen(term); size_t flen = strlen(family); return tlen >= flen @@ -158,7 +160,8 @@ UI *tui_start(void) return ui_bridge_attach(ui, tui_main, tui_scheduler); } -static size_t unibi_pre_fmt_str(TUIData *data, unsigned int unibi_index, char * buf, size_t len) +static size_t unibi_pre_fmt_str(TUIData *data, unsigned int unibi_index, + char * buf, size_t len) { const char *str = unibi_get_str(data->ut, unibi_index); if (!str) { @@ -218,8 +221,10 @@ static void terminfo_start(UI *ui) data->immediate_wrap_after_last_column = terminfo_is_term_family(term, "cygwin") || terminfo_is_term_family(term, "interix"); - data->normlen = unibi_pre_fmt_str(data, unibi_cursor_normal, data->norm, sizeof data->norm); - data->invislen = unibi_pre_fmt_str(data, unibi_cursor_invisible, data->invis, sizeof data->invis); + data->normlen = unibi_pre_fmt_str(data, unibi_cursor_normal, + data->norm, sizeof data->norm); + data->invislen = unibi_pre_fmt_str(data, unibi_cursor_invisible, + data->invis, sizeof data->invis); // Set 't_Co' from the result of unibilium & fix_terminfo. t_colors = unibi_get_num(data->ut, unibi_max_colors); // Enter alternate screen and clear @@ -630,7 +635,7 @@ static void clear_region(UI *ui, int top, int bot, int left, int right) if (!cleared) { // iterate through each line and clear with clr_eol - for (int row = top; row <= bot; ++row) { + for (int row = top; row <= bot; row++) { cursor_goto(ui, row, left); unibi_out(ui, unibi_clr_eol); } @@ -1219,7 +1224,7 @@ static void unibi_set_if_empty(unibi_term *ut, enum unibi_string str, static int unibi_find_ext_str(unibi_term *ut, const char *name) { size_t max = unibi_count_ext_str(ut); - for (size_t i = 0; i < max; ++i) { + for (size_t i = 0; i < max; i++) { const char * n = unibi_get_ext_str_name(ut, i); if (n && 0 == strcmp(n, name)) { return (int)i; @@ -1229,9 +1234,9 @@ static int unibi_find_ext_str(unibi_term *ut, const char *name) } static int unibi_find_ext_bool(unibi_term *ut, const char *name) - { +{ size_t max = unibi_count_ext_bool(ut); - for (size_t i = 0; i < max; ++i) { + for (size_t i = 0; i < max; i++) { const char * n = unibi_get_ext_bool_name(ut, i); if (n && 0 == strcmp(n, name)) { return (int)i; @@ -1287,7 +1292,8 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, } if (linuxvt && strlen(fix_normal) >= (sizeof LINUXSET0C - 1) - && !memcmp(strchr(fix_normal,0) - (sizeof LINUXSET0C - 1), LINUXSET0C, sizeof LINUXSET0C - 1)) { + && !memcmp(strchr(fix_normal, 0) - (sizeof LINUXSET0C - 1), + LINUXSET0C, sizeof LINUXSET0C - 1)) { // The Linux terminfo entry similarly includes a Linux-idiosyncractic // cursor shape reset in cnorm, which similarly interferes with // set_cursor_style. @@ -1298,7 +1304,8 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, if (fix_invisible) { if (linuxvt && strlen(fix_invisible) >= (sizeof LINUXSET1C - 1) - && !memcmp(strchr(fix_invisible,0) - (sizeof LINUXSET1C - 1), LINUXSET1C, sizeof LINUXSET1C - 1)) { + && !memcmp(strchr(fix_invisible, 0) - (sizeof LINUXSET1C - 1), + LINUXSET1C, sizeof LINUXSET1C - 1)) { // The Linux terminfo entry similarly includes a Linux-idiosyncractic // cursor shape reset in cinvis, which similarly interferes with // set_cursor_style. @@ -1401,7 +1408,8 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, unibi_set_num(ut, unibi_max_colors, 256); unibi_set_str(ut, unibi_set_a_foreground, XTERM_SETAF_256); unibi_set_str(ut, unibi_set_a_background, XTERM_SETAB_256); - } else if (konsole || xterm || gnome || rxvt || st || putty + } else + if (konsole || xterm || gnome || rxvt || st || putty || linuxvt // Linux 4.8+ supports 256-colour SGR. || mate_pretending_xterm || gnome_pretending_xterm || tmux || tmux_pretending_screen @@ -1450,8 +1458,10 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, data->unibi_ext.reset_cursor_style = (int)unibi_add_ext_str(ut, "Se", ""); } - unibi_set_ext_str(ut, (size_t)data->unibi_ext.reset_cursor_style, "\x1b[ q"); - } else if (putty // per MinTTY 0.4.3-1 release notes from 2009 + unibi_set_ext_str(ut, (size_t)data->unibi_ext.reset_cursor_style, + "\x1b[ q"); + } else + if (putty // per MinTTY 0.4.3-1 release notes from 2009 // per https://bugzilla.gnome.org/show_bug.cgi?id=720821 || (vte_version >= 3900) // per tmux manual page and per @@ -1468,7 +1478,8 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, data->unibi_ext.reset_cursor_style = (int)unibi_add_ext_str(ut, "Se", ""); } - unibi_set_ext_str(ut, (size_t)data->unibi_ext.reset_cursor_style, "\x1b[ q"); + unibi_set_ext_str(ut, (size_t)data->unibi_ext.reset_cursor_style, + "\x1b[ q"); } else if (linuxvt) { // Linux uses an idiosyncratic escape code to set the cursor shape and does // not support DECSCUSR. @@ -1490,7 +1501,8 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, data->unibi_ext.reset_cursor_style = (int)unibi_add_ext_str(ut, "Se", ""); } - unibi_set_ext_str(ut, (size_t)data->unibi_ext.reset_cursor_style, "\x1b[?c"); + unibi_set_ext_str(ut, (size_t)data->unibi_ext.reset_cursor_style, + "\x1b[?c"); } else if (konsole) { // Konsole uses an idiosyncratic escape code to set the cursor shape and // does not support DECSCUSR. This makes Konsole set up and apply a @@ -1660,7 +1672,8 @@ static void flush_buf(UI *ui, bool toggle_cursor) data->is_invisible = data->busy; } - uv_write(&req, STRUCT_CAST(uv_stream_t, &data->output_handle), bufs, (unsigned)(bufp - bufs), NULL); + uv_write(&req, STRUCT_CAST(uv_stream_t, &data->output_handle), + bufs, (unsigned)(bufp - bufs), NULL); uv_run(&data->write_loop, UV_RUN_DEFAULT); data->bufpos = 0; } From 5701165f06104c341dce9f19ba8437676139892b Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Fri, 16 Jun 2017 15:04:39 +0100 Subject: [PATCH 127/161] tui: Switch terminal keyboard mode properly. The terminfo doco explicitly states that it covers the case where the terminal is in application cursor/keypad (i.e. "keypad transmit") mode, and not where it is in normal cursor/keypad (i.e. "keypad local") mode. Full screen applications like nvim must switch to and from keypad transmit mode when expecting the control sequences given by terminfo. --- src/nvim/tui/tui.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 7616299a19..61fe1bb361 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -230,6 +230,7 @@ static void terminfo_start(UI *ui) // Enter alternate screen and clear // NOTE: Do this *before* changing terminal settings. #6433 unibi_out(ui, unibi_enter_ca_mode); + unibi_out(ui, unibi_keypad_xmit); unibi_out(ui, unibi_clear_screen); // Enable bracketed paste unibi_out(ui, data->unibi_ext.enable_bracketed_paste); @@ -258,6 +259,7 @@ static void terminfo_stop(UI *ui) unibi_out(ui, unibi_exit_attribute_mode); // cursor should be set to normal before exiting alternate screen unibi_out(ui, unibi_cursor_normal); + unibi_out(ui, unibi_keypad_local); unibi_out(ui, unibi_exit_ca_mode); // Disable bracketed paste unibi_out(ui, data->unibi_ext.disable_bracketed_paste); From 852f21ed0587195fa1b1f2cf0b3b89e6cb03e676 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Fri, 16 Jun 2017 15:16:11 +0100 Subject: [PATCH 128/161] tui: Coding style changes only Per warnings about house style from automated tools. --- src/nvim/tui/terminfo.c | 40 ++++++++++++++++++++++++++-------------- src/nvim/tui/tui.c | 25 +++++++++++++------------ 2 files changed, 39 insertions(+), 26 deletions(-) diff --git a/src/nvim/tui/terminfo.c b/src/nvim/tui/terminfo.c index 9492f3ddb1..ac1bdaa6bb 100644 --- a/src/nvim/tui/terminfo.c +++ b/src/nvim/tui/terminfo.c @@ -26,13 +26,13 @@ static const signed char xterm_256colour_terminfo[] = { // This is an 256-colour terminfo description that lacks // status line capabilities that tmux actually has. static const signed char tmux_256colour_terminfo[] = { - 26, 1, 56, 0, 15, 0, 15, 0, 105, 1, -48, 2, 116, 109, 117, 120, 124, 86, 84, 32, 49, 48, 48, 47, 65, 78, 83, 73, 32, 88, 51, 46, 54, 52, 32, 118, 105, 114, 116, 117, 97, 108, 32, 116, 101, 114, 109, 105, 110, 97, 108, 32, 119, 105, 116, 104, 32, 50, 53, 54, 32, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, 0, 0, 4, 0, 6, 0, 8, 0, 25, 0, 30, 0, 37, 0, 41, 0, -1, -1, -1, -1, 45, 0, 62, 0, 64, 0, 68, 0, 75, 0, -1, -1, 77, 0, 89, 0, -1, -1, 93, 0, 96, 0, 102, 0, 106, 0, -1, -1, -1, -1, 110, 0, 112, 0, 117, 0, 122, 0, -1, -1, -1, -1, 123, 0, -1, -1, -1, -1, -128, 0, -123, 0, -118, 0, -1, -1, -113, 0, -111, 0, -106, 0, -1, -1, -105, 0, -100, 0, -94, 0, -88, 0, -1, -1, -1, -1, -1, -1, -85, 0, -1, -1, -1, -1, -1, -1, -81, 0, -1, -1, -77, 0, -1, -1, -1, -1, -1, -1, -75, 0, -1, -1, -70, 0, -1, -1, -1, -1, -1, -1, -1, -1, -66, 0, -62, 0, -56, 0, -52, 0, -48, 0, -44, 0, -38, 0, -32, 0, -26, 0, -20, 0, -14, 0, -9, 0, -1, -1, -4, 0, -1, -1, 0, 1, 5, 1, 10, 1, -1, -1, -1, -1, -1, -1, 14, 1, 18, 1, 26, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 1, -1, -1, 37, 1, 46, 1, 55, 1, 64, 1, -1, -1, 73, 1, 82, 1, 91, 1, -1, -1, 100, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 109, 1, -1, -1, -1, -1, 126, 1, -1, -1, -127, 1, -124, 1, -122, 1, -119, 1, -46, 1, -1, -1, -43, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -41, 1, -1, -1, 24, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 28, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 40, 2, 46, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 57, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 66, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 71, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 77, 2, -1, -1, -1, -1, -1, -1, 81, 2, -112, 2, 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 51, 52, 104, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, 27, 77, 0, 27, 91, 51, 52, 108, 0, 27, 91, 80, 0, 27, 91, 77, 0, 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 0, 27, 91, 52, 104, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 15, 0, 27, 91, 109, 15, 0, 0, 27, 91, 52, 108, 0, 27, 91, 50, 55, 109, 0, 27, 91, 50, 52, 109, 0, 27, 103, 0, 27, 41, 48, 0, 27, 91, 76, 0, 8, 0, 27, 91, 51, 126, 0, 27, 79, 66, 0, 27, 79, 80, 0, 27, 91, 50, 49, 126, 0, 27, 79, 81, 0, 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 91, 49, 126, 0, 27, 91, 50, 126, 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 79, 67, 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, 63, 49, 104, 27, 61, 0, 27, 69, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 99, 27, 91, 63, 49, 48, 48, 48, 108, 27, 91, 63, 50, 53, 104, 0, 27, 56, 0, 27, 55, 0, 10, 0, 27, 77, 0, 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 49, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 51, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 109, 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, 9, 0, 43, 43, 44, 44, 45, 45, 46, 46, 48, 48, 96, 96, 97, 97, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 40, 66, 27, 41, 48, 0, 27, 91, 52, 126, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 49, 75, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 91, 51, 109, 0, 27, 91, 50, 51, 109, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0 + 26, 1, 56, 0, 15, 0, 15, 0, 105, 1, -48, 2, 116, 109, 117, 120, 124, 86, 84, 32, 49, 48, 48, 47, 65, 78, 83, 73, 32, 88, 51, 46, 54, 52, 32, 118, 105, 114, 116, 117, 97, 108, 32, 116, 101, 114, 109, 105, 110, 97, 108, 32, 119, 105, 116, 104, 32, 50, 53, 54, 32, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, 0, 0, 4, 0, 6, 0, 8, 0, 25, 0, 30, 0, 37, 0, 41, 0, -1, -1, -1, -1, 45, 0, 62, 0, 64, 0, 68, 0, 75, 0, -1, -1, 77, 0, 89, 0, -1, -1, 93, 0, 96, 0, 102, 0, 106, 0, -1, -1, -1, -1, 110, 0, 112, 0, 117, 0, 122, 0, -1, -1, -1, -1, 123, 0, -1, -1, -1, -1, -128, 0, -123, 0, -118, 0, -1, -1, -113, 0, -111, 0, -106, 0, -1, -1, -105, 0, -100, 0, -94, 0, -88, 0, -1, -1, -1, -1, -1, -1, -85, 0, -1, -1, -1, -1, -1, -1, -81, 0, -1, -1, -77, 0, -1, -1, -1, -1, -1, -1, -75, 0, -1, -1, -70, 0, -1, -1, -1, -1, -1, -1, -1, -1, -66, 0, -62, 0, -56, 0, -52, 0, -48, 0, -44, 0, -38, 0, -32, 0, -26, 0, -20, 0, -14, 0, -9, 0, -1, -1, -4, 0, -1, -1, 0, 1, 5, 1, 10, 1, -1, -1, -1, -1, -1, -1, 14, 1, 18, 1, 26, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 1, -1, -1, 37, 1, 46, 1, 55, 1, 64, 1, -1, -1, 73, 1, 82, 1, 91, 1, -1, -1, 100, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 109, 1, -1, -1, -1, -1, 126, 1, -1, -1, -127, 1, -124, 1, -122, 1, -119, 1, -46, 1, -1, -1, -43, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -41, 1, -1, -1, 24, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 28, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 40, 2, 46, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 57, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 66, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 71, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 77, 2, -1, -1, -1, -1, -1, -1, 81, 2, -112, 2, 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 51, 52, 104, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, 27, 77, 0, 27, 91, 51, 52, 108, 0, 27, 91, 80, 0, 27, 91, 77, 0, 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 0, 27, 91, 52, 104, 0, 27, 91, 55, 109, 0, 27, 91, 55, 109, 0, 27, 91, 52, 109, 0, 15, 0, 27, 91, 109, 15, 0, 0, 27, 91, 52, 108, 0, 27, 91, 50, 55, 109, 0, 27, 91, 50, 52, 109, 0, 27, 103, 0, 27, 41, 48, 0, 27, 91, 76, 0, 8, 0, 27, 91, 51, 126, 0, 27, 79, 66, 0, 27, 79, 80, 0, 27, 91, 50, 49, 126, 0, 27, 79, 81, 0, 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 91, 49, 126, 0, 27, 91, 50, 126, 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 79, 67, 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, 63, 49, 104, 27, 61, 0, 27, 69, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 99, 27, 91, 63, 49, 48, 48, 48, 108, 27, 91, 63, 50, 53, 104, 0, 27, 56, 0, 27, 55, 0, 10, 0, 27, 77, 0, 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 49, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 51, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 109, 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, 9, 0, 43, 43, 44, 44, 45, 45, 46, 46, 48, 48, 96, 96, 97, 97, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 40, 66, 27, 41, 48, 0, 27, 91, 52, 126, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 49, 75, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 91, 51, 109, 0, 27, 91, 50, 51, 109, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0 }; // Taken from unibilium/t/static_screen-256color.c as of 2015-08-14. // This is an 256-colour terminfo description that lacks // status line capabilities that screen actually has. static const signed char screen_256colour_terminfo[] = { - 26, 1, 43, 0, 43, 0, 15, 0, 105, 1, -43, 2, 115, 99, 114, 101, 101, 110, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 71, 78, 85, 32, 83, 99, 114, 101, 101, 110, 32, 119, 105, 116, 104, 32, 50, 53, 54, 32, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, 0, 0, 4, 0, 6, 0, 8, 0, 25, 0, 30, 0, 37, 0, 41, 0, -1, -1, -1, -1, 45, 0, 62, 0, 64, 0, 68, 0, 75, 0, -1, -1, 77, 0, 89, 0, -1, -1, 93, 0, 96, 0, 102, 0, 106, 0, -1, -1, -1, -1, 110, 0, 112, 0, 117, 0, 122, 0, -1, -1, -1, -1, -125, 0, -1, -1, -1, -1, -120, 0, -115, 0, -110, 0, -1, -1, -105, 0, -103, 0, -98, 0, -1, -1, -89, 0, -84, 0, -78, 0, -72, 0, -1, -1, -1, -1, -1, -1, -69, 0, -1, -1, -1, -1, -1, -1, -65, 0, -1, -1, -61, 0, -1, -1, -1, -1, -1, -1, -59, 0, -1, -1, -54, 0, -1, -1, -1, -1, -1, -1, -1, -1, -50, 0, -46, 0, -40, 0, -36, 0, -32, 0, -28, 0, -22, 0, -16, 0, -10, 0, -4, 0, 2, 1, 7, 1, -1, -1, 12, 1, -1, -1, 16, 1, 21, 1, 26, 1, -1, -1, -1, -1, -1, -1, 30, 1, 34, 1, 42, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 1, -1, -1, 53, 1, 62, 1, 71, 1, 80, 1, -1, -1, 89, 1, 98, 1, 107, 1, -1, -1, 116, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 125, 1, -1, -1, -1, -1, -114, 1, -1, -1, -111, 1, -108, 1, -106, 1, -103, 1, -30, 1, -1, -1, -27, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -25, 1, -1, -1, 40, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 44, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 56, 2, 62, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 68, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 73, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, 2, -1, -1, -1, -1, -1, -1, 86, 2, -107, 2, 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 51, 52, 104, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, 27, 77, 0, 27, 91, 51, 52, 108, 0, 27, 91, 80, 0, 27, 91, 77, 0, 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 63, 49, 48, 52, 57, 104, 0, 27, 91, 52, 104, 0, 27, 91, 55, 109, 0, 27, 91, 51, 109, 0, 27, 91, 52, 109, 0, 15, 0, 27, 91, 109, 15, 0, 27, 91, 63, 49, 48, 52, 57, 108, 0, 27, 91, 52, 108, 0, 27, 91, 50, 51, 109, 0, 27, 91, 50, 52, 109, 0, 27, 103, 0, 27, 41, 48, 0, 27, 91, 76, 0, 8, 0, 27, 91, 51, 126, 0, 27, 79, 66, 0, 27, 79, 80, 0, 27, 91, 50, 49, 126, 0, 27, 79, 81, 0, 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 91, 49, 126, 0, 27, 91, 50, 126, 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 79, 67, 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, 63, 49, 104, 27, 61, 0, 27, 69, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 99, 27, 91, 63, 49, 48, 48, 48, 108, 27, 91, 63, 50, 53, 104, 0, 27, 56, 0, 27, 55, 0, 10, 0, 27, 77, 0, 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 49, 37, 116, 59, 51, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 51, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 109, 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, 9, 0, 43, 43, 44, 44, 45, 45, 46, 46, 48, 48, 96, 96, 97, 97, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 40, 66, 27, 41, 48, 0, 27, 91, 52, 126, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 49, 75, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 0, 3, 0, 1, 0, 24, 0, 52, 0, -112, 0, 1, 1, 0, 0, 1, 0, 0, 0, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 3, 0, 6, 0, 9, 0, 12, 0, 15, 0, 18, 0, 23, 0, 28, 0, 32, 0, 37, 0, 43, 0, 49, 0, 55, 0, 61, 0, 66, 0, 71, 0, 77, 0, 83, 0, 89, 0, 95, 0, 101, 0, 107, 0, 111, 0, 116, 0, 120, 0, 124, 0, -128, 0, 27, 40, 66, 0, 27, 40, 37, 112, 49, 37, 99, 0, 65, 88, 0, 71, 48, 0, 88, 84, 0, 85, 56, 0, 69, 48, 0, 83, 48, 0, 107, 68, 67, 53, 0, 107, 68, 67, 54, 0, 107, 68, 78, 0, 107, 68, 78, 53, 0, 107, 69, 78, 68, 53, 0, 107, 69, 78, 68, 54, 0, 107, 72, 79, 77, 53, 0, 107, 72, 79, 77, 54, 0, 107, 73, 67, 53, 0, 107, 73, 67, 54, 0, 107, 76, 70, 84, 53, 0, 107, 78, 88, 84, 53, 0, 107, 78, 88, 84, 54, 0, 107, 80, 82, 86, 53, 0, 107, 80, 82, 86, 54, 0, 107, 82, 73, 84, 53, 0, 107, 85, 80, 0, 107, 85, 80, 53, 0, 107, 97, 50, 0, 107, 98, 49, 0, 107, 98, 51, 0, 107, 99, 50, 0 + 26, 1, 43, 0, 43, 0, 15, 0, 105, 1, -43, 2, 115, 99, 114, 101, 101, 110, 45, 50, 53, 54, 99, 111, 108, 111, 114, 124, 71, 78, 85, 32, 83, 99, 114, 101, 101, 110, 32, 119, 105, 116, 104, 32, 50, 53, 54, 32, 99, 111, 108, 111, 114, 115, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 80, 0, 8, 0, 24, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 127, 0, 0, 4, 0, 6, 0, 8, 0, 25, 0, 30, 0, 37, 0, 41, 0, -1, -1, -1, -1, 45, 0, 62, 0, 64, 0, 68, 0, 75, 0, -1, -1, 77, 0, 89, 0, -1, -1, 93, 0, 96, 0, 102, 0, 106, 0, -1, -1, -1, -1, 110, 0, 112, 0, 117, 0, 122, 0, -1, -1, -1, -1, -125, 0, -1, -1, -1, -1, -120, 0, -115, 0, -110, 0, -1, -1, -105, 0, -103, 0, -98, 0, -1, -1, -89, 0, -84, 0, -78, 0, -72, 0, -1, -1, -1, -1, -1, -1, -69, 0, -1, -1, -1, -1, -1, -1, -65, 0, -1, -1, -61, 0, -1, -1, -1, -1, -1, -1, -59, 0, -1, -1, -54, 0, -1, -1, -1, -1, -1, -1, -1, -1, -50, 0, -46, 0, -40, 0, -36, 0, -32, 0, -28, 0, -22, 0, -16, 0, -10, 0, -4, 0, 2, 1, 7, 1, -1, -1, 12, 1, -1, -1, 16, 1, 21, 1, 26, 1, -1, -1, -1, -1, -1, -1, 30, 1, 34, 1, 42, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 1, -1, -1, 53, 1, 62, 1, 71, 1, 80, 1, -1, -1, 89, 1, 98, 1, 107, 1, -1, -1, 116, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 125, 1, -1, -1, -1, -1, -114, 1, -1, -1, -111, 1, -108, 1, -106, 1, -103, 1, -30, 1, -1, -1, -27, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -25, 1, -1, -1, 40, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 44, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 56, 2, 62, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 68, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 73, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, 2, -1, -1, -1, -1, -1, -1, 86, 2, -107, 2, 27, 91, 90, 0, 7, 0, 13, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 114, 0, 27, 91, 51, 103, 0, 27, 91, 72, 27, 91, 74, 0, 27, 91, 75, 0, 27, 91, 74, 0, 27, 91, 37, 105, 37, 112, 49, 37, 100, 59, 37, 112, 50, 37, 100, 72, 0, 10, 0, 27, 91, 72, 0, 27, 91, 63, 50, 53, 108, 0, 8, 0, 27, 91, 51, 52, 104, 27, 91, 63, 50, 53, 104, 0, 27, 91, 67, 0, 27, 77, 0, 27, 91, 51, 52, 108, 0, 27, 91, 80, 0, 27, 91, 77, 0, 14, 0, 27, 91, 53, 109, 0, 27, 91, 49, 109, 0, 27, 91, 63, 49, 48, 52, 57, 104, 0, 27, 91, 52, 104, 0, 27, 91, 55, 109, 0, 27, 91, 51, 109, 0, 27, 91, 52, 109, 0, 15, 0, 27, 91, 109, 15, 0, 27, 91, 63, 49, 48, 52, 57, 108, 0, 27, 91, 52, 108, 0, 27, 91, 50, 51, 109, 0, 27, 91, 50, 52, 109, 0, 27, 103, 0, 27, 41, 48, 0, 27, 91, 76, 0, 8, 0, 27, 91, 51, 126, 0, 27, 79, 66, 0, 27, 79, 80, 0, 27, 91, 50, 49, 126, 0, 27, 79, 81, 0, 27, 79, 82, 0, 27, 79, 83, 0, 27, 91, 49, 53, 126, 0, 27, 91, 49, 55, 126, 0, 27, 91, 49, 56, 126, 0, 27, 91, 49, 57, 126, 0, 27, 91, 50, 48, 126, 0, 27, 91, 49, 126, 0, 27, 91, 50, 126, 0, 27, 79, 68, 0, 27, 91, 54, 126, 0, 27, 91, 53, 126, 0, 27, 79, 67, 0, 27, 79, 65, 0, 27, 91, 63, 49, 108, 27, 62, 0, 27, 91, 63, 49, 104, 27, 61, 0, 27, 69, 0, 27, 91, 37, 112, 49, 37, 100, 80, 0, 27, 91, 37, 112, 49, 37, 100, 77, 0, 27, 91, 37, 112, 49, 37, 100, 66, 0, 27, 91, 37, 112, 49, 37, 100, 64, 0, 27, 91, 37, 112, 49, 37, 100, 76, 0, 27, 91, 37, 112, 49, 37, 100, 68, 0, 27, 91, 37, 112, 49, 37, 100, 67, 0, 27, 91, 37, 112, 49, 37, 100, 65, 0, 27, 99, 27, 91, 63, 49, 48, 48, 48, 108, 27, 91, 63, 50, 53, 104, 0, 27, 56, 0, 27, 55, 0, 10, 0, 27, 77, 0, 27, 91, 48, 37, 63, 37, 112, 54, 37, 116, 59, 49, 37, 59, 37, 63, 37, 112, 49, 37, 116, 59, 51, 37, 59, 37, 63, 37, 112, 50, 37, 116, 59, 52, 37, 59, 37, 63, 37, 112, 51, 37, 116, 59, 55, 37, 59, 37, 63, 37, 112, 52, 37, 116, 59, 53, 37, 59, 109, 37, 63, 37, 112, 57, 37, 116, 14, 37, 101, 15, 37, 59, 0, 27, 72, 0, 9, 0, 43, 43, 44, 44, 45, 45, 46, 46, 48, 48, 96, 96, 97, 97, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 0, 27, 91, 90, 0, 27, 40, 66, 27, 41, 48, 0, 27, 91, 52, 126, 0, 27, 91, 50, 51, 126, 0, 27, 91, 50, 52, 126, 0, 27, 91, 49, 75, 0, 27, 91, 51, 57, 59, 52, 57, 109, 0, 27, 91, 77, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 51, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 57, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 51, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 27, 91, 37, 63, 37, 112, 49, 37, 123, 56, 125, 37, 60, 37, 116, 52, 37, 112, 49, 37, 100, 37, 101, 37, 112, 49, 37, 123, 49, 54, 125, 37, 60, 37, 116, 49, 48, 37, 112, 49, 37, 123, 56, 125, 37, 45, 37, 100, 37, 101, 52, 56, 59, 53, 59, 37, 112, 49, 37, 100, 37, 59, 109, 0, 0, 3, 0, 1, 0, 24, 0, 52, 0, -112, 0, 1, 1, 0, 0, 1, 0, 0, 0, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 3, 0, 6, 0, 9, 0, 12, 0, 15, 0, 18, 0, 23, 0, 28, 0, 32, 0, 37, 0, 43, 0, 49, 0, 55, 0, 61, 0, 66, 0, 71, 0, 77, 0, 83, 0, 89, 0, 95, 0, 101, 0, 107, 0, 111, 0, 116, 0, 120, 0, 124, 0, -128, 0, 27, 40, 66, 0, 27, 40, 37, 112, 49, 37, 99, 0, 65, 88, 0, 71, 48, 0, 88, 84, 0, 85, 56, 0, 69, 48, 0, 83, 48, 0, 107, 68, 67, 53, 0, 107, 68, 67, 54, 0, 107, 68, 78, 0, 107, 68, 78, 53, 0, 107, 69, 78, 68, 53, 0, 107, 69, 78, 68, 54, 0, 107, 72, 79, 77, 53, 0, 107, 72, 79, 77, 54, 0, 107, 73, 67, 53, 0, 107, 73, 67, 54, 0, 107, 76, 70, 84, 53, 0, 107, 78, 88, 84, 53, 0, 107, 78, 88, 84, 54, 0, 107, 80, 82, 86, 53, 0, 107, 80, 82, 86, 54, 0, 107, 82, 73, 84, 53, 0, 107, 85, 80, 0, 107, 85, 80, 53, 0, 107, 97, 50, 0, 107, 98, 49, 0, 107, 98, 51, 0, 107, 99, 50, 0 }; // Taken from Dickey ncurses terminfo.src dated 2017-04-22. static const signed char iterm_256colour_terminfo[] = { @@ -83,25 +83,37 @@ static const signed char ansi_terminfo[] = { unibi_term *load_builtin_terminfo(const char * term) { if (terminfo_is_term_family(term, "xterm")) { - return unibi_from_mem((const char *)xterm_256colour_terminfo, sizeof xterm_256colour_terminfo); + return unibi_from_mem((const char *)xterm_256colour_terminfo, + sizeof xterm_256colour_terminfo); } else if (terminfo_is_term_family(term, "screen")) { - return unibi_from_mem((const char *)screen_256colour_terminfo, sizeof screen_256colour_terminfo); + return unibi_from_mem((const char *)screen_256colour_terminfo, + sizeof screen_256colour_terminfo); } else if (terminfo_is_term_family(term, "tmux")) { - return unibi_from_mem((const char *)tmux_256colour_terminfo, sizeof tmux_256colour_terminfo); + return unibi_from_mem((const char *)tmux_256colour_terminfo, + sizeof tmux_256colour_terminfo); } else if (terminfo_is_term_family(term, "rxvt")) { - return unibi_from_mem((const char *)rxvt_256colour_terminfo, sizeof rxvt_256colour_terminfo); + return unibi_from_mem((const char *)rxvt_256colour_terminfo, + sizeof rxvt_256colour_terminfo); } else if (terminfo_is_term_family(term, "putty")) { - return unibi_from_mem((const char *)putty_256colour_terminfo, sizeof putty_256colour_terminfo); + return unibi_from_mem((const char *)putty_256colour_terminfo, + sizeof putty_256colour_terminfo); } else if (terminfo_is_term_family(term, "linux")) { - return unibi_from_mem((const char *)linux_16colour_terminfo, sizeof linux_16colour_terminfo); + return unibi_from_mem((const char *)linux_16colour_terminfo, + sizeof linux_16colour_terminfo); } else if (terminfo_is_term_family(term, "interix")) { - return unibi_from_mem((const char *)interix_8colour_terminfo, sizeof interix_8colour_terminfo); - } else if (terminfo_is_term_family(term, "iterm") || terminfo_is_term_family(term, "iTerm.app")) { - return unibi_from_mem((const char *)iterm_256colour_terminfo, sizeof iterm_256colour_terminfo); + return unibi_from_mem((const char *)interix_8colour_terminfo, + sizeof interix_8colour_terminfo); + } else if (terminfo_is_term_family(term, "iterm") + || terminfo_is_term_family(term, "iTerm.app")) { + return unibi_from_mem((const char *)iterm_256colour_terminfo, + sizeof iterm_256colour_terminfo); } else if (terminfo_is_term_family(term, "st")) { - return unibi_from_mem((const char *)st_256colour_terminfo, sizeof st_256colour_terminfo); - } else if (terminfo_is_term_family(term, "gnome") || terminfo_is_term_family(term, "vte")) { - return unibi_from_mem((const char *)vte_256colour_terminfo, sizeof vte_256colour_terminfo); + return unibi_from_mem((const char *)st_256colour_terminfo, + sizeof st_256colour_terminfo); + } else if (terminfo_is_term_family(term, "gnome") + || terminfo_is_term_family(term, "vte")) { + return unibi_from_mem((const char *)vte_256colour_terminfo, + sizeof vte_256colour_terminfo); } else { return unibi_from_mem((const char *)ansi_terminfo, sizeof ansi_terminfo); } diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 61fe1bb361..b885861a23 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -47,7 +47,8 @@ #define TOO_MANY_EVENTS 1000000 #define STARTS_WITH(str, prefix) (strlen(term) >= (sizeof(prefix) - 1) \ && 0 == memcmp((str), (prefix), sizeof(prefix) - 1)) -#define TMUX_WRAP(is_tmux,seq) ((is_tmux) ? "\x1bPtmux;\x1b" seq "\x1b\\" : seq) +#define TMUX_WRAP(is_tmux, seq) ((is_tmux) \ + ? "\x1bPtmux;\x1b" seq "\x1b\\" : seq) #define LINUXSET0C "\x1b[?0c" #define LINUXSET1C "\x1b[?1c" @@ -552,7 +553,7 @@ static void cursor_goto(UI *ui, int row, int col) // different cursor positioning rules. && (data->immediate_wrap_after_last_column || grid->col < ui->width)) { int n = grid->col - col; - if (n <= 4) { // This might be just BS, so it is considered really cheap. + if (n <= 4) { // This might be just BS, so it is considered really cheap. while (n--) { unibi_out(ui, unibi_cursor_left); } @@ -579,7 +580,7 @@ static void cursor_goto(UI *ui, int row, int col) if (col == grid->col) { if (row > grid->row) { int n = row - grid->row; - if (n <= 4) { // This might be just LF, so it is considered really cheap. + if (n <= 4) { // This might be just LF, so it is considered really cheap. while (n--) { unibi_out(ui, unibi_cursor_down); } @@ -1483,21 +1484,21 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, unibi_set_ext_str(ut, (size_t)data->unibi_ext.reset_cursor_style, "\x1b[ q"); } else if (linuxvt) { - // Linux uses an idiosyncratic escape code to set the cursor shape and does - // not support DECSCUSR. + // Linux uses an idiosyncratic escape code to set the cursor shape and + // does not support DECSCUSR. data->unibi_ext.set_cursor_style = (int)unibi_add_ext_str(ut, "Ss", "\x1b[?" "%?" // The parameter passed to Ss is the DECSCUSR parameter, so the // terminal capability has to translate into the Linux idiosyncratic // parameter. - "%p1%{2}%<" "%t%{8}" // blink block - "%p1%{2}%=" "%t%{24}" // steady block - "%p1%{3}%=" "%t%{1}" // blink underline - "%p1%{4}%=" "%t%{17}" // steady underline - "%p1%{5}%=" "%t%{1}" // blink bar - "%p1%{6}%=" "%t%{17}" // steady bar - "%e%{0}" // anything else + "%p1%{2}%<" "%t%{8}" // blink block + "%p1%{2}%=" "%t%{24}" // steady block + "%p1%{3}%=" "%t%{1}" // blink underline + "%p1%{4}%=" "%t%{17}" // steady underline + "%p1%{5}%=" "%t%{1}" // blink bar + "%p1%{6}%=" "%t%{17}" // steady bar + "%e%{0}" // anything else "%;" "%dc"); if (-1 == data->unibi_ext.reset_cursor_style) { data->unibi_ext.reset_cursor_style = (int)unibi_add_ext_str(ut, "Se", From 1ae7744f42fe60ebc2caa383be4d17e714c71c5f Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 7 Jul 2017 00:33:20 +0200 Subject: [PATCH 129/161] lint --- src/nvim/option.c | 3 ++- src/nvim/screen.c | 11 +++++------ src/nvim/tui/terminfo.c | 27 ++++++++++++++------------- src/nvim/tui/terminfo.h | 2 ++ src/nvim/tui/tui.c | 34 +++++++++++++++++----------------- 5 files changed, 40 insertions(+), 37 deletions(-) diff --git a/src/nvim/option.c b/src/nvim/option.c index 0c423c900f..cc7f8333ff 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -969,7 +969,8 @@ void set_init_2(bool headless) p_window = Rows - 1; } set_number_default("window", Rows - 1); -#if 0 // This bodges around problems that should properly be fixed in the TUI layer. +#if 0 + // This bodges around problems that should be fixed in the TUI layer. if (!headless && !os_term_is_nice()) { set_string_option_direct((char_u *)"guicursor", -1, (char_u *)"", OPT_GLOBAL, SID_NONE); diff --git a/src/nvim/screen.c b/src/nvim/screen.c index e8cd6b4e9c..537b13f33d 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -5824,13 +5824,12 @@ static void screen_char(unsigned off, int row, int col) if (row >= screen_Rows || col >= screen_Columns) return; - /* Outputting the last character on the screen may scrollup the screen. - * Don't to it! Mark the character invalid (update it when scrolled up) - * FIXME: The premise here is not actually true. c.f. deferred wrap */ + // Outputting the last character on the screen may scrollup the screen. + // Don't to it! Mark the character invalid (update it when scrolled up) + // FIXME: The premise here is not actually true (cf. deferred wrap). if (row == screen_Rows - 1 && col == screen_Columns - 1 - /* account for first command-line character in rightleft mode */ - && !cmdmsg_rl - ) { + // account for first command-line character in rightleft mode + && !cmdmsg_rl) { ScreenAttrs[off] = (sattr_T)-1; return; } diff --git a/src/nvim/tui/terminfo.c b/src/nvim/tui/terminfo.c index ac1bdaa6bb..b8fffcb7d6 100644 --- a/src/nvim/tui/terminfo.c +++ b/src/nvim/tui/terminfo.c @@ -84,37 +84,38 @@ unibi_term *load_builtin_terminfo(const char * term) { if (terminfo_is_term_family(term, "xterm")) { return unibi_from_mem((const char *)xterm_256colour_terminfo, - sizeof xterm_256colour_terminfo); + sizeof xterm_256colour_terminfo); } else if (terminfo_is_term_family(term, "screen")) { return unibi_from_mem((const char *)screen_256colour_terminfo, - sizeof screen_256colour_terminfo); + sizeof screen_256colour_terminfo); } else if (terminfo_is_term_family(term, "tmux")) { return unibi_from_mem((const char *)tmux_256colour_terminfo, - sizeof tmux_256colour_terminfo); + sizeof tmux_256colour_terminfo); } else if (terminfo_is_term_family(term, "rxvt")) { return unibi_from_mem((const char *)rxvt_256colour_terminfo, - sizeof rxvt_256colour_terminfo); + sizeof rxvt_256colour_terminfo); } else if (terminfo_is_term_family(term, "putty")) { return unibi_from_mem((const char *)putty_256colour_terminfo, - sizeof putty_256colour_terminfo); + sizeof putty_256colour_terminfo); } else if (terminfo_is_term_family(term, "linux")) { return unibi_from_mem((const char *)linux_16colour_terminfo, - sizeof linux_16colour_terminfo); + sizeof linux_16colour_terminfo); } else if (terminfo_is_term_family(term, "interix")) { return unibi_from_mem((const char *)interix_8colour_terminfo, - sizeof interix_8colour_terminfo); + sizeof interix_8colour_terminfo); } else if (terminfo_is_term_family(term, "iterm") - || terminfo_is_term_family(term, "iTerm.app")) { + || terminfo_is_term_family(term, "iTerm.app")) { return unibi_from_mem((const char *)iterm_256colour_terminfo, - sizeof iterm_256colour_terminfo); + sizeof iterm_256colour_terminfo); } else if (terminfo_is_term_family(term, "st")) { return unibi_from_mem((const char *)st_256colour_terminfo, - sizeof st_256colour_terminfo); + sizeof st_256colour_terminfo); } else if (terminfo_is_term_family(term, "gnome") - || terminfo_is_term_family(term, "vte")) { + || terminfo_is_term_family(term, "vte")) { return unibi_from_mem((const char *)vte_256colour_terminfo, - sizeof vte_256colour_terminfo); + sizeof vte_256colour_terminfo); } else { - return unibi_from_mem((const char *)ansi_terminfo, sizeof ansi_terminfo); + return unibi_from_mem((const char *)ansi_terminfo, + sizeof ansi_terminfo); } } diff --git a/src/nvim/tui/terminfo.h b/src/nvim/tui/terminfo.h index 78f6b9c245..099df8967f 100644 --- a/src/nvim/tui/terminfo.h +++ b/src/nvim/tui/terminfo.h @@ -1,6 +1,8 @@ #ifndef NVIM_TUI_TERMINFO_H #define NVIM_TUI_TERMINFO_H +#include + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "tui/terminfo.h.generated.h" #endif diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index b885861a23..499dffa18a 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -162,7 +162,7 @@ UI *tui_start(void) } static size_t unibi_pre_fmt_str(TUIData *data, unsigned int unibi_index, - char * buf, size_t len) + char * buf, size_t len) { const char *str = unibi_get_str(data->ut, unibi_index); if (!str) { @@ -223,9 +223,9 @@ static void terminfo_start(UI *ui) terminfo_is_term_family(term, "cygwin") || terminfo_is_term_family(term, "interix"); data->normlen = unibi_pre_fmt_str(data, unibi_cursor_normal, - data->norm, sizeof data->norm); + data->norm, sizeof data->norm); data->invislen = unibi_pre_fmt_str(data, unibi_cursor_invisible, - data->invis, sizeof data->invis); + data->invis, sizeof data->invis); // Set 't_Co' from the result of unibilium & fix_terminfo. t_colors = unibi_get_num(data->ut, unibi_max_colors); // Enter alternate screen and clear @@ -539,7 +539,7 @@ static void cursor_goto(UI *ui, int row, int col) if (n <= (row == grid->row ? 4 : 2) && cheap_to_print(ui, grid->row, grid->col, n)) { UGRID_FOREACH_CELL(grid, grid->row, grid->row, - grid->col, col - 1, { + grid->col, col - 1, { print_cell(ui, cell); }); } @@ -1254,7 +1254,8 @@ static int unibi_find_ext_bool(unibi_term *ut, const char *name) /// external or a built-in database. In an ideal world, the real terminfo data /// would be correct and complete, and this function would be almost empty. static void patch_terminfo_bugs(TUIData *data, const char *term, - const char *colorterm, long vte_version, bool konsole, bool iterm_env) + const char *colorterm, long vte_version, + bool konsole, bool iterm_env) { unibi_term *ut = data->ut; const char * xterm_version = os_getenv("XTERM_VERSION"); @@ -1296,7 +1297,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, if (linuxvt && strlen(fix_normal) >= (sizeof LINUXSET0C - 1) && !memcmp(strchr(fix_normal, 0) - (sizeof LINUXSET0C - 1), - LINUXSET0C, sizeof LINUXSET0C - 1)) { + LINUXSET0C, sizeof LINUXSET0C - 1)) { // The Linux terminfo entry similarly includes a Linux-idiosyncractic // cursor shape reset in cnorm, which similarly interferes with // set_cursor_style. @@ -1308,7 +1309,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, if (linuxvt && strlen(fix_invisible) >= (sizeof LINUXSET1C - 1) && !memcmp(strchr(fix_invisible, 0) - (sizeof LINUXSET1C - 1), - LINUXSET1C, sizeof LINUXSET1C - 1)) { + LINUXSET1C, sizeof LINUXSET1C - 1)) { // The Linux terminfo entry similarly includes a Linux-idiosyncractic // cursor shape reset in cinvis, which similarly interferes with // set_cursor_style. @@ -1411,8 +1412,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, unibi_set_num(ut, unibi_max_colors, 256); unibi_set_str(ut, unibi_set_a_foreground, XTERM_SETAF_256); unibi_set_str(ut, unibi_set_a_background, XTERM_SETAB_256); - } else - if (konsole || xterm || gnome || rxvt || st || putty + } else if (konsole || xterm || gnome || rxvt || st || putty || linuxvt // Linux 4.8+ supports 256-colour SGR. || mate_pretending_xterm || gnome_pretending_xterm || tmux || tmux_pretending_screen @@ -1455,23 +1455,23 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, // console-terminal-emulator from the nosh toolset, which does indeed // implement the xterm extension: || (linuxvt && (xterm_version || (vte_version > 0) || colorterm))) { - data->unibi_ext.set_cursor_style = (int)unibi_add_ext_str(ut, "Ss", - "\x1b[%p1%d q"); + data->unibi_ext.set_cursor_style = + (int)unibi_add_ext_str(ut, "Ss", "\x1b[%p1%d q"); if (-1 == data->unibi_ext.reset_cursor_style) { data->unibi_ext.reset_cursor_style = (int)unibi_add_ext_str(ut, "Se", ""); } unibi_set_ext_str(ut, (size_t)data->unibi_ext.reset_cursor_style, - "\x1b[ q"); - } else - if (putty // per MinTTY 0.4.3-1 release notes from 2009 + "\x1b[ q"); + } else if ( + // per MinTTY 0.4.3-1 release notes from 2009 + putty // per https://bugzilla.gnome.org/show_bug.cgi?id=720821 || (vte_version >= 3900) // per tmux manual page and per // https://lists.gnu.org/archive/html/screen-devel/2013-03/msg00000.html || screen) { - // Since we use the xterm extension, we have to map it to the unextended - // form. + // Since we use the xterm extension, we must map it to the unextended form data->unibi_ext.set_cursor_style = (int)unibi_add_ext_str(ut, "Ss", "\x1b[%?" "%p1%{4}%>" "%t%p1%{2}%-" // a bit of a bodge for extension values @@ -1676,7 +1676,7 @@ static void flush_buf(UI *ui, bool toggle_cursor) } uv_write(&req, STRUCT_CAST(uv_stream_t, &data->output_handle), - bufs, (unsigned)(bufp - bufs), NULL); + bufs, (unsigned)(bufp - bufs), NULL); uv_run(&data->write_loop, UV_RUN_DEFAULT); data->bufpos = 0; } From f31c26f1afb5e4d17678927fa7cd3bb41197a298 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 29 May 2017 03:17:12 +0200 Subject: [PATCH 130/161] jobstop/process_stop: send SIGTERM directly This reverts the revert of #6644 (7c1a5d1d4), and handles it properly now (with tests). --- src/nvim/event/process.c | 33 ++++++++--------- src/nvim/event/process.h | 3 +- test/functional/autocmd/termclose_spec.lua | 41 +++++++++++++++++++++- 3 files changed, 58 insertions(+), 19 deletions(-) diff --git a/src/nvim/event/process.c b/src/nvim/event/process.c index cad49e2007..c936583841 100644 --- a/src/nvim/event/process.c +++ b/src/nvim/event/process.c @@ -21,9 +21,9 @@ # include "event/process.c.generated.h" #endif -// Time (ns) for a process to exit cleanly before we send TERM/KILL. -#define TERM_TIMEOUT 1000000000 -#define KILL_TIMEOUT (TERM_TIMEOUT * 2) +// Time for a process to exit cleanly before we send KILL. +// For pty processes SIGTERM is sent first (in case SIGHUP was not enough). +#define KILL_TIMEOUT_MS 2000 #define CLOSE_PROC_STREAM(proc, stream) \ do { \ @@ -125,8 +125,6 @@ void process_teardown(Loop *loop) FUNC_ATTR_NONNULL_ALL // Close handles to process without killing it. CREATE_EVENT(loop->events, process_close_handles, 1, proc); } else { - uv_kill(proc->pid, SIGTERM); - proc->term_sent = true; process_stop(proc); } } @@ -238,6 +236,8 @@ void process_stop(Process *proc) FUNC_ATTR_NONNULL_ALL // stdout/stderr, they will be closed when it exits(possibly due to being // terminated after a timeout) process_close_in(proc); + ILOG("Sending SIGTERM to pid %d", proc->pid); + uv_kill(proc->pid, SIGTERM); break; case kProcessTypePty: // close all streams for pty processes to send SIGHUP to the process @@ -251,9 +251,10 @@ void process_stop(Process *proc) FUNC_ATTR_NONNULL_ALL Loop *loop = proc->loop; if (!loop->children_stop_requests++) { // When there's at least one stop request pending, start a timer that - // will periodically check if a signal should be send to a to the job - DLOG("Starting job kill timer"); - uv_timer_start(&loop->children_kill_timer, children_kill_cb, 100, 100); + // will periodically check if a signal should be send to the job. + ILOG("Starting job kill timer"); + uv_timer_start(&loop->children_kill_timer, children_kill_cb, + KILL_TIMEOUT_MS, KILL_TIMEOUT_MS); } } @@ -269,15 +270,15 @@ static void children_kill_cb(uv_timer_t *handle) if (!proc->stopped_time) { continue; } - uint64_t elapsed = now - proc->stopped_time; + uint64_t elapsed = (now - proc->stopped_time) / 1000000 + 1; - if (!proc->term_sent && elapsed >= TERM_TIMEOUT) { - ILOG("Sending SIGTERM to pid %d", proc->pid); - uv_kill(proc->pid, SIGTERM); - proc->term_sent = true; - } else if (elapsed >= KILL_TIMEOUT) { - ILOG("Sending SIGKILL to pid %d", proc->pid); - uv_kill(proc->pid, SIGKILL); + if (elapsed >= KILL_TIMEOUT_MS) { + int sig = proc->type == kProcessTypePty && elapsed < KILL_TIMEOUT_MS * 2 + ? SIGTERM + : SIGKILL; + ILOG("Sending %s to pid %d", sig == SIGTERM ? "SIGTERM" : "SIGKILL", + proc->pid); + uv_kill(proc->pid, sig); } } } diff --git a/src/nvim/event/process.h b/src/nvim/event/process.h index 26d70a5e6d..5c00e8e7ec 100644 --- a/src/nvim/event/process.h +++ b/src/nvim/event/process.h @@ -26,7 +26,7 @@ struct process { Stream *in, *out, *err; process_exit_cb cb; internal_process_cb internal_exit_cb, internal_close_cb; - bool closed, term_sent, detach; + bool closed, detach; MultiQueue *events; }; @@ -48,7 +48,6 @@ static inline Process process_init(Loop *loop, ProcessType type, void *data) .err = NULL, .cb = NULL, .closed = false, - .term_sent = false, .internal_close_cb = NULL, .internal_exit_cb = NULL, .detach = false diff --git a/test/functional/autocmd/termclose_spec.lua b/test/functional/autocmd/termclose_spec.lua index d4beab22e4..8cc49c0d4c 100644 --- a/test/functional/autocmd/termclose_spec.lua +++ b/test/functional/autocmd/termclose_spec.lua @@ -14,13 +14,52 @@ describe('TermClose event', function() nvim('set_option', 'shellcmdflag', 'EXE') end) - it('triggers when terminal job ends', function() + it('triggers when fast-exiting terminal job stops', function() command('autocmd TermClose * let g:test_termclose = 23') command('terminal') command('call jobstop(b:terminal_job_id)') retry(nil, nil, function() eq(23, eval('g:test_termclose')) end) end) + it('triggers when long-running terminal job gets stopped', function() + nvim('set_option', 'shell', 'sh') + command('autocmd TermClose * let g:test_termclose = 23') + command('terminal') + command('call jobstop(b:terminal_job_id)') + retry(nil, nil, function() eq(23, eval('g:test_termclose')) end) + end) + + it('kills job trapping SIGTERM', function() + nvim('set_option', 'shell', 'sh') + nvim('set_option', 'shellcmdflag', '-c') + command([[ let g:test_job = jobstart('trap "" TERM && echo 1 && sleep 60', { ]] + .. [[ 'on_stdout': {-> execute('let g:test_job_started = 1')}, ]] + .. [[ 'on_exit': {-> execute('let g:test_job_exited = 1')}}) ]]) + retry(nil, nil, function() eq(1, eval('get(g:, "test_job_started", 0)')) end) + + local start = os.time() + command('call jobstop(g:test_job)') + retry(nil, nil, function() eq(1, eval('get(g:, "test_job_exited", 0)')) end) + local duration = os.time() - start + eq(2, duration) + end) + + it('kills pty job trapping SIGHUP and SIGTERM', function() + nvim('set_option', 'shell', 'sh') + nvim('set_option', 'shellcmdflag', '-c') + command([[ let g:test_job = jobstart('trap "" HUP TERM && echo 1 && sleep 60', { ]] + .. [[ 'pty': 1,]] + .. [[ 'on_stdout': {-> execute('let g:test_job_started = 1')}, ]] + .. [[ 'on_exit': {-> execute('let g:test_job_exited = 1')}}) ]]) + retry(nil, nil, function() eq(1, eval('get(g:, "test_job_started", 0)')) end) + + local start = os.time() + command('call jobstop(g:test_job)') + retry(nil, nil, function() eq(1, eval('get(g:, "test_job_exited", 0)')) end) + local duration = os.time() - start + eq(4, duration) + end) + it('reports the correct ', function() command('set hidden') command('autocmd TermClose * let g:abuf = expand("")') From 5f5f2ce0de68f363a1c839edb9c89a63b35e2d6e Mon Sep 17 00:00:00 2001 From: James McCoy Date: Fri, 7 Jul 2017 10:07:53 -0400 Subject: [PATCH 131/161] test: tui_spec: Remove unused is_linux variable --- test/functional/terminal/tui_spec.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index cb436dbeea..21b907c8f7 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -317,7 +317,6 @@ end) -- does not initialize the TUI. describe("tui 't_Co' (terminal colors)", function() local screen - local is_linux = (helpers.eval("system('uname') =~? 'linux'") == 1) local is_freebsd = (helpers.eval("system('uname') =~? 'FreeBSD'") == 1) local function assert_term_colors(term, colorterm, maxcolors) From 35fad15c8907f741ce21779393e4377de753e4f9 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Fri, 7 Jul 2017 11:26:20 -0400 Subject: [PATCH 132/161] Prefer the static jemalloc library by default on OSX When neovim is dynamically linked against jemalloc on OSX, users are hitting the deadlock described in jemalloc/jemalloc#895. --- cmake/FindJeMalloc.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/FindJeMalloc.cmake b/cmake/FindJeMalloc.cmake index 820ceeed4a..f139196a38 100644 --- a/cmake/FindJeMalloc.cmake +++ b/cmake/FindJeMalloc.cmake @@ -27,6 +27,9 @@ find_path(JEMALLOC_INCLUDE_DIR jemalloc/jemalloc.h if(JEMALLOC_USE_STATIC) list(APPEND JEMALLOC_NAMES "${CMAKE_STATIC_LIBRARY_PREFIX}jemalloc${CMAKE_STATIC_LIBRARY_SUFFIX}") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + list(INSERT JEMALLOC_NAMES 0 + "${CMAKE_STATIC_LIBRARY_PREFIX}jemalloc${CMAKE_STATIC_LIBRARY_SUFFIX}") endif() list(APPEND JEMALLOC_NAMES jemalloc) From 17298a7912596c0009499b22493074f543d624d9 Mon Sep 17 00:00:00 2001 From: Ivan Date: Sat, 8 Jul 2017 06:44:36 -0400 Subject: [PATCH 133/161] runtime: update vimCommand syntax pattern (#6976) Update a flawed match pattern for the vimCommand syntax group. To see the effect of this fix, open a vimscript buffer, nvim -u NONE foo.vim configure a couple highlight groups, :hi! vimIsCommand ctermfg=Green :hi! vimCommand ctermfg=Red :syntax enable and add the following lines to the buffer: let foo=xFoo let bar=zBar You'll notice the "z" in zBar is Red, while xFoo and the rest of Bar are green. This will be the case as long as the word following `=` starts with the letter "z". This has already been fixed upstream by adding a "\>" word boundary to the match pattern: https://github.com/vim/vim/issues/124 https://github.com/vim/vim/commit/e2719096250a19ecdd9a35d13702879f163d2a50#diff-86da060e2153c8ce5dc317a7b4b5a29dR27 This particular match pattern was also mentioned in issue #5491, but in reference to a bug that was related to the generated part of syntax/vim.vim, whereas this bug lives in the non-generated part of the file. --- runtime/syntax/vim.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 85ced1ed3e..7025ee5369 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -21,7 +21,7 @@ syn keyword vimTodo contained COMBAK FIXME TODO XXX syn cluster vimCommentGroup contains=vimTodo,@Spell " Special and plugin vim commands {{{2 -syn match vimCommand contained "\" syn keyword vimOnlyCommand contained fix[del] op[en] sh[ell] P[rint] syn keyword vimStdPlugin contained DiffOrig Man N[ext] S TOhtml XMLent XMLns From 69e9cda5ace194a678c125256bc5558bc2bfcfce Mon Sep 17 00:00:00 2001 From: d10n Date: Sat, 8 Jul 2017 06:50:58 -0400 Subject: [PATCH 134/161] i_CTRL-O: fix :startinsert at end of line (#6963) The gchar_cursor() == NUL check is already done in ins_ctrl_o. ins_esc changes gchar_cursor() so this if block is probably never entered. Issue: Pressing CTRL-O in insert mode at the end of the line and typing :startinsert moves the cursor 1 column back, when I expect the cursor to remain at the end of the line This is a regression from Vim behavior. Since at least Vim version 7.0, Vim returns you to insert mode at the end of the line. 091e7d033cbf0f4da068292ce4ac934f1c3dd91e is the first bad neovim commit Steps to reproduce using `nvim -u NORC`: `aaaa:startinsert` Fixes #6962 --- src/nvim/edit.c | 2 +- test/functional/insert/ctrl_o_spec.lua | 43 ++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 test/functional/insert/ctrl_o_spec.lua diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 08a2f42f74..ca62679fab 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -462,7 +462,7 @@ static void insert_enter(InsertState *s) // Always update o_lnum, so that a "CTRL-O ." that adds a line // still puts the cursor back after the inserted text. - if (ins_at_eol && gchar_cursor() == NUL) { + if (ins_at_eol) { o_lnum = curwin->w_cursor.lnum; } diff --git a/test/functional/insert/ctrl_o_spec.lua b/test/functional/insert/ctrl_o_spec.lua new file mode 100644 index 0000000000..fbdff8a3a0 --- /dev/null +++ b/test/functional/insert/ctrl_o_spec.lua @@ -0,0 +1,43 @@ +local helpers = require('test.functional.helpers')(after_each) +local clear = helpers.clear +local eq = helpers.eq +local eval = helpers.eval +local expect = helpers.expect +local feed = helpers.feed +local insert = helpers.insert + +describe('insert-mode Ctrl-O', function() + before_each(clear) + + it('enters command mode for one command', function() + feed('ihello world') + feed(':let ctrlo = "test"') + feed('iii') + expect('hello worldiii') + eq(1, eval('ctrlo ==# "test"')) + end) + + it('re-enters insert mode at the end of the line when running startinsert', function() + -- #6962 + feed('ihello world') + feed(':startinsert') + feed('iii') + expect('hello worldiii') + end) + + it('re-enters insert mode at the beginning of the line when running startinsert', function() + insert('hello world') + feed('0') + feed(':startinsert') + feed('aaa') + expect('aaahello world') + end) + + it('re-enters insert mode in the middle of the line when running startinsert', function() + insert('hello world') + feed('bi') + feed(':startinsert') + feed('ooo') + expect('hello oooworld') + end) +end) From 06f798cc38d68aac3d2707bba56463534e9fd896 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 8 Jul 2017 14:59:00 +0200 Subject: [PATCH 135/161] doc: ISSUE_TEMPLATE.md --- ISSUE_TEMPLATE.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index 011739396d..1a7268a51e 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -1,16 +1,19 @@ + + - `nvim --version`: - Vim (version: ) behaves differently? - Operating system/version: - Terminal name/version: - `$TERM`: -### Actual behaviour - -### Expected behaviour - ### Steps to reproduce using `nvim -u NORC` ``` nvim -u NORC ``` + +### Actual behaviour + +### Expected behaviour + From 6720fe253e92b21c7f989389a64e363b5933884f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Renstro=CC=88m?= Date: Sun, 26 Jul 2015 17:02:36 +0200 Subject: [PATCH 136/161] runtime: K: prefer Vim help instead of man #3104 --- runtime/ftplugin/help.vim | 5 ++++- runtime/ftplugin/vim.vim | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/runtime/ftplugin/help.vim b/runtime/ftplugin/help.vim index c94b2ef3eb..9d2361b413 100644 --- a/runtime/ftplugin/help.vim +++ b/runtime/ftplugin/help.vim @@ -11,13 +11,16 @@ let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim -let b:undo_ftplugin = "setl fo< tw< cole< cocu<" +let b:undo_ftplugin = "setl fo< tw< cole< cocu< keywordprg<" setlocal formatoptions+=tcroql textwidth=78 if has("conceal") setlocal cole=2 cocu=nc endif +" Prefer Vim help instead of manpages. +setlocal keywordprg=:help + if !exists('g:no_plugin_maps') function! s:show_toc() abort let bufname = bufname('%') diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim index f355d2837d..ba9ed76169 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -14,7 +14,7 @@ let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo-=C -let b:undo_ftplugin = "setl fo< isk< com< tw< commentstring<" +let b:undo_ftplugin = "setl fo< isk< com< tw< commentstring< keywordprg<" \ . "| unlet! b:match_ignorecase b:match_words b:match_skip" " Set 'formatoptions' to break comment lines but not other lines, @@ -36,6 +36,9 @@ endif " Comments start with a double quote setlocal commentstring=\"%s +" Prefer Vim help instead of manpages. +setlocal keywordprg=:help + " Move around functions. nnoremap [[ m':call search('^\s*fu\%[nction]\>', "bW") vnoremap [[ m':exe "normal! gv"call search('^\s*fu\%[nction]\>', "bW") From 78c5201234e478ff8f648adea95be18ca588a9cd Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 2 Jul 2017 04:54:24 +0200 Subject: [PATCH 137/161] 'cpoptions': remove "k" flag This was already removed in 3baba1e7bc66, except the documentation and CPO_VI entry. find_term_bykeys() is irrelevant to Nvim. --- runtime/doc/map.txt | 3 +-- runtime/doc/options.txt | 9 --------- runtime/doc/vim_diff.txt | 2 +- src/nvim/api/vim.c | 1 - src/nvim/option_defs.h | 3 +-- 5 files changed, 3 insertions(+), 15 deletions(-) diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index f5b0233e6c..48d05bce58 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -444,8 +444,7 @@ There are two ways to map a special key: starts with . To enter a mapping like this you type ":map " and then you have to type CTRL-V before hitting the function key. Note that when the key code for the key is in the |terminfo| entry, it will automatically - be translated into the internal code and become the second way of mapping - (unless the 'k' flag is included in 'cpoptions'). + be translated into the internal code and become the second way of mapping. 2. The second method is to use the internal code for the function key. To enter such a mapping type CTRL-K and then hit the function key, or use the form "#1", "#2", .. "#9", "#0", "", "", "", etc. diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index ca126f5a79..307c14a0e5 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1618,15 +1618,6 @@ A jump table for the options with a short description can be found at |Q_op|. J A |sentence| has to be followed by two spaces after the '.', '!' or '?'. A is not recognized as white space. - *cpo-k* - k Disable the recognition of raw key codes in - mappings, abbreviations, and the "to" part of menu - commands. For example, if sends ^[OA (where ^[ - is ), the command ":map X ^[OA" results in X - being mapped to: - 'k' included: "^[OA" (3 characters) - 'k' excluded: "" (one key code) - Also see the '<' flag below. *cpo-K* K Don't wait for a key code to complete when it is halfway through a mapping. This breaks mapping diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index ca07e613ed..20d1e5dc4e 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -332,7 +332,7 @@ Test functions: Other options: 'antialias' - 'cpoptions' ("g", "w", "H", "*", "-", "j", and all POSIX flags were removed) + 'cpoptions' (g j k H w * - and all POSIX flags were removed) 'encoding' ("utf-8" is always used) 'esckeys' 'guioptions' "t" flag was removed diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 80efe86ea3..ac7c9cbce6 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -153,7 +153,6 @@ String nvim_replace_termcodes(String str, Boolean from_part, Boolean do_lt, char *ptr = NULL; // Set 'cpoptions' the way we want it. // FLAG_CPO_BSLASH set - backslashes are *not* treated specially - // FLAG_CPO_KEYCODE set - keycodes are *not* reverse-engineered // FLAG_CPO_SPECI unset - sequences *are* interpreted // The third from end parameter of replace_termcodes() is true so that the // sequence is recognised - needed for a real backslash. diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h index e68dba734e..ff1d89e0a2 100644 --- a/src/nvim/option_defs.h +++ b/src/nvim/option_defs.h @@ -97,7 +97,6 @@ #define CPO_INTMOD 'i' /* interrupt a read makes buffer modified */ #define CPO_INDENT 'I' /* remove auto-indent more often */ #define CPO_ENDOFSENT 'J' /* need two spaces to detect end of sentence */ -#define CPO_KEYCODE 'k' /* don't recognize raw key code in mappings */ #define CPO_KOFFSET 'K' /* don't wait for key code in mappings */ #define CPO_LITERAL 'l' /* take char after backslash in [] literal */ #define CPO_LISTWM 'L' /* 'list' changes wrapmargin */ @@ -132,7 +131,7 @@ #define CPO_CHANGEW '_' // "cw" special-case // default values for Vim and Vi #define CPO_VIM "aABceFs_" -#define CPO_VI "aAbBcCdDeEfFiIJkKlLmMnoOpPqrRsStuvWxXyZ$!%+<>;_" +#define CPO_VI "aAbBcCdDeEfFiIJKlLmMnoOpPqrRsStuvWxXyZ$!%+<>;_" /* characters for p_ww option: */ #define WW_ALL "bshl<>[],~" From 0ea7e45bc1d1881f505da2b77e0b3e4eb56f12fe Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 2 Jul 2017 13:21:38 +0200 Subject: [PATCH 138/161] 'cpoptions': remove "<" flag; ignore Closes #6937 "nvim_get_keymap output is unreliable" --- runtime/doc/gui.txt | 3 --- runtime/doc/map.txt | 8 +++----- runtime/doc/options.txt | 9 --------- runtime/doc/tips.txt | 7 ++----- runtime/doc/vim_diff.txt | 2 +- runtime/doc/visual.txt | 6 +++--- src/nvim/api/vim.c | 11 +++++------ src/nvim/eval.c | 2 +- src/nvim/ex_docmd.c | 2 +- src/nvim/getchar.c | 22 ++++++++-------------- src/nvim/keymap.c | 15 ++++++--------- src/nvim/keymap.h | 10 +++------- src/nvim/menu.c | 5 ++--- src/nvim/option.c | 2 +- src/nvim/option_defs.h | 11 +++++------ test/functional/api/keymap_spec.lua | 18 ++++++++---------- test/functional/api/vim_spec.lua | 13 +++++++++---- 17 files changed, 58 insertions(+), 88 deletions(-) diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt index 0bd3a40a7c..37462d4e96 100644 --- a/runtime/doc/gui.txt +++ b/runtime/doc/gui.txt @@ -490,9 +490,6 @@ expression register: > :amenu Insert.foobar "='foobar'P -Note that the '<' and 'k' flags in 'cpoptions' also apply here (when -included they make the <> form and raw key codes not being recognized). - Note that in Cmdline mode executes the command, like in a mapping. This is Vi compatible. Use CTRL-C to quit Cmdline mode. diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index 48d05bce58..6f971a1305 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -570,9 +570,9 @@ Since the '|' character is used to separate a map command from the next command, you will have to do something special to include a '|' in {rhs}. There are three methods: use works when example ~ - '<' is not in 'cpoptions' :map _l :!ls more^M + always :map _l :!ls more^M \| 'b' is not in 'cpoptions' :map _l :!ls \| more^M - ^V| always, in Vim and Vi :map _l :!ls ^V| more^M + ^V| always :map _l :!ls ^V| more^M (here ^V stands for CTRL-V; to get one CTRL-V you have to type it twice; you cannot use the <> notation "" here). @@ -627,8 +627,7 @@ out about, ^D is CTRL-D). 1.8 EXAMPLES *map-examples* -A few examples (given as you type them, for "" you type four characters; -the '<' flag must not be present in 'cpoptions' for this to work). > +A few examples (as you type them: for "" you type four characters). > :map o#include :map /foocwbar @@ -880,7 +879,6 @@ character is mostly ignored otherwise. It is possible to move the cursor after an abbreviation: > :iab if if () -This does not work if 'cpoptions' includes the '<' flag. |<>| You can even do more complicated things. For example, to consume the space typed after an abbreviation: > diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 307c14a0e5..dc968cd666 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1568,7 +1568,6 @@ A jump table for the options with a short description can be found at |Q_op|. results in X being mapped to: 'B' included: "\^[" (^[ is a real ) 'B' excluded: "" (5 characters) - ('<' excluded in both cases) *cpo-c* c Searching continues at the end of any match at the cursor position, but not further than the start of the @@ -1751,14 +1750,6 @@ A jump table for the options with a short description can be found at |Q_op|. + When included, a ":write file" command will reset the 'modified' flag of the buffer, even though the buffer itself may still be different from its file. - *cpo-<* - < Disable the recognition of special key codes in |<>| - form in mappings, abbreviations, and the "to" part of - menu commands. For example, the command - ":map X " results in X being mapped to: - '<' included: "" (5 characters) - '<' excluded: "^I" (^I is a real ) - Also see the 'k' flag above. *cpo->* > When appending to a register, put a line break before the appended text. diff --git a/runtime/doc/tips.txt b/runtime/doc/tips.txt index 9b34cd7599..8bb49c2322 100644 --- a/runtime/doc/tips.txt +++ b/runtime/doc/tips.txt @@ -282,9 +282,7 @@ For Emacs-style editing on the command-line: > :cnoremap " forward one word :cnoremap - -NOTE: This requires that the '<' flag is excluded from 'cpoptions'. |<>| - +< *format-bullet-list* This mapping will format any bullet list. It requires that there is an empty line above and below each list entry. The expression commands are used to @@ -300,8 +298,7 @@ be able to give comments to the parts of the mapping. > :execute m |" define the mapping (<> notation |<>|. Note that this is all typed literally. ^W is "^" "W", not -CTRL-W. You can copy/paste this into Vim if '<' is not included in -'cpoptions'.) +CTRL-W.) Note that the last comment starts with |", because the ":execute" command doesn't accept a comment directly. diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 20d1e5dc4e..d906b874f0 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -332,7 +332,7 @@ Test functions: Other options: 'antialias' - 'cpoptions' (g j k H w * - and all POSIX flags were removed) + 'cpoptions' (g j k H w < * - and all POSIX flags were removed) 'encoding' ("utf-8" is always used) 'esckeys' 'guioptions' "t" flag was removed diff --git a/runtime/doc/visual.txt b/runtime/doc/visual.txt index e9f5bf91f8..cf804444e5 100644 --- a/runtime/doc/visual.txt +++ b/runtime/doc/visual.txt @@ -271,7 +271,7 @@ mode. For example, if you would like the "/" command not to extend the Visual area, but instead take the highlighted text and search for that: > :vmap / y/" (In the <> notation |<>|, when typing it you should type it literally; you -need to remove the 'B' and '<' flags from 'cpoptions'.) +need to remove the 'B' flag from 'cpoptions'.) If you want to give a register name using the """ command, do this just before typing the operator character: "v{move-around}"xd". @@ -375,7 +375,7 @@ Here is an example, to replace the selected text with the output of "date": > :vmap _a `>a`!!datekJJ (In the <> notation |<>|, when typing it you should type it literally; you -need to remove the 'B' and '<' flags from 'cpoptions') +need to remove the 'B' flag from 'cpoptions') What this does is: stop Visual mode @@ -392,7 +392,7 @@ selected text: > :vmap X y/" (In the <> notation |<>|, when typing it you should type it literally; you -need to remove the 'B' and '<' flags from 'cpoptions') +need to remove the 'B' flag from 'cpoptions') Note that special characters (like '.' and '*') will cause problems. diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index ac7c9cbce6..8ab0c0ebda 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -136,9 +136,13 @@ Integer nvim_input(String keys) return (Integer)input_enqueue(keys); } -/// Replaces terminal codes and key codes (, , ...) in a string with +/// Replaces terminal codes and |keycodes| (, , ...) in a string with /// the internal representation. /// +/// @param str String to be converted. +/// @param from_part Legacy Vim parameter. Usually true. +/// @param do_lt Also translate . Does nothing if `special` is false. +/// @param special Replace |keycodes|, e.g. becomes a "\n" char. /// @see replace_termcodes /// @see cpoptions String nvim_replace_termcodes(String str, Boolean from_part, Boolean do_lt, @@ -151,11 +155,6 @@ String nvim_replace_termcodes(String str, Boolean from_part, Boolean do_lt, } char *ptr = NULL; - // Set 'cpoptions' the way we want it. - // FLAG_CPO_BSLASH set - backslashes are *not* treated specially - // FLAG_CPO_SPECI unset - sequences *are* interpreted - // The third from end parameter of replace_termcodes() is true so that the - // sequence is recognised - needed for a real backslash. replace_termcodes((char_u *)str.data, str.size, (char_u **)&ptr, from_part, do_lt, special, CPO_TO_CPO_FLAGS); return cstr_as_string(ptr); diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 662270e788..7e9c006f33 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -12111,7 +12111,7 @@ static void get_maparg(typval_T *argvars, typval_T *rettv, int exact) mode = get_map_mode((char_u **)&which, 0); - keys = replace_termcodes(keys, STRLEN(keys), &keys_buf, true, true, false, + keys = replace_termcodes(keys, STRLEN(keys), &keys_buf, true, true, true, CPO_TO_CPO_FLAGS); rhs = check_map(keys, mode, exact, false, abbr, &mp, &buffer_local); xfree(keys_buf); diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index af8845de87..5d7246581c 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -4747,7 +4747,7 @@ static int uc_add_command(char_u *name, size_t name_len, char_u *rep, char_u *rep_buf = NULL; garray_T *gap; - replace_termcodes(rep, STRLEN(rep), &rep_buf, false, false, false, + replace_termcodes(rep, STRLEN(rep), &rep_buf, false, false, true, CPO_TO_CPO_FLAGS); if (rep_buf == NULL) { /* Can't replace termcodes - try using the string as is */ diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index fc1b8ccfcb..adf0ff1e53 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -2537,7 +2537,6 @@ do_map ( bool unique = false; bool nowait = false; bool silent = false; - bool special = false; bool expr = false; int noremap; char_u *orig_rhs; @@ -2583,12 +2582,9 @@ do_map ( continue; } - /* - * Check for "": accept special keys in <> - */ + // Ignore obsolete "" modifier. if (STRNCMP(keys, "", 9) == 0) { keys = skipwhite(keys + 9); - special = true; continue; } @@ -2657,7 +2653,7 @@ do_map ( // needs to be freed later (*keys_buf and *arg_buf). // replace_termcodes() also removes CTRL-Vs and sometimes backslashes. if (haskey) { - keys = replace_termcodes(keys, STRLEN(keys), &keys_buf, true, true, special, + keys = replace_termcodes(keys, STRLEN(keys), &keys_buf, true, true, true, CPO_TO_CPO_FLAGS); } orig_rhs = rhs; @@ -2665,7 +2661,7 @@ do_map ( if (STRICMP(rhs, "") == 0) { // "" means nothing rhs = (char_u *)""; } else { - rhs = replace_termcodes(rhs, STRLEN(rhs), &arg_buf, false, true, special, + rhs = replace_termcodes(rhs, STRLEN(rhs), &arg_buf, false, true, true, CPO_TO_CPO_FLAGS); } } @@ -3245,7 +3241,7 @@ bool map_to_exists(const char *const str, const char *const modechars, char_u *buf; char_u *const rhs = replace_termcodes((const char_u *)str, strlen(str), &buf, - false, true, false, + false, true, true, CPO_TO_CPO_FLAGS); #define MAPMODE(mode, modechars, chr, modeflags) \ @@ -4158,8 +4154,7 @@ void add_map(char_u *map, int mode) } // Translate an internal mapping/abbreviation representation into the -// corresponding external one recognized by :map/:abbrev commands; -// respects the current B/k/< settings of 'cpoption'. +// corresponding external one recognized by :map/:abbrev commands. // // This function is called when expanding mappings/abbreviations on the // command-line, and for building the "Ambiguous mapping..." error message. @@ -4179,7 +4174,6 @@ static char_u * translate_mapping ( ga_init(&ga, 1, 40); bool cpo_bslash = !(cpo_flags&FLAG_CPO_BSLASH); - bool cpo_special = !(cpo_flags&FLAG_CPO_SPECI); for (; *str; ++str) { int c = *str; @@ -4192,7 +4186,7 @@ static char_u * translate_mapping ( } if (c == K_SPECIAL && str[1] != NUL && str[2] != NUL) { - if (expmap && cpo_special) { + if (expmap) { ga_clear(&ga); return NULL; } @@ -4204,7 +4198,7 @@ static char_u * translate_mapping ( str += 2; } if (IS_SPECIAL(c) || modifiers) { /* special key */ - if (expmap && cpo_special) { + if (expmap) { ga_clear(&ga); return NULL; } @@ -4214,7 +4208,7 @@ static char_u * translate_mapping ( } if (c == ' ' || c == '\t' || c == Ctrl_J || c == Ctrl_V - || (c == '<' && !cpo_special) || (c == '\\' && !cpo_bslash)) { + || (c == '\\' && !cpo_bslash)) { ga_append(&ga, cpo_bslash ? Ctrl_V : '\\'); } diff --git a/src/nvim/keymap.c b/src/nvim/keymap.c index ee67b4c19d..295f246126 100644 --- a/src/nvim/keymap.c +++ b/src/nvim/keymap.c @@ -756,9 +756,9 @@ int get_mouse_button(int code, bool *is_click, bool *is_drag) /// Replace any terminal code strings with the equivalent internal /// representation /// -/// This is used for the "from" and "to" part of a mapping, and the "to" part of +/// Used for the "from" and "to" part of a mapping, and the "to" part of /// a menu command. Any strings like "" are also replaced, unless -/// 'cpoptions' contains '<'. K_SPECIAL by itself is replaced by K_SPECIAL +/// `special` is false. K_SPECIAL by itself is replaced by K_SPECIAL /// KS_SPECIAL KE_FILLER. /// /// @param[in] from What characters to replace. @@ -771,7 +771,7 @@ int get_mouse_button(int code, bool *is_click, bool *is_drag) /// When cpo_flags contains #FLAG_CPO_BSLASH, a backslash /// can be used in place of . All other /// characters are removed. -/// @param[in] special If true, always accept notation. +/// @param[in] special Replace keycodes, e.g. becomes a "\n" char. /// @param[in] cpo_flags Relevant flags derived from p_cpo, see /// #CPO_TO_CPO_FLAGS. /// @@ -790,11 +790,9 @@ char_u *replace_termcodes(const char_u *from, const size_t from_len, const char_u *src; const char_u *const end = from + from_len - 1; int do_backslash; // backslash is a special character - int do_special; // recognize <> key codes char_u *result; // buffer for resulting string do_backslash = !(cpo_flags&FLAG_CPO_BSLASH); - do_special = !(cpo_flags&FLAG_CPO_SPECI) || special; // Allocate space for the translation. Worst case a single character is // replaced by 6 bytes (shifted special key), plus a NUL at the end. @@ -817,9 +815,8 @@ char_u *replace_termcodes(const char_u *from, const size_t from_len, // Copy each byte from *from to result[dlen] while (src <= end) { - // If 'cpoptions' does not contain '<', check for special key codes, - // like "" - if (do_special && (do_lt || ((end - src) >= 3 + // Check for special <> keycodes, like "" + if (special && (do_lt || ((end - src) >= 3 && STRNCMP(src, "", 4) != 0))) { // Replace by K_SNR _. // (room: 5 * 6 = 30 bytes; needed: 3 + + 1 <= 14) @@ -846,7 +843,7 @@ char_u *replace_termcodes(const char_u *from, const size_t from_len, } } - if (do_special) { + if (special) { char_u *p, *s, len; // Replace by the value of "mapleader". diff --git a/src/nvim/keymap.h b/src/nvim/keymap.h index bb8ba84a6a..b8fed77a90 100644 --- a/src/nvim/keymap.h +++ b/src/nvim/keymap.h @@ -464,13 +464,9 @@ enum key_extra { #define MAX_KEY_CODE_LEN 6 #define FLAG_CPO_BSLASH 0x01 -#define FLAG_CPO_SPECI 0x02 -#define CPO_TO_CPO_FLAGS (((vim_strchr(p_cpo, CPO_BSLASH) == NULL) \ - ? 0 \ - : FLAG_CPO_BSLASH)| \ - (vim_strchr(p_cpo, CPO_SPECI) == NULL \ - ? 0 \ - : FLAG_CPO_SPECI)) +#define CPO_TO_CPO_FLAGS ((vim_strchr(p_cpo, CPO_BSLASH) == NULL) \ + ? 0 \ + : FLAG_CPO_BSLASH) #ifdef INCLUDE_GENERATED_DECLARATIONS # include "keymap.h.generated.h" diff --git a/src/nvim/menu.c b/src/nvim/menu.c index 7e9e9e9e5c..c8e6012e5c 100644 --- a/src/nvim/menu.c +++ b/src/nvim/menu.c @@ -60,7 +60,6 @@ ex_menu ( char_u *map_to; int noremap; bool silent = false; - bool special = false; int unmenu; char_u *map_buf; char_u *arg; @@ -86,7 +85,7 @@ ex_menu ( continue; } if (STRNCMP(arg, "", 9) == 0) { - special = true; + // Ignore obsolete "" modifier. arg = skipwhite(arg + 9); continue; } @@ -222,7 +221,7 @@ ex_menu ( map_buf = NULL; // Menu tips are plain text. } else { map_to = replace_termcodes(map_to, STRLEN(map_to), &map_buf, false, true, - special, CPO_TO_CPO_FLAGS); + true, CPO_TO_CPO_FLAGS); } menuarg.modes = modes; menuarg.noremap[0] = noremap; diff --git a/src/nvim/option.c b/src/nvim/option.c index ed058c420d..37b37e2859 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -3034,7 +3034,7 @@ did_set_string_option ( /* 'pastetoggle': translate key codes like in a mapping */ else if (varp == &p_pt) { if (*p_pt) { - (void)replace_termcodes(p_pt, STRLEN(p_pt), &p, true, true, false, + (void)replace_termcodes(p_pt, STRLEN(p_pt), &p, true, true, true, CPO_TO_CPO_FLAGS); if (p != NULL) { if (new_value_alloced) diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h index ff1d89e0a2..95cdc902f8 100644 --- a/src/nvim/option_defs.h +++ b/src/nvim/option_defs.h @@ -123,15 +123,14 @@ #define CPO_DOLLAR '$' #define CPO_FILTER '!' #define CPO_MATCH '%' -#define CPO_PLUS '+' /* ":write file" resets 'modified' */ -#define CPO_SPECI '<' /* don't recognize <> in mappings */ -#define CPO_REGAPPEND '>' /* insert NL when appending to a register */ -#define CPO_SCOLON ';' /* using "," and ";" will skip over char if - * cursor would not move */ +#define CPO_PLUS '+' // ":write file" resets 'modified' +#define CPO_REGAPPEND '>' // insert NL when appending to a register +#define CPO_SCOLON ';' // using "," and ";" will skip over char if + // cursor would not move #define CPO_CHANGEW '_' // "cw" special-case // default values for Vim and Vi #define CPO_VIM "aABceFs_" -#define CPO_VI "aAbBcCdDeEfFiIJKlLmMnoOpPqrRsStuvWxXyZ$!%+<>;_" +#define CPO_VI "aAbBcCdDeEfFiIJKlLmMnoOpPqrRsStuvWxXyZ$!%+>;_" /* characters for p_ww option: */ #define WW_ALL "bshl<>[],~" diff --git a/test/functional/api/keymap_spec.lua b/test/functional/api/keymap_spec.lua index aa556b563d..3a10f9c60f 100644 --- a/test/functional/api/keymap_spec.lua +++ b/test/functional/api/keymap_spec.lua @@ -256,40 +256,38 @@ describe('get_keymap', function() return ret end - command('set cpo-=< cpo+=B') + command('set cpo+=B') command('nnoremap \\C-a>\\ \\C-b>\\') command('nnoremap \\C-c>\\ \\C-d>\\') - command('set cpo+=B<') + command('set cpo+=B') command('xnoremap \\C-a>\\ \\C-b>\\') command('xnoremap \\C-c>\\ \\C-d>\\') - command('set cpo-=B<') + command('set cpo-=B') command('snoremap \\C-a>\\ \\C-b>\\') command('snoremap \\C-c>\\ \\C-d>\\') - command('set cpo-=B cpo+=<') + command('set cpo-=B') command('onoremap \\C-a>\\ \\C-b>\\') command('onoremap \\C-c>\\ \\C-d>\\') for _, cmd in ipairs({ - 'set cpo-=B cpo+=<', - 'set cpo-=B<', - 'set cpo+=B<', - 'set cpo-=< cpo+=B', + 'set cpo-=B', + 'set cpo+=B', }) do command(cmd) eq({cpomap('\\C-c>\\', '\\C-d>\\', 'n'), cpomap('\\C-a>\\', '\\C-b>\\', 'n')}, meths.get_keymap('n')) eq({cpomap('\\C-c>\\', '\\C-d>\\', 'x'), - cpomap('\\C-a>C-a>LT>C-a>\\', '\\C-b>C-b>LT>C-b>\\', 'x')}, + cpomap('\\C-a>\\', '\\C-b>\\', 'x')}, meths.get_keymap('x')) eq({cpomap('C-c>C-c> ', 'C-d>C-d>', 's'), cpomap('C-a>C-a> ', 'C-b>C-b>', 's')}, meths.get_keymap('s')) eq({cpomap('C-c>C-c> ', 'C-d>C-d>', 'o'), - cpomap('C-a>C-a>LT>C-a> ', 'C-b>C-b>LT>C-b>', 'o')}, + cpomap('C-a>C-a> ', 'C-b>C-b>', 'o')}, meths.get_keymap('o')) end end) diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index c531d4af46..e59b5d712d 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -373,6 +373,11 @@ describe('api', function() 'xxxx', true, true, true)) end) + it('does not convert keycodes if special=false', function() + eq('xxxx', helpers.nvim('replace_termcodes', + 'xxxx', true, true, false)) + end) + it('does not crash when transforming an empty string', function() -- Actually does not test anything, because current code will use NULL for -- an empty string. @@ -391,13 +396,13 @@ describe('api', function() -- notice the special char(…) \xe2\80\xa6 nvim('feedkeys', ':let x1="…"\n', '', true) - -- Both replace_termcodes and feedkeys escape \x80 + -- Both nvim_replace_termcodes and nvim_feedkeys escape \x80 local inp = helpers.nvim('replace_termcodes', ':let x2="…"', true, true, true) - nvim('feedkeys', inp, '', true) + nvim('feedkeys', inp, '', true) -- escape_csi=true - -- Disabling CSI escaping in feedkeys + -- nvim_feedkeys with CSI escaping disabled inp = helpers.nvim('replace_termcodes', ':let x3="…"', true, true, true) - nvim('feedkeys', inp, '', false) + nvim('feedkeys', inp, '', false) -- escape_csi=false helpers.stop() end From 0b88bf256d629cfe53c94896e140511e7f312b25 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 2 Jul 2017 13:46:41 +0200 Subject: [PATCH 139/161] doc: api.txt; deprecate --- runtime/doc/api.txt | 105 +++++++++++++++++++++++++++++++++++-- runtime/doc/deprecated.txt | 8 ++- runtime/doc/gui.txt | 12 +---- runtime/doc/map.txt | 14 ++--- runtime/doc/tips.txt | 3 -- src/nvim/api/vim.c | 2 +- 6 files changed, 115 insertions(+), 29 deletions(-) diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index ebc2a40561..7c6b8a3c1a 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -165,7 +165,16 @@ nvim_input({keys}) *nvim_input()* *nvim_replace_termcodes()* nvim_replace_termcodes({str}, {from_part}, {do_lt}, {special}) - Replaces any terminal codes with the internal representation + Replaces terminal codes and |keycodes| (, , ...) in a + string with the internal representation. + + Parameters:~ + {str} String to be converted. + {from_part} Legacy Vim parameter. Usually true. + {do_lt} Also translate . Does nothing if + `special` is false. + {special} Replace |keycodes|, e.g. becomes a "\n" + char. nvim_command_output({str}) *nvim_command_output()* TODO: Documentation @@ -182,8 +191,10 @@ nvim_eval({expr}) *nvim_eval()* Evaluation result or expanded object nvim_call_function({fname}, {args}) *nvim_call_function()* - Calls a VimL function with the given arguments. On VimL error: - Returns a generic error; v:errmsg is not updated. + Calls a VimL function with the given arguments + + On VimL error: Returns a generic error; v:errmsg is not + updated. Parameters:~ {fname} Function to call @@ -192,6 +203,23 @@ nvim_call_function({fname}, {args}) *nvim_call_function()* Return:~ Result of the function call +nvim_execute_lua({code}, {args}) *nvim_execute_lua()* + Execute lua code. Parameters might be passed, they are + available inside the chunk as `...`. The chunk can return a + value. + + To evaluate an expression, it must be prefixed with "return ". + For instance, to call a lua function with arguments sent in + and get its return value back, use the code "return + my_function(...)". + + Parameters:~ + {code} lua code to execute + {args} Arguments to the code + + Return:~ + Return value of lua code if present or NIL. + nvim_strwidth({str}) *nvim_strwidth()* Calculates the number of display cells occupied by `text`. counts as one cell. @@ -382,6 +410,17 @@ nvim_get_mode() *nvim_get_mode()* Return:~ Dictionary { "mode": String, "blocking": Boolean } +nvim_get_keymap({mode}) *nvim_get_keymap()* + Get a list of dictionaries describing global (i.e. non-buffer) + mappings Note that the "buffer" key will be 0 to represent + false. + + Parameters:~ + {mode} The abbreviation for the mode + + Return:~ + An array of maparg() like dictionaries describing mappings + nvim_get_api_info() *nvim_get_api_info()* TODO: Documentation @@ -414,6 +453,54 @@ nvim_call_atomic({calls}) *nvim_call_atomic()* error ocurred, the values from all preceding calls will still be returned. +nvim__id({obj}) *nvim__id()* + Returns object given as argument + + This API function is used for testing. One should not rely on + its presence in plugins. + + Parameters:~ + {obj} Object to return. + + Return:~ + its argument. + +nvim__id_array({arr}) *nvim__id_array()* + Returns array given as argument + + This API function is used for testing. One should not rely on + its presence in plugins. + + Parameters:~ + {arr} Array to return. + + Return:~ + its argument. + +nvim__id_dictionary({dct}) *nvim__id_dictionary()* + Returns dictionary given as argument + + This API function is used for testing. One should not rely on + its presence in plugins. + + Parameters:~ + {dct} Dictionary to return. + + Return:~ + its argument. + +nvim__id_float({flt}) *nvim__id_float()* + Returns floating-point value given as argument + + This API function is used for testing. One should not rely on + its presence in plugins. + + Parameters:~ + {flt} Value to return. + + Return:~ + its argument. + ============================================================================== Buffer Functions *api-buffer* @@ -492,6 +579,18 @@ nvim_buf_get_changedtick({buffer}) *nvim_buf_get_changedtick()* Return:~ b:changedtickvalue. +nvim_buf_get_keymap({buffer}, {mode}) *nvim_buf_get_keymap()* + Get a list of dictionaries describing buffer-local mappings + Note that the buffer key in the dictionary will represent the + buffer handle where the mapping is present + + Parameters:~ + {mode} The abbreviation for the mode + {buffer_id} Buffer handle + + Return:~ + An array of maparg() like dictionaries describing mappings + nvim_buf_set_var({buffer}, {name}, {value}) *nvim_buf_set_var()* Sets a buffer-scoped (b:) variable diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt index 26cd5b24cc..b3e2f7a92f 100644 --- a/runtime/doc/deprecated.txt +++ b/runtime/doc/deprecated.txt @@ -39,10 +39,16 @@ Functions ~ *highlightID()* Obsolete name for |hlID()|. *last_buffer_nr()* Obsolete name for bufnr("$"). +Modifiers ~ +*:menu-* +*:menu-special* <> notation is always enabled. |cpo-<| +*:map-* +*:map-special* <> notation is always enabled. |cpo-<| + Options ~ *'fe'* 'fenc'+'enc' before Vim 6.0; no longer used. *'langnoremap'* Deprecated alias to 'nolangremap'. *'vi'* *'viminfo'* Deprecated alias to 'shada' option. - vim:tw=78:ts=8:ft=help:norl: + vim:noet:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt index 37462d4e96..b66a60c860 100644 --- a/runtime/doc/gui.txt +++ b/runtime/doc/gui.txt @@ -501,21 +501,13 @@ The ":set ic" will not be echoed when using this menu. Messages from the executed command are still given though. To shut them up too, add a ":silent" in the executed command: > :menu Search.Header :exe ":silent normal /Header\r" -"" may also appear just after "" or "