abiosoft / ishell

Library for creating interactive cli applications.
MIT License
1.68k stars 195 forks source link

ClearScreen function corrected #146

Closed shadowshot-x closed 1 year ago

shadowshot-x commented 3 years ago

I noticed that we when performed ClearScreen operation on the ishell, sometimes old values from the previous screen were still displayed. This was because in the package github.com/abiosoft/readline, writer.Write([]byte("\033[H")) was used to clear the screen. However, we can simply do writer.Write([]byte("\033[H\033[2J")) to deal with this. It successfully clears the whole screen.

I also eliminated the need for external reference to readline package. We can use the io.Writer object of ishell directly to clear the screen.

I am attaching a screenshot for reference. The "ed ?" at the end of the first line should not be there in case of clearScreen as this was pasted from the previous screen.

130

Screenshot from 2021-09-08 00-00-44

shadowshot-x commented 1 year ago

Unmaintained repo, so closing