Skip to content

Restoring the buffer #25

@tcurdt

Description

@tcurdt

In Terminal window with the height of 10 - what's the expected result?

	n := 50
	for i := 0; i < n; i++ {
		fmt.Printf("foo-%d\n", i)
	}
	cursor.Up(n)

I am getting

$ go run test.go
foo-0
foo-1
foo-2
foo-3
foo-4
foo-5
foo-6
foo-7
foo-8
foo-9
foo-10
foo-11
foo-12
foo-13
foo-14
foo-15
foo-16
foo-17
foo-18
foo-19
foo-20
foo-21
foo-22
foo-23
foo-24
foo-25
foo-26
foo-27
foo-28
foo-29
foo-30
foo-31
foo-32
foo-33
foo-34
foo-35
foo-36
foo-37
foo-38
foo-39
foo-40
$

Same with UpAndClear(n).

I suspect that's more an ANSI thing rather than the libraries fault.
But is there a way to better deal with that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions