Update focus rules to failback in safari
[invirt/packages/invirt-web.git] / code / ajaxterm.py
index 2b4ff44..8436914 100644 (file)
@@ -320,7 +320,7 @@ class Terminal:
                return r
        def dumplatin1(self):
                return self.dump().translate(self.trl1)
-       def dumphtml(self,color=1):
+       def dumphtml(self,color=1,force=False):
                h=self.height
                w=self.width
                r=""
@@ -343,7 +343,7 @@ class Terminal:
                        if i%w==w-1:
                                span+='\n'
                r='<?xml version="1.0" encoding="ISO-8859-1"?><pre class="term">%s</pre>'%r
-               if self.last_html==r:
+               if self.last_html==r and not force:
                        return '<?xml version="1.0"?><idem></idem>'
                else:
                        self.last_html=r
@@ -368,10 +368,10 @@ class SynchronizedMethod:
 
 class Multiplex:
        def __init__(self):
-               signal.signal(signal.SIGCHLD, signal.SIG_IGN)
                self.proc={}
                self.lock=threading.RLock()
                self.thread=threading.Thread(target=self.loop)
+               self.thread.daemon=True
                self.alive=1
                # synchronize methods
                for name in ['create','fds','proc_read','proc_write','dump','die','run']:
@@ -436,9 +436,9 @@ class Multiplex:
                        os.write(fd,s)
                except (IOError,OSError):
                        self.proc_kill(fd)
-       def dump(self,fd,color=1):
+       def dump(self,fd,color=1,force=False):
                try:
-                       return self.proc[fd]['term'].dumphtml(color)
+                       return self.proc[fd]['term'].dumphtml(color, force)
                except KeyError:
                        return False
        def loop(self):