File 5109-ssh-Turn-off-extra-echo-in-erlang-shell-in-ssh-shell.patch of Package erlang

From 7d248a639764ad8bfb87e57c5afcbc69801f8c12 Mon Sep 17 00:00:00 2001
From: Hans Nilsson <hans@erlang.org>
Date: Mon, 7 Sep 2020 15:15:19 +0200
Subject: [PATCH 09/11] ssh: Turn off extra echo in erlang shell in ssh:shell

---
 lib/ssh/src/ssh.erl                |  4 +++-
 lib/ssh/test/ssh_basic_SUITE.erl   |  2 +-
 lib/ssh/test/ssh_options_SUITE.erl | 15 +--------------
 3 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/lib/ssh/src/ssh.erl b/lib/ssh/src/ssh.erl
index b3c1ac16fa..cccf0f0dbe 100644
--- a/lib/ssh/src/ssh.erl
+++ b/lib/ssh/src/ssh.erl
@@ -506,7 +506,9 @@ shell(Socket) when is_port(Socket) ->
 shell(ConnectionRef) when is_pid(ConnectionRef) ->
     case ssh_connection:session_channel(ConnectionRef, infinity) of
 	{ok,ChannelId}  ->
-	    success = ssh_connection:ptty_alloc(ConnectionRef, ChannelId, []),
+	    success = ssh_connection:ptty_alloc(ConnectionRef, ChannelId,
+                                                [{pty_opts, [{echo,0}]}
+                                                ]),
             success = ssh_connection:send_environment_vars(ConnectionRef, ChannelId,
                                                            ["LANG", "LC_ALL"]),
 	    Args = [{channel_cb, ssh_shell},
diff --git a/lib/ssh/test/ssh_basic_SUITE.erl b/lib/ssh/test/ssh_basic_SUITE.erl
index 28d7dd5e19..5c6798bbcb 100644
--- a/lib/ssh/test/ssh_basic_SUITE.erl
+++ b/lib/ssh/test/ssh_basic_SUITE.erl
@@ -1613,7 +1613,7 @@ new_do_shell_prompt(IO, N, type, Str, More) ->
     ct:log("Matched prompt ~p to trigger sending of next line to server",[N]),
     IO ! {input, self(), Str++"\r\n"},
     ct:log("Prompt '~p> ', Sent ~ts",[N,Str++"\r\n"]),
-    new_do_shell(IO, N, [{expect_echo,Str}|More]); % expect echo of the sent line
+    new_do_shell(IO, N, More);
 new_do_shell_prompt(IO, N, Op, Str, More) ->
     ct:log("Matched prompt ~p",[N]),
     new_do_shell(IO, N, [{Op,Str}|More]).
diff --git a/lib/ssh/test/ssh_options_SUITE.erl b/lib/ssh/test/ssh_options_SUITE.erl
index 39e2dd4c33..995d676cbf 100644
--- a/lib/ssh/test/ssh_options_SUITE.erl
+++ b/lib/ssh/test/ssh_options_SUITE.erl
@@ -1329,19 +1329,6 @@ one_shell_op(IO, TimeOut) ->
     end,
 
     IO ! {input, self(), "2*3*7.\r\n"},
-    receive
-	Echo0 -> ct:log("Echo: ~p ~n", [Echo0])
-    after TimeOut -> ct:fail("Timeout waiting for echo")
-    end,
-
-    receive
-	?NEWLINE -> ct:log("NEWLINE received", [])
-    after TimeOut -> 
-	    receive Any1 -> ct:log("Bad NEWLINE: ~p",[Any1])
-	    after 0 -> ct:fail("Timeout waiting for NEWLINE")
-	    end
-    end,
-
     receive
 	Result0 -> ct:log("Result: ~p~n", [Result0])
     after TimeOut ->  ct:fail("Timeout waiting for result")
@@ -1407,7 +1394,7 @@ max_sessions(Config, ParallelLogin, Connect0) when is_function(Connect0,2) ->
 	    ct:log("Connections up: ~p",[Connections]),
 	    [_|_] = Connections,
 
-	    %% Now try one more than allowed:
+	    %% N w try one more than allowed:
 	    ct:pal("Info Report expected here (if not disabled) ...",[]),
 	    try Connect(Host,Port)
 	    of
-- 
2.26.2

openSUSE Build Service is sponsored by