Commit 031e994
Changed files (1)
command.go
@@ -39,7 +39,25 @@ var commandArray = []Command{Command{Command: "exit",
Value: "anonymous",
Usage: ""}},
Description: "Set the user name to utilize during this session. If not set, anonymous will be used.",
- Run: setUserName}}
+ Run: setUserName},
+ Command{
+ Command: "clear",
+ Description: "Clear the screen of all content. No scrollback will be available.",
+ Run: clearScreen}}
+
+// clearScreen clears the screen of all content in the main
+// window
+func clearScreen(command Command) error {
+ if ApplicationView.MainGui != nil {
+ if view, err := ApplicationView.MainGui.View(ApplicationView.MAIN_WINDOW_NAME); err != nil {
+ return fmt.Errorf("Error clearing screen: %+v", err)
+ } else {
+ view.Clear()
+ return nil
+ }
+ }
+ return fmt.Errorf("No application window.")
+}
// sets the user name for this session
func setUserName(command Command) error {