 (defun fstar-subp-with-interactive-args (args)
   "Return ARGS precedeed by --in and the filename of the current buffer."
   (let ((file-name
-         (if (eq system-type 'cygwin)
-             (string-trim-right
-              (shell-command-to-string
-               (format "cygpath -w %s"
-                       (shell-quote-argument buffer-file-name))))
-           buffer-file-name)))
+         (cond
+          ((tramp-tramp-file-p buffer-file-name)
+           (tramp-file-name-localname
+            (tramp-dissect-file-name buffer-file-name)))
+          ((eq system-type 'cygwin)
+           (string-trim-right
+            (shell-command-to-string
+             (format "cygpath -w %s" (shell-quote-argument buffer-file-name)))))
+          (t buffer-file-name))))
     (append `(,file-name "--in") args)))
 
 (defun fstar-subp-adjust-path (fn buf prog args)

    (error "Can't start F* subprocess without a backing file (save this buffer first)"))
  (unless fstar-subp--process
    (let ((prog-abs (fstar-find-executable)))
      (fstar--init-compatibility-layer)
      (let* ((buf (fstar-subp-make-buffer))
             (process-connection-type nil)
             (args (fstar-subp-with-interactive-args (fstar-subp-get-prover-args)))
             (proc (fstar-subp-start-process buf prog-abs args)))
        (fstar-log "Started F* interactive: %S" (cons prog-abs args))

(defun fstar-find-executable ()
  "Compute the absolute path to the F* executable.
Check that the binary exists and is executable; if not, raise an
error.  These checks are skipped if the current file is remote."
  (if (tramp-tramp-file-p buffer-file-name)
      (progn (message "Running remotely: \
skipping `fstar-executable' presence check.")
             fstar-executable)
    (let ((prog-abs (and fstar-executable (executable-find fstar-executable))))
      (unless (and prog-abs (file-exists-p prog-abs))
        (user-error "F* executable not found; \
please set `fstar-executable'"))
      (unless (file-executable-p prog-abs)
        (user-error "F* executable not executable; \
please check the value of `fstar-executable'"))
      prog-abs)))

(defvar-local fstar--vernum nil
  "F*'s version number.")
