       (with-current-buffer buffer
         (erase-buffer)
         (setq intero-targets targets)
+        (setq intero-source-buffer source-buffer)
         (setq intero-arguments arguments)
+        (setq intero-starting t)
         (setq intero-callbacks
-              (list (list source-buffer
-                          (lambda (source-buffer _msg)
-                            (when source-buffer
-                              (with-current-buffer source-buffer
-                                (when flycheck-mode
-                                  (run-with-timer 0 nil
-                                                  'intero-call-in-buffer
-                                                  (current-buffer)
-                                                  'intero-flycheck-buffer))))
+              (list (list (cons source-buffer
+                                buffer)
+                          (lambda (buffers _msg)
+                            (let ((source-buffer (car buffers))
+                                  (process-buffer (cdr buffers)))
+                              (with-current-buffer process-buffer
+                                (setq-local intero-starting nil))
+                              (when source-buffer
+                                (with-current-buffer source-buffer
+                                  (when flycheck-mode
+                                    (run-with-timer 0 nil
+                                                    'intero-call-in-buffer
+                                                    (current-buffer)
+                                                    'intero-flycheck-buffer)))))
                             (message "Booted up intero!"))))))
       (set-process-filter process
                           (lambda (process string)

                              (with-current-buffer (process-buffer process)
                                (goto-char (point-max))
                                (insert string)
                                (intero-read-buffer)))))
      (set-process-sentinel process 'intero-sentinel)
      buffer)))

  (setq intero-targets targets)
  (let ((arguments (intero-make-options-list
                    (or targets
                        (list (buffer-local-value 'intero-package-name buffer)))
                    t)))
    (insert (propertize
             (format "Starting:\n  stack ghci %s\n" (combine-and-quote-strings arguments))
             'face 'font-lock-comment-face))
