Skip to content

Commit add4f15

Browse files
committed
ssh: cli not handling latin1 put_char requests
When starting a ssh daemon with a shell, connecting to it and pressing CTRL+C on the ssh client, a message appears on the host machine: ``` 1> application:ensure_all_started(ssh). {ok,[crypto,asn1,public_key,ssh]} 2> ssh:daemon(2222, [{shell,{shell,start,[]}}, {system_dir, "."}, {exec,erlang_eval}, {pwdfun, fun(_,_) -> true end}]). {ok,<0.100.0>} {unhandled_request,{put_chars_sync,latin1,<<"** ">>,undefined}} ``` This commit addresses that by properly processing latin1 encodings in `ssh_cli`, as `user_drv` already managed these cases.
1 parent 6a96312 commit add4f15

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

lib/ssh/src/ssh_cli.erl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,8 +450,13 @@ io_request(delete_after_cursor, TTY, _State) ->
450450
prim_tty:handle_request(TTY, delete_after_cursor);
451451
io_request(delete_line, TTY, _State) ->
452452
prim_tty:handle_request(TTY, delete_line);
453+
io_request({put_chars, latin1, Chars}, TTY, _State) ->
454+
prim_tty:handle_request(TTY, {putc, unicode:characters_to_binary(Chars, latin1)});
453455
io_request({put_chars, unicode, Chars}, TTY, _State) ->
454456
prim_tty:handle_request(TTY, {putc, unicode:characters_to_binary(Chars)});
457+
io_request({put_chars_sync, latin1, Chars, Reply}, TTY, State) ->
458+
State#state.group ! {reply, Reply, ok},
459+
prim_tty:handle_request(TTY, {putc, unicode:characters_to_binary(Chars, latin1)});
455460
io_request({put_chars_sync, unicode, Chars, Reply}, TTY, State) ->
456461
State#state.group ! {reply, Reply, ok},
457462
prim_tty:handle_request(TTY, {putc, unicode:characters_to_binary(Chars)});

0 commit comments

Comments
 (0)