From 1456f58755602a71b4bf8c5da798a76ef5f70734 Mon Sep 17 00:00:00 2001 From: arjunshajitech Date: Sat, 17 May 2025 23:09:10 +0530 Subject: [PATCH] Add clear screen using ANSI escape --- ironhawk/main.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ironhawk/main.go b/ironhawk/main.go index 9a0d3d5..36f8ca4 100644 --- a/ironhawk/main.go +++ b/ironhawk/main.go @@ -71,11 +71,15 @@ func Run(host string, port int) { } input = strings.TrimSpace(input) - if input == "exit" { + switch input { + case "": + continue + case "exit": return - } - - if input == "" { + case "clear": + // \033[H moves the cursor to the top-left corner of the screen. + // \033[2J clears the entire screen. + fmt.Print("\033[H\033[2J") continue }