[ISSUE WITH WSL NOT WINDOWS TERMINAL] Pasting from clipboard broken when running ssh-add.exe 2> /dev/null #19317

Open
opened 2026-01-31 06:39:58 +00:00 by claunia · 0 comments
Owner

Originally created by @OlJohnny on GitHub (Feb 5, 2023).

Windows Terminal version

1.15.3465.0

Windows build number

10.0.19045.0

Other Software

  • WSL2 with Ubuntu (C:\WINDOWS\system32\wsl.exe -d Ubuntu-20.04)
  • ssh-add.exe (OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2)

Steps to reproduce

  • You need to have a passphrase protected ssh key in your windows HOME/.ssh directory (just execute ssh-keygen in a PowerShell Terminal)
  • Start the Windows OpenSSH ssh-agent in an Administrator PowerShell Terminal Start-Service ssh-agent
  • Start WSL2 distribution in Windows Terminal
  • run ssh-add.exe and try to paste your passphrase

Expected Behavior

The passphrase gets pasted (without seeing it) and the key is successfully loaded into the ssh-agent.
This actually works, when running the WSL2 VM by just starting it from the Windows Search (i think it is then running inside cmd.exe) See comments below

Actual Behavior

The passphrase gets pasted so that you can see the text!
Also loading the key then fails, as ssh-add.exe seems to be unable to read the pasted passphrase.
NOTE: this may doesn't happen on the first try, but after running ssh-add -D and ssh-add again, it nearly always happens

Originally created by @OlJohnny on GitHub (Feb 5, 2023). ### Windows Terminal version 1.15.3465.0 ### Windows build number 10.0.19045.0 ### Other Software * WSL2 with Ubuntu (<code>C:\WINDOWS\system32\wsl.exe -d Ubuntu-20.04</code>) * ssh-add.exe (<code>OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2</code>) ### Steps to reproduce * You need to have a passphrase protected ssh key in your windows <code>HOME/.ssh</code> directory (just execute ssh-keygen in a PowerShell Terminal) * Start the Windows OpenSSH ssh-agent in an Administrator PowerShell Terminal <code>Start-Service ssh-agent</code> * Start WSL2 distribution in Windows Terminal * run <code>ssh-add.exe</code> and try to paste your passphrase ### Expected Behavior The passphrase gets pasted (without seeing it) and the key is successfully loaded into the <code>ssh-agent</code>. <s>This actually works, when running the WSL2 VM by just starting it from the Windows Search (i <i>think</i> it is then running inside cmd.exe)</s> See comments below ### Actual Behavior The passphrase gets pasted so that you can see the text! Also loading the key then fails, as ssh-add.exe seems to be unable to read the pasted passphrase. NOTE: this may doesn't happen on the first try, but after running <code>ssh-add -D</code> and <code>ssh-add</code> again, it nearly always happens
claunia added the Needs-TriageIssue-Bug labels 2026-01-31 06:39:58 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19317