public void WriteCharacterAt(int x, int y, char character, CharacterAttribute attribute)
        {
            // TODO: Implement using terminfo capabalities

            TerminfoBindings.putp(_terminal.Cup(y, x));
            TerminfoBindings.putp(character + "");
        }
        public void Init()
        {
            var terminalName = System.Environment.GetEnvironmentVariable("TERM");
            var ret          = TerminfoBindings.setupterm(terminalName, 1, IntPtr.Zero);

            ret = TerminfoBindings.tgetent(IntPtr.Zero, terminalName);
            if (ret < 0)
            {
                throw new InvalidOperationException($"Terminfo database can't be opened. ** FATAL **");
            }

            if (ret == 0)
            {
                throw new InvalidOperationException($"Terminal '${terminalName}' definition not found in Terminfo db. Is TERM value set to the right value?");
            }



            var smcup = TerminfoBindings.tigetstr("smcup");

            TerminfoBindings.putp(TerminfoBindings.tparm(smcup));

            _terminal.Load();
        }
        public void WriteCharacterAt(int x, int y, char character)
        {
            TerminfoBindings.putp(_terminal.Cup(x, y));

            TerminfoBindings.putp(character + "");
        }