🎨 Use Mac environment variable
Switch to io.popen to allow the passing of the LANG environment variable
This commit is contained in:
parent
6c571a8296
commit
667b8c432c
|
@ -48,7 +48,14 @@ this.clipboard = (function()
|
|||
elseif this.platform == this.Platform.macos then
|
||||
self.clip_exe = "pbcopy"
|
||||
self.copy = function(text)
|
||||
return h.subprocess({ self.clip_exe, }, text)
|
||||
local handle = io.popen("LANG=en_US.UTF-8 pbcopy", 'w')
|
||||
if handle then
|
||||
handle:write(text)
|
||||
local suc, exit, code = handle:close()
|
||||
return { status = code }
|
||||
else
|
||||
return { status = 1 }
|
||||
end
|
||||
end
|
||||
else
|
||||
self.clip_exe = h.is_wayland() and "wl-copy" or "xclip"
|
||||
|
|
Loading…
Reference in a new issue