summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Nilsson <hans@erlang.org>2014-01-28 14:26:21 +0100
committerHans Nilsson <hans@erlang.org>2014-02-14 12:07:53 +0100
commit0b032d01637d039d508fa331c51ba24e8ae7f94e (patch)
tree10196fd116ca50035e3a41bf076f67d63ee5e3d8
parent096fd73c8e2779b0f07be4ef649991d8cd32c075 (diff)
downloaderlang-0b032d01637d039d508fa331c51ba24e8ae7f94e.tar.gz
ssh: The server ssh_cli does not delay tty_geometry requests in case no tty is allocated
-rw-r--r--lib/ssh/src/ssh_cli.erl15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/ssh/src/ssh_cli.erl b/lib/ssh/src/ssh_cli.erl
index 2c8e515a14..a53521c236 100644
--- a/lib/ssh/src/ssh_cli.erl
+++ b/lib/ssh/src/ssh_cli.erl
@@ -170,10 +170,19 @@ handle_msg({Group, get_unicode_state}, State) ->
{ok, State};
handle_msg({Group, tty_geometry}, #state{group = Group,
- pty = #ssh_pty{width=Width,
- height=Height}
+ pty = Pty
} = State) ->
- Group ! {self(),tty_geometry,{Width,Height}},
+ case Pty of
+ #ssh_pty{width=Width,height=Height} ->
+ Group ! {self(),tty_geometry,{Width,Height}};
+ _ ->
+ %% This is a dirty fix of the problem with the otp ssh:shell
+ %% client. That client will not allocate a tty, but someone
+ %% asks for the tty_geometry just before every erlang prompt.
+ %% If that question is not answered, there is a 2 sec timeout
+ %% Until the prompt is seen by the user at the client side ...
+ Group ! {self(),tty_geometry,{0,0}}
+ end,
{ok,State};
handle_msg({Group, Req}, #state{group = Group, buf = Buf, pty = Pty,