Permalink
Browse files

ssh: The server ssh_cli does not delay tty_geometry requests in case …

…no tty is allocated
  • Loading branch information...
1 parent 096fd73 commit 0b032d01637d039d508fa331c51ba24e8ae7f94e @HansN HansN committed Jan 28, 2014
Showing with 12 additions and 3 deletions.
  1. +12 −3 lib/ssh/src/ssh_cli.erl
View
@@ -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,

0 comments on commit 0b032d0

Please sign in to comment.