public VT100Display(VT100.Buffer buf) { m_hs = new HoverScroll(Handle); m_eb = new EventBatcher(UpdateText, TimeSpan.FromMilliseconds(1)) { TriggerOnFirst = true }; m_sty = new Dictionary <VT100.Style, byte>(); m_cells = new Sci.CellBuf(); ContextMenuStrip = new CMenu(this); BlinkTimer = new System.Windows.Forms.Timer { Interval = 1000, Enabled = false }; BlinkTimer.Tick += SignalRefresh; AllowDrop = true; AutoScrollToBottom = true; ScrollToBottomOnInput = true; EndAtLastLine = true; // Use our own context menu UsePopUp = false; // Turn off undo history UndoCollection = false; Buffer = buf; }
[Test] public void Robustness() { // Blast the buffer with noise to make sure it can handle any input var settings = new VT100.Settings(); var buf = new VT100.Buffer(settings); buf.ReportUnsupportedEscapeSequences = false; var rnd = new Random(0); for (int i = 0; i != 10000; ++i) { var noise = rnd.Bytes().Take(rnd.Next(1000)).Select(x => (char)x).ToArray(); buf.Output(new string(noise)); } }
public VT100UI() { InitializeComponent(); Sci.LoadDll(".\\lib\\$(platform)\\$(config)"); var settings = new VT100.Settings(); var buffer = new VT100.Buffer(settings); var term = new VT100Display(buffer) { Dock = DockStyle.Fill }; buffer.Output(VT100.Buffer.TestConsoleString0); buffer.Output(VT100.Buffer.TestConsoleString1); buffer.Output("This string should be deleted " + "\x1b[0G\x1b[K" + "Replaced by this string"); Controls.Add(term); }