agl / xmpp-client

An XMPP client with OTR support
BSD 3-Clause "New" or "Revised" License
365 stars 71 forks source link

Use \r\n instead of \n in terminal output #126

Closed mutantmonkey closed 7 years ago

mutantmonkey commented 7 years ago

The default in golang.org/x/crypto/ssh/terminal was changed to set OPOST, which disables output postprocessing like ONLCR, which previously handled this for us. As a result, a carriage return was not being added to newlines in terminal output, which lead to weird display issues.

Fixes #124.

unkaktus commented 7 years ago

IMHO it should be fixed upstream (https://github.com/golang/go/issues/17364) by making a method of setting OPOST flag back. This will require just a few lines of code when initializing a terminal instead of doing s/\\n/\\r\\n/g. Even if you fix all write() calls here, the lack of OPOST flag also breaks everything else.

agl commented 7 years ago

Should be fixed by https://go-review.googlesource.com/#/c/33902/.