0 votes
by (8.4k points)

I want to clear the data which is entered in Terminal Control, I've used ResetText() and Screen.Clear() methods to do so, but they couldn't help me out. Could you please suggest me the possibilities.

2 Answers

0 votes
by (58.9k points)


I have checked it with the latest 2014R1 version of Rebex Terminal Emulation component and the ITerminal.Screen.Clear(bool) method should work and it should clear the terminal console as well as history (if you specify 'true' in the argument) as in the example below:


where terminal is an instance of VirtualTerminal (GUI-less terminal control) or TerminalControl (a GUI windows forms control).

However, if you plan to do terminal scripting in your application, then we suggest you to try our latest trial beta of Rebex Virtual Terminal component which will be released as part of 2014R2. It adds a brand new Scripting class with a new and much more comfortable API for scripting. Here is a short sample of how the Scripting API is to be used in combination with existing TerminalControl / VirtualTerminal classes if you use the beta build:

        string username = "user";
        string password = "password";

        var terminal = new TerminalControl();


        // connect to the server and bind TerminalControl
        Ssh client = new Ssh();
        client.Login(username, password);

        // the rest of this code can be safely called from a background thread

        // disable automated response processing

        // get the scripting object
        Scripting scripting = terminal.Scripting;

        // wait for "Last login:" prompt
        scripting.WaitFor(ScriptEvent.FromString("Last login:"));

        // detect prompt

        // clear the screen

        // send some command
        // if wait is needed, uncomment next line and specify a delay

        // send an 'exit' command to close the connection
0 votes
by (15.2k points)

The new Scripting API is released as 2014-R2 release.