frame_data[$y][$x])) $this->frame_data[$y][$x] = ''; else $this->frame_data[$y][$x] .= '|'; $this->frame_data[$y][$x] .= $matches[0]; switch ($matches[2]) { // We ignore 'm' they are color CSIs case 'm': break; case 'C': $x += $matches[1]; // Advance our position break; default: dump('Unhandled CSI: '.$matches[2]); } break; case ' ': dump(['l'=>__LINE__,'LOOSE ESC?']); break; default: // Allow for the original ESC $c--; $advance++; $fieldtype = ord($nextbyte); $fieldlength = $this->findEOF(chr($fieldtype),$c+2,$content)+1; $byte = ''; $this->fields->push(new FrameFields([ 'type'=>chr($fieldtype), 'length'=>$fieldlength, 'x'=>$x, // Adjust for the ESC char 'y'=>$y, ])); Log::debug(sprintf('Field found at [%s,%s], Type: %s, Length: %s',$x-1,$y,$fieldtype,$fieldlength)); $advance += $fieldlength-2; $x += $fieldlength; $chars = $this->fields->last()->output(AnsiFrame::$if_filler); } break; default: $x++; } $this->frame_content[$y][$x] = $byte; $output .= $byte; if ($advance) { $output .= $chars; $c += $advance; } if ($x > $width) { $x = 1; $y++; } } return $output; } }