pkg/term

LF/CR issue in rawmode

terrancewong opened this issue · 1 comments

OS: Linux

After

     t, _ := term.Open("/dev/tty")
     defer t.Close()
     defer t.Restore()
     term.RawMode(t)

Any fmt.Printf("something ...\n") or fmt.Println() to stdio results LF only, without CR.
Have to print ending with "\n\r"

This is Working By Design. The conversion of bare line-feed into a line-feed carriage return is a feature of a “cooked” terminal: https://unix.stackexchange.com/questions/366423/unexpected-indentation-behaviour-when-i-set-the-terminal-to-raw-mode-why-is-th/366426