Esempio n. 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));
            }
        }
Esempio n. 2
0
        private void ProcessScrollDown(string param)
        {
            int d = ParseInt(param, 1);

            TerminalDocument doc = GetDocument();
            int caret_col        = doc.CaretColumn;
            int offset           = doc.CurrentLineNumber - doc.TopLineNumber;

            //GLine nl = _manipulator.Export();
            doc.CleanLineRange(0, doc.TerminalWidth);             // .ReplaceCurrentLine(nl);
            if (doc.ScrollingBottom == -1)
            {
                doc.SetScrollingRegion(0, GetDocument().TerminalHeight - 1);
            }
            for (int i = 0; i < d; i++)
            {
                doc.ScrollUp(doc.ScrollingTop, doc.ScrollingBottom);                // TerminalDocument's "Scroll-Up" means XTerm's "Scroll-Down"
                doc.CurrentLineNumber = doc.TopLineNumber + offset;                 // find correct GLine
            }
            //_manipulator.Load(doc.CurrentLine, caret_col);
        }