File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
prompt_toolkit/contrib/ssh Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ def write(s, data):
39
39
def flush (s ):
40
40
pass
41
41
42
+ @property
43
+ def encoding (s ):
44
+ return self ._chan ._orig_chan .get_encoding ()[0 ]
45
+
42
46
self .stdout = cast (TextIO , Stdout ())
43
47
44
48
def _get_size (self ) -> Size :
@@ -65,9 +69,11 @@ async def _interact(self) -> None:
65
69
# Should not happen.
66
70
raise Exception ("`_interact` called before `connection_made`." )
67
71
68
- # Disable the line editing provided by asyncssh. Prompt_toolkit
69
- # provides the line editing.
70
- self ._chan .set_line_mode (False )
72
+ if hasattr (self ._chan , 'set_line_mode' ) and self ._chan ._editor is not None :
73
+ # Disable the line editing provided by asyncssh. Prompt_toolkit
74
+ # provides the line editing.
75
+ self ._chan .set_line_mode (False )
76
+
71
77
term = self ._chan .get_terminal_type ()
72
78
73
79
self ._output = Vt100_Output (
You can’t perform that action at this time.
0 commit comments