示例#1
0
    def get_window_size(self, cli):
        """
        Get the size to be used for the DynamicBody.
        This will be the smallest size of all clients.
        """
        get_active_window = self.arrangement.get_active_window
        active_window = get_active_window(cli)

        # Get connections watching the same window.
        connections = [
            c for c in self.connections
            if c.cli and get_active_window(c.cli) == active_window
        ]

        rows = [c.size.rows for c in connections]
        columns = [c.size.columns for c in connections]

        if self._runs_standalone:
            r, c = _get_size(sys.stdout.fileno())
            rows.append(r)
            columns.append(c)

        if rows and columns:
            return Size(rows=min(rows) - (1 if self.enable_status else 0),
                        columns=min(columns))
        else:
            return Size(rows=20, columns=80)
示例#2
0
文件: main.py 项目: haridsv/pymux
    def get_window_size(self, cli):
        """
        Get the size to be used for the DynamicBody.
        This will be the smallest size of all clients.
        """
        get_active_window = self.arrangement.get_active_window
        active_window = get_active_window(cli)

        # Get connections watching the same window.
        connections = [c for c in self.connections if
                       c.cli and get_active_window(c.cli) == active_window]

        rows = [c.size.rows for c in connections]
        columns = [c.size.columns for c in connections]

        if self._runs_standalone:
            r, c = _get_size(sys.stdout.fileno())
            rows.append(r)
            columns.append(c)

        if rows and columns:
            return Size(rows=min(rows) - (1 if self.enable_status else 0),
                        columns=min(columns))
        else:
            return Size(rows=20, columns=80)
示例#3
0
 def _send_size(self):
     " Report terminal size to server. "
     rows, cols = _get_size(sys.stdout.fileno())
     self._send_packet({
         'cmd': 'size',
         'data': [rows, cols]
     })
示例#4
0
 def _send_size(self):
     " Report terminal size to server. "
     rows, cols = _get_size(sys.stdout.fileno())
     self._send_packet({
         'cmd': 'size',
         'data': [rows, cols]
     })
示例#5
0
文件: client.py 项目: eas604/pymux
 def _send_size(self):
     " Report terminal size to server. "
     rows, cols = _get_size(sys.stdout.fileno())
     self._send_packet({"cmd": "size", "data": [rows, cols]})