Skip to content

PromptToolkitSSHSession._interact may fail on self._chan.set_line_mode(False) #1207

Closed
@JoshHeitzman

Description

@JoshHeitzman

I observed this call fail in two different ways:

  1. When self._chan is of the type asyncssh.editor.SSHLineEditorChannel and its self._editor is None the set_line_mode function raises an exception as tries to make a call on self._editor.
  2. When asyncssh.listen is called with the kwarg line_editor=False. In this case the type of self._chan is asyncssh.channel.SSHServerChannel and lacks a set_line_mode method.

In both cases I was able to workaround by putting the set_line_mode call under the condition:

if hasattr(self._chan, 'set_line_mode') and self._chan._editor is not None:

and the ssh example then worked fine, so it appears that the need to call set_line_mode is limited to specific configuration and isn't possible in other configuraitons.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions