{"action":"created","issue":{"url":"https://api.github.com/repos/ronf/asyncssh/issues/28","labels_url":"https://api.github.com/repos/ronf/asyncssh/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/ronf/asyncssh/issues/28/comments","events_url":"https://api.github.com/repos/ronf/asyncssh/issues/28/events","html_url":"https://github.com/ronf/asyncssh/issues/28","id":110290505,"number":28,"title":"Unable to get exit status","user":{"login":"redixin","id":103634,"avatar_url":"https://avatars.githubusercontent.com/u/103634?v=3","gravatar_id":"","url":"https://api.github.com/users/redixin","html_url":"https://github.com/redixin","followers_url":"https://api.github.com/users/redixin/followers","following_url":"https://api.github.com/users/redixin/following{/other_user}","gists_url":"https://api.github.com/users/redixin/gists{/gist_id}","starred_url":"https://api.github.com/users/redixin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redixin/subscriptions","organizations_url":"https://api.github.com/users/redixin/orgs","repos_url":"https://api.github.com/users/redixin/repos","events_url":"https://api.github.com/users/redixin/events{/privacy}","received_events_url":"https://api.github.com/users/redixin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-07T18:43:02Z","updated_at":"2015-10-08T11:52:35Z","closed_at":null,"body":"I tried modified sample from docs:\r\n\r\n```python\r\n    import asyncio, asyncssh, sys\r\n\r\n    class MySSHClientSession(asyncssh.SSHClientSession):\r\n        def data_received(self, data, datatype):\r\n            if datatype == asyncssh.EXTENDED_DATA_STDERR:\r\n                print(data, end='', file=sys.stderr)\r\n            else:\r\n                print(data, end='')\r\n        def exit_status_received(self, status):\r\n            if status:\r\n                print('Program exited with status %d' % status, file=sys.stderr)\r\n            else:\r\n                print('Program exited successfully')\r\n        def connection_lost(self, exc):\r\n            if exc:\r\n                print('SSH session error: ' + str(exc), file=sys.stderr)\r\n\r\n    @asyncio.coroutine\r\n    def run_client():\r\n        with (yield from asyncssh.connect('192.168.1.1', username=\"root\", client_keys=[\"/home/eye/.ssh/test\"])) as conn:\r\n            chan, session = yield from conn.create_session(MySSHClientSession, 'ls abc')\r\n            yield from chan.wait_closed()\r\n\r\n    try:\r\n        asyncio.get_event_loop().run_until_complete(run_client())\r\n    except (OSError, asyncssh.Error) as exc:\r\n        sys.exit('SSH connection failed: ' + str(exc))\r\n```\r\n\r\nand got:\r\n\r\n```\r\n$ python /tmp/d.py \r\nls: abc: No such file or directory\r\n$\r\n```\r\nSeems `exit_status_received` was not called at all."},"comment":{"url":"https://api.github.com/repos/ronf/asyncssh/issues/comments/146515020","html_url":"https://github.com/ronf/asyncssh/issues/28#issuecomment-146515020","issue_url":"https://api.github.com/repos/ronf/asyncssh/issues/28","id":146515020,"user":{"login":"redixin","id":103634,"avatar_url":"https://avatars.githubusercontent.com/u/103634?v=3","gravatar_id":"","url":"https://api.github.com/users/redixin","html_url":"https://github.com/redixin","followers_url":"https://api.github.com/users/redixin/followers","following_url":"https://api.github.com/users/redixin/following{/other_user}","gists_url":"https://api.github.com/users/redixin/gists{/gist_id}","starred_url":"https://api.github.com/users/redixin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redixin/subscriptions","organizations_url":"https://api.github.com/users/redixin/orgs","repos_url":"https://api.github.com/users/redixin/repos","events_url":"https://api.github.com/users/redixin/events{/privacy}","received_events_url":"https://api.github.com/users/redixin/received_events","type":"User","site_admin":false},"created_at":"2015-10-08T11:52:35Z","updated_at":"2015-10-08T11:52:35Z","body":"I tried openssh and dropbear:\r\n\r\n - SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3\r\n - Dropbear server v2015.67\r\n\r\nBoth returns exit status (at least openssh client is able to retrieve it):\r\n\r\n```\r\n$ ssh root@192.168.1.1 exit 42\r\n$ echo $?\r\n42\r\n$ ssh localhost ls abc\r\nls: cannot access abc: No such file or directory\r\n$ echo $?\r\n2\r\n$\r\n```\r\n\r\nMore details about environment:\r\n```\r\nPython 3.4.0\r\nasyncssh==1.2.1\r\npycrypto==2.6.1\r\nwheel==0.24.0\r\n```"}}