diff --git a/remote_ikernel/kernel.py b/remote_ikernel/kernel.py index 6ad68e1..7a92ff3 100755 --- a/remote_ikernel/kernel.py +++ b/remote_ikernel/kernel.py @@ -13,6 +13,7 @@ import logging import os import re +import signal import subprocess import time import uuid @@ -27,6 +28,10 @@ class pexpect_spawn(PopenSpawn): def isalive(self): return self.proc.poll() is None + + def sendintr(self): + """sendintr does not exist on PopenSpawn, use kill instead""" + self.kill(signal.SIGINT) from tornado.log import LogFormatter @@ -520,6 +525,7 @@ def tunnel_connection(self): # connection info should have the ports being used tunnel_command = self.tunnel_cmd.format(**self.connection_info) tunnel = pexpect_spawn(tunnel_command, logfile=self.log) + tunnel.linesep = "\n" check_password(tunnel) self.log.info( @@ -606,6 +612,7 @@ def _spawn(self, command, timeout=600): """ if self.connection is None: self.connection = pexpect_spawn(command, timeout=timeout, logfile=self.log) + self.connection.linesep = "\n" else: self.connection.sendline(command)