pkg / term

Package term manages POSIX terminals.
BSD 2-Clause "Simplified" License
393 stars 64 forks source link

LF/CR issue in rawmode #44

Closed terrancewong closed 5 years ago

terrancewong commented 5 years ago

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"

puellanivis commented 5 years ago

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