Skip to content

Fix: ESC[E and ESC[F with no arguments did not move the cursor on the legacy terminal of Microsoft Windows #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

hymkor
Copy link
Contributor

@hymkor hymkor commented Nov 18, 2024

The default value when arguments are omitted, was not set as 1.

image

This behaviour was not reproduced on the new Windows Terminal. I do not know the reason.

image

If no problems, could you please merge my patch ?

ESC_F.go

//go:build run

package main

import (
	"fmt"

	"github.com/mattn/go-colorable"
)

func main() {
	o := colorable.NewColorableStdout()

	fmt.Fprint(o, "First line\n")
	fmt.Fprint(o, "\x1B[FSecond line\n")
}

ESC_E.go

//go:build run

package main

import (
	"fmt"

	"github.com/mattn/go-colorable"
)

func main() {
	o := colorable.NewColorableStdout()

	fmt.Fprint(o, "First line\n")
	fmt.Fprint(o, "\x1B[ESecond line\n")
}

@mattn mattn merged commit 603fb50 into mattn:master Nov 18, 2024
21 of 24 checks passed
@mattn
Copy link
Owner

mattn commented Nov 18, 2024

Thank you

@hymkor hymkor deleted the fork-20241118 branch November 18, 2024 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants