def color_lines(self, data):
        """Apply colorization rules to each line in data"""
        decoded_data = self._decode(data)
        # TODO: This will only work if all lines are received at once. Instead
        # of directly splitting lines, we should buffer the data lines until
        # the last character is a line break
        lines = decoded_data.splitlines(True)  # Keep line breaks
        colored_lines = [self.colorize_cmake(line) for line in lines]
        colored_data = ''.join(colored_lines)
        encoded_data = self._encode(colored_data)
        return encoded_data