private static string TestPutChar(string initial, int col, char ch) { GLineManipulator m = new GLineManipulator(); m.Load(GLine.ToCharArray(initial), col); //Debug.WriteLine(String.Format("Test{0} [{1}] col={2} char={3}", num, SafeString(m._text), m.CaretColumn, ch)); m.PutChar(ch, TextDecoration.ClonedDefault()); //Debug.WriteLine(String.Format("Result [{0}] col={1}", SafeString(m._text), m.CaretColumn)); return(SafeString(m.InternalBuffer)); }
//BACK-BURNER public void Dump(string title) { Debug.WriteLine("<<<< DEBUG DUMP [" + title + "] >>>>"); Debug.WriteLine(String.Format("[size={0} top={1} current={2} caret={3} first={4} last={5} region={6},{7}]", _size, TopLineNumber, CurrentLineNumber, _caretColumn, FirstLineNumber, LastLineNumber, _scrollingTop, _scrollingBottom)); GLine gl = FindLineOrEdge(TopLineNumber); int count = 0; while (gl != null && count++ < _connection.TerminalHeight) { Debug.Write(String.Format("{0,3}", gl.ID)); Debug.Write(":"); Debug.Write(GLineManipulator.SafeString(gl.Text)); Debug.Write(":"); Debug.WriteLine(gl.EOLType); gl = gl.NextLine; } }
private static string TestPutChar(string initial, int col, char ch) { GLineManipulator m = new GLineManipulator(); m.Load(GLine.ToCharArray(initial), col); //Debug.WriteLine(String.Format("Test{0} [{1}] col={2} char={3}", num, SafeString(m._text), m.CaretColumn, ch)); m.PutChar(ch, TextDecoration.ClonedDefault()); //Debug.WriteLine(String.Format("Result [{0}] col={1}", SafeString(m._text), m.CaretColumn)); return SafeString(m.InternalBuffer); }
public AbstractTerminal(TerminalInitializeInfo info) { TerminalEmulatorPlugin.Instance.LaterInitialize(); _session = info.Session; //_invalidateParam = new InvalidateParam(); _document = new TerminalDocument(info.InitialWidth, info.InitialHeight); _document.SetOwner(_session.ISession); _afterExitLockActions = new List<AfterExitLockDelegate>(); _decoder = new ISO2022CharDecoder(this, EncodingProfile.Get(info.Session.TerminalSettings.Encoding)); _terminalMode = TerminalMode.Normal; _currentdecoration = TextDecoration.Default; _manipulator = new GLineManipulator(); _scrollBarValues = new ScrollBarValues(); _logService = new LogService(info.TerminalParameter, _session.TerminalSettings); _promptRecognizer = new PromptRecognizer(this); _intelliSense = new IntelliSense(this); _commandResultRecognizer = new PopupStyleCommandResultRecognizer(this); if (info.Session.TerminalSettings.LogSettings != null) _logService.ApplyLogSettings(_session.TerminalSettings.LogSettings, false); //event handlers ITerminalSettings ts = info.Session.TerminalSettings; ts.ChangeEncoding += delegate(EncodingType t) { this.Reset(); }; ts.ChangeRenderProfile += delegate(RenderProfile prof) { TerminalControl tc = _session.TerminalControl; if (tc != null) tc.ApplyRenderProfile(prof); }; }