コード例 #1
0
        //CSI K
        private void ProcessEraseInLine(string param)
        {
            int d = ParseInt(param, 0);

            TerminalDocument doc = GetDocument();

            switch (d)
            {
            case 0:                     //erase right
                doc.RemoveAfterCaret();
                break;

            case 1:                     //erase left
                doc.CleanLineRange(0, doc.CaretColumn);
                break;

            case 2:                     //erase all
                                        //doc.Clear(GetDocument().TerminalWidth);
                doc.CleanLineRange(0, doc.TerminalWidth);
                break;

            default:
                throw new UnknownEscapeSequenceException(String.Format("unknown EL option {0}", param));
            }
        }
コード例 #2
0
        //CSI J
        protected void ProcessEraseInDisplay(string param)
        {
            int d = ParseInt(param, 0);

            TerminalDocument doc = GetDocument();
            int col = doc.CaretColumn;

            switch (d)
            {
            case 0:                     //erase below
                doc.RemoveAfterCaret();
                //doc.RemoveAfter(doc.TopLineNumber+doc.TerminalHeight);
                doc.ClearAfter(doc.CurrentLineNumber + 1);
                //_manipulator.Load(doc.CurrentLine, col);
                break;

            case 1:                     //erase above
                                        //_manipulator.FillSpace(0, _manipulator.CaretColumn);
                                        //doc.ReplaceCurrentLine(_manipulator.Export());
                doc.ClearRange(doc.TopLineNumber, doc.CurrentLineNumber);
                //_manipulator.Load(doc.CurrentLine, col);
                break;

            case 2:                     //erase all
                doc.ClearAfter(doc.TopLineNumber);
                break;

            default:
                throw new UnknownEscapeSequenceException(String.Format("unknown ED option {0}", param));
            }
        }