protected function appendTo($type, $command)
    {
        // Flatten one-liners
        $command = (array) $command;
        $command = array_values($command);
        $flattened = count($command) === 1 ? $command[0] : $command;

        // Format commands
        foreach ($command as $key => $entry) {
            $command[$key] = $type === 'history' ? '$ '.$entry : $entry;
        }

        $this->logs->log($command);

        // Get the various handles
        $handle = $this->getHistoryHandle();
        $history = $this->getHistory();
        $timestamp = (string) microtime(true);

        // Set new history on correct handle
        $history[$type][$timestamp] = $flattened;

        $this->history[$handle] = $history;
    }