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)
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)
def _send_size(self): " Report terminal size to server. " rows, cols = _get_size(sys.stdout.fileno()) self._send_packet({ 'cmd': 'size', 'data': [rows, cols] })
def _send_size(self): " Report terminal size to server. " rows, cols = _get_size(sys.stdout.fileno()) self._send_packet({"cmd": "size", "data": [rows, cols]})