                                 (format "Host: %s   Port: %s"
                                         (geiser-repl--host)
                                         (geiser-repl--port)))))
+
+(defvar geiser-repl--last-image nil)
+(defvar geiser-repl--last-image-filename nil)
 
 (defun geiser-repl--replace-images ()
   "Replace all image patterns with actual images"

                            (insert-file-contents-literally file nil)
                            (buffer-string)))))
          (delete-region begin end)
          (put-image (create-image imgdata nil t) begin "[image]")
          (delete-file file)
          ; XXX need to ensure that the file is in the temporary
          ; folder before deleting it. Racket will only generate files
          ; in the system temporary folder (/var/tmp), but we don't
          ; know what the temp. folder is, especially on Windows
          )))))

(defun geiser-repl--output-filter (txt)
  (geiser-con--connection-update-debugging geiser-repl--connection txt)
  (when (and geiser-repl-inline-images (display-images-p))
    (geiser-repl--replace-images))
  (when (string-match-p (geiser-con--connection-prompt geiser-repl--connection)
                        txt)
    (geiser-autodoc--disinhibit-autodoc)))

(geiser-custom--defcustom geiser-repl-inline-images t
   "Whether to display inline images in the REPL"
   :type 'boolean
   :group 'geiser-repl)

(geiser-custom--defcustom geiser-system-image-viewer "display"
   "Which system image viewer program to invoke upon M-x
geiser-view-last-image"
   :type 'string
   :group 'geiser-repl)

(geiser-custom--defface repl-input
