From d868476d356457156bed86bf8aff730cdb491aed Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Thu, 25 May 2023 09:38:20 -0400 Subject: [PATCH] Fixed use of multiple versions of Powershell under WSL (now uses only system-provided executable) Former-commit-id: b804ff1921655a73423b67332385f7dbf5a20319 Former-commit-id: 8dfced454233d135877582617c12ec0615ba73ca --- lib/sshyp.py | 2 +- port-jobs/CLIPBOARD.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sshyp.py b/lib/sshyp.py index 807283a..000923b 100755 --- a/lib/sshyp.py +++ b/lib/sshyp.py @@ -650,7 +650,7 @@ def copy_data(): # WSL clipboard detection if 'WSL_DISTRO_NAME' in environ: run(('powershell.exe', '-c', "Set-Clipboard '" + _copy_line[_index].replace("'", "''") + "'")) - Popen("sleep 30; pwsh.exe -c 'echo \"\" | Set-Clipboard'", shell=True) + Popen("sleep 30; powershell.exe -c 'echo \"\" | Set-Clipboard'", shell=True) # Wayland clipboard detection elif 'WAYLAND_DISPLAY' in environ: run(('wl-copy', _copy_line[_index])) diff --git a/port-jobs/CLIPBOARD.py b/port-jobs/CLIPBOARD.py index 2f6faa1..6e30cae 100755 --- a/port-jobs/CLIPBOARD.py +++ b/port-jobs/CLIPBOARD.py @@ -10,7 +10,7 @@ if len(arguments) > 0: if arguments[0] == 'WSL': replacement = """run(['powershell.exe', '-c', "Set-Clipboard '" + _copy_line[_index].rstrip()\ .replace("'", "''") + "'"]) - Popen("sleep 30; pwsh.exe -c 'echo \\"\\" | Set-Clipboard'", shell=True)""" + Popen("sleep 30; powershell.exe -c 'echo \\"\\" | Set-Clipboard'", shell=True)""" elif arguments[0] == 'MAC': replacement = """run(['pbcopy'], stdin=Popen(['printf', _copy_line[_index].rstrip()\ .replace('\\\\\\', '\\\\\\\\\\\\\\').replace('%', '%%')],stdout=PIPE).stdout)