ishell icon indicating copy to clipboard operation
ishell copied to clipboard

ClearScreen function corrected

Open shadowshot-x opened this issue 3 years ago • 0 comments

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 avatar Sep 07 '21 18:09 shadowshot-x