From 1c4be3d9f73ba250d2de68799029e0f8f8af1377 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Tue, 10 Aug 2021 22:03:07 +0200 Subject: [PATCH] Comment out newline replacements As suggested by https://github.com/gliderlabs/ssh/issues/129 to fix side-by-side splits in screen/tmux --- example_test.go | 2 +- go.mod | 2 +- session.go | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/example_test.go b/example_test.go index 972d3ef..2de7bb5 100644 --- a/example_test.go +++ b/example_test.go @@ -4,7 +4,7 @@ import ( "io" "io/ioutil" - "github.com/gliderlabs/ssh" + "github.com/tweag/gliderlabs-ssh" ) func ExampleListenAndServe() { diff --git a/go.mod b/go.mod index 6d83084..2156d89 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/gliderlabs/ssh +module github.com/tweag/gliderlabs-ssh go 1.12 diff --git a/session.go b/session.go index fbe5692..0fd4a09 100644 --- a/session.go +++ b/session.go @@ -1,7 +1,6 @@ package ssh import ( - "bytes" "context" "errors" "fmt" @@ -133,8 +132,8 @@ func (sess *session) Write(p []byte) (n int, err error) { m := len(p) // normalize \n to \r\n when pty is accepted. // this is a hardcoded shortcut since we don't support terminal modes. - p = bytes.Replace(p, []byte{'\n'}, []byte{'\r', '\n'}, -1) - p = bytes.Replace(p, []byte{'\r', '\r', '\n'}, []byte{'\r', '\n'}, -1) + // p = bytes.Replace(p, []byte{'\n'}, []byte{'\r', '\n'}, -1) + // p = bytes.Replace(p, []byte{'\r', '\r', '\n'}, []byte{'\r', '\n'}, -1) n, err = sess.Channel.Write(p) if n > m { n = m