Skip to content

Commit

Permalink
Fix for ssh serving issues:
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshHeitzman authored and jonathanslenders committed Aug 11, 2020
1 parent 75f2390 commit 548a99e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions prompt_toolkit/contrib/ssh/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ def write(s, data):
def flush(s):
pass

@property
def encoding(s):
return self._chan._orig_chan.get_encoding()[0]

self.stdout = cast(TextIO, Stdout())

def _get_size(self) -> Size:
Expand All @@ -65,9 +69,11 @@ async def _interact(self) -> None:
# Should not happen.
raise Exception("`_interact` called before `connection_made`.")

# Disable the line editing provided by asyncssh. Prompt_toolkit
# provides the line editing.
self._chan.set_line_mode(False)
if hasattr(self._chan, "set_line_mode") and self._chan._editor is not None:
# Disable the line editing provided by asyncssh. Prompt_toolkit
# provides the line editing.
self._chan.set_line_mode(False)

term = self._chan.get_terminal_type()

self._output = Vt100_Output(
Expand Down

0 comments on commit 548a99e

Please sign in to comment.