Skip to content

Commit

Permalink
fix xclip
Browse files Browse the repository at this point in the history
  • Loading branch information
seagle0128 committed Dec 29, 2023
1 parent 5e31e65 commit ee1981a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lisp/init-edit.el
Original file line number Diff line number Diff line change
Expand Up @@ -420,13 +420,12 @@
(use-package xclip
:hook (after-init . xclip-mode)
:config
(set-clipboard-coding-system 'gbk)

;; @see https://github.com/microsoft/wslg/issues/15#issuecomment-1796195663
(when (eq xclip-method 'wl-copy)
(set-clipboard-coding-system 'gbk) ; for wsl
(setq interprogram-cut-function
(lambda (text)
(start-process "wl-copy" nil "wl-copy" "--trim-newline" "--type" "text/plain;charset=utf-8" text))))))
(start-process "xclip" nil xclip-program "--trim-newline" "--type" "text/plain;charset=utf-8" text))))))

;; Open files as another user
(unless sys/win32p
Expand Down

0 comments on commit ee1981a

Please sign in to comment.