diff --git a/.gitignore b/.gitignore index b949ae5..393f431 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ iris -iris.log \ No newline at end of file +iris.log +autocomplete \ No newline at end of file diff --git a/root/root.go b/root/root.go index 4b2f70c..8867239 100644 --- a/root/root.go +++ b/root/root.go @@ -287,8 +287,10 @@ func runWrapper() { if !suggestionsEnabled { return } - // don't render if shell is starting up - if isReload && naiveBuffer == "" { + + // If buffer is empty (e.g. backspace to 0 or after reload), clear overlay immediately + if naiveBuffer == "" { + os.Stdout.Write([]byte(overlay.ClearAndDisable())) return } @@ -309,6 +311,9 @@ func runWrapper() { } } + // Trigger initial render to clear any potential artifacts from previous session + renderOverlay() + for { inputSlice := make([]byte, 128) n, err := os.Stdin.Read(inputSlice)