From 7be5509fa7d415436d80070730905f99ef5a57c6 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Wed, 25 Oct 2023 10:53:14 -0400 Subject: [PATCH] sshyp-mfa - Update to newer clipboard methods for WSL and Wayland --- extensions/sshyp-mfa/sshyp-mfa.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/sshyp-mfa/sshyp-mfa.py b/extensions/sshyp-mfa/sshyp-mfa.py index c4da709..706a3b5 100755 --- a/extensions/sshyp-mfa/sshyp-mfa.py +++ b/extensions/sshyp-mfa/sshyp-mfa.py @@ -85,9 +85,9 @@ if __name__ == '__main__': else: _mfa_key = totp(mfa_data[1], mfa_data[2], mfa_data[3], mfa_data[4]) if 'WSL_DISTRO_NAME' in environ: # WSL clipboard detection - run(('powershell.exe', '-c', 'Set-Clipboard', _mfa_key)) + run(('powershell.exe', '-c', "Set-Clipboard '" + _mfa_key + "'")) elif 'WAYLAND_DISPLAY' in environ: # Wayland clipboard detection - run(('wl-copy', _mfa_key)) + run('wl-copy', stdin=Popen(('printf', _mfa_key), stdout=PIPE).stdout) elif uname()[0] == 'Haiku': # Haiku clipboard detection run(('clipboard', '-c', _mfa_key)) elif uname()[0] == 'Darwin': # MacOS clipboard detection