Hide the cursor. Don't forget to show the cursor at least at the end of your application with Show. Otherwise the user might have a terminal with a permanently hidden cursor, until he reopens the terminal.
()
| 77 | // Don't forget to show the cursor at least at the end of your application with Show. |
| 78 | // Otherwise the user might have a terminal with a permanently hidden cursor, until he reopens the terminal. |
| 79 | func (c *Cursor) Hide() { |
| 80 | handle := syscall.Handle(c.writer.Fd()) |
| 81 | |
| 82 | var cci consoleCursorInfo |
| 83 | _, _, _ = procGetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&cci))) |
| 84 | cci.visible = 0 |
| 85 | |
| 86 | _, _, _ = procSetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&cci))) |
| 87 | } |
| 88 | |
| 89 | // ClearLine clears the current line and moves the cursor to its start position. |
| 90 | func (c *Cursor) ClearLine() { |