Commit 2972f219 authored by Antoine Millet's avatar Antoine Millet
Browse files

Handle resize on all opened shells

parent 2c8bb383
Loading
Loading
Loading
Loading
+17 −4
Original line number Diff line number Diff line
@@ -980,10 +980,17 @@ class CliHandler(RegisteredCCHandler):
        :param xpixel: unused
        :param ypixel: unused
        """
        if label is None:
            tuns = [(c, st.label) for t, c, ct, st
                    in self.client.tunnels.values() if t == 'shell']
        else:
            ttype, client, ctun, stun = self.client.get_tunnel(label)
            if ttype != 'shell':
                raise ValueError('Label does not refers on a shell')
        client.resize(stun.label, row, col, xpixel, ypixel)
            tuns = [(client, stun.label)]

        for client, label in tuns:
            client.resize(label, row, col, xpixel, ypixel)

    #
    # Port forwarding:
@@ -1044,6 +1051,12 @@ class CliClient(Client):
        super(CliClient, self).__init__(*args, **kwargs)
        self._tunnels = {}  # Running tunnels for this client (as client)

    @property
    def tunnels(self):
        """ Get active client tunnels by label (a dict).
        """
        return self._tunnels

    def spawn_job(self, job_class, **kwargs):
        self._server.jobs.spawn(job_class, self.login, **kwargs)