aboutsummaryrefslogtreecommitdiff
path: root/console.go
diff options
context:
space:
mode:
Diffstat (limited to 'console.go')
-rw-r--r--console.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/console.go b/console.go
index 9ca2a70..69082ae 100644
--- a/console.go
+++ b/console.go
@@ -19,8 +19,11 @@ func NewConsole() *Console {
func (c *Console) Read(p []byte) (int, error) {
n, err := c.r.Read(p)
- if n > 0 && p[0] == 10 {
- p[0] = 13
+ for i, v := range p {
+ // replace nl with cr
+ if v == 10 {
+ p[i] = 13
+ }
}
return n, err
}