(defun my/wsl-copy-region-to-clipboard () (interactive) (unless (use-region-p) (user-error "not specified region")) (let ((input (buffer-substring-no-properties (region-beginning) (region-end))) (cmd "/mnt/c/Windows/System32/clip.exe") (windows-encoding 'utf-16le)) (deactivate-mark) (with-temp-buffer (set-buffer-file-coding-system windows-encoding) (insert input) (let ((coding-system-for-write windows-encoding)) (unless (zerop (call-process-region (point-min) (point-max) cmd)) (error "failed to copy to Windows clipboard")))))) ;; キーは好きなものにしてください (global-set-key (kbd "C-x M-w") #'my/wsl-copy-region-to-clipboard)
専用のツールを使ったり文字エンコーディングツールを別途使うなどでも対応はできるが, clip.exeと elispだけでもなんとかなった.