\004 (btw, using `(kbd "C-d")` would be more readable) works only UNIXes. For Windows, you need to send (kbd "C-z"). Could you change this so that it sends the value of a variable (e.g. `sbt:quit-paste-command`), whose value is determined based on the

```lisp
(defvar sbt:quit-paste-command (kbd (if (eq system-type 'windows-nt) "C-z" "C-d")))
```