Properly escape special characters for WSL clipboard

Former-commit-id: 6872560fa651713dd7fd31dacd8e872d1059013d
Former-commit-id: dc8901231a753531a19b43bb72e95b29949955e8
This commit is contained in:
2023-04-17 13:15:29 -04:00
parent a03b250599
commit 727937772f
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -735,7 +735,7 @@ def copy_data():
# PORT START CLIPBOARD
# WSL clipboard detection
if 'WSL_DISTRO_NAME' in environ:
run(['pwsh.exe', '-c', 'Set-Clipboard', _copy_line[_index].rstrip()])
run(['powershell.exe', '-c', "Set-Clipboard '" + _copy_line[_index].rstrip().replace("'", "''") + "'"])
Popen("sleep 30; pwsh.exe -c 'echo \"\" | Set-Clipboard'", shell=True)
# Wayland clipboard detection
elif 'WAYLAND_DISPLAY' in environ: