MCPcopy Create free account
hub / github.com/atomicgo/cursor / ClearLine

Method ClearLine

cursor_windows.go:90–101  ·  view source on GitHub ↗

ClearLine clears the current line and moves the cursor to its start position.

()

Source from the content-addressed store, hash-verified

88
89// ClearLine clears the current line and moves the cursor to its start position.
90func (c *Cursor) ClearLine() {
91 handle := syscall.Handle(c.writer.Fd())
92
93 var csbi consoleScreenBufferInfo
94 _, _, _ = procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi)))
95
96 var w uint32
97 var x short
98 cursor := csbi.cursorPosition
99 x = csbi.size.x
100 _, _, _ = procFillConsoleOutputCharacter.Call(uintptr(handle), uintptr(' '), uintptr(x), uintptr(*(*int32)(unsafe.Pointer(&cursor))), uintptr(unsafe.Pointer(&w)))
101}
102
103// Clear clears the current position and moves the cursor to the left.
104func (c *Cursor) Clear() {

Callers

nothing calls this directly

Calls 1

FdMethod · 0.80

Tested by

no test coverage detected