microsoft / microsoft/vscode-remote-release

ssh -T causes git to stuck - How do I prevent Remote VSCode from using ssh -T?

Open
#11,259 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ssh
Dominant language
Dockerfile
Stars
4.2k
Forks
469
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Is there an existing issue for this bug?
  • I have searched the existing open issues and found none that apply.
  • If I find any issue of interest that is related or closed, I will included a link to it in this issue.
Required Troubleshooting Steps
  • I have read and performed the troubleshooting steps
  • I have tried both values of the remote.SSH.useLocalServer setting
  • My issue was not covered in the Tips and Tricks linked from the Troubleshooting Wiki.
  • I will include a complete copy of my Remote - SSH logs by running Remote-SSH: Show Log in the command palette or from View > Output in the menu bar
[Optional] Diagnose with Copilot

I did not ask the @remote-ssh participant for help

In step 2 of the troubleshooting wiki, what was the result of running the generated SSH command verbatim outside of VS Code?

I COULD successfully SSH to the remote machine with the generated SSH command

Remote-SSH Log

Almost any Git operation within VSCode hangs for ever. After searching, I found this resolved ticket that discovered that the issue can be reproduced in a terminal by ssh -T host, but it provides no solution.

How do I tell VSCode to not use ssh -T when connecting to a remote server over SSH?

Remote-SSH Log

[21:41:08.381] Log Level: 2
[21:41:08.431] SSH Resolver called for "ssh-remote+7b22686f73744e616d65223a2250726f746f6e227d", attempt 1
[21:41:08.436] remote.SSH.useLocalServer = false
[21:41:08.437] remote.SSH.useExecServer = true
[21:41:08.437] remote.SSH.bindHost = {}
[21:41:08.437] remote.SSH.showLoginTerminal = false
[21:41:08.438] remote.SSH.remotePlatform = {"sandbox.jkhwtv.csb":"linux","sandbox.czyxhq.csb":"linux","192.168.0.201":"macOS","192.168.0.200":"windows","Proton":"windows","MSD":"macOS"}
[21:41:08.438] remote.SSH.path = undefined
[21:41:08.438] remote.SSH.configFile = undefined
[21:41:08.438] remote.SSH.useFlock = true
[21:41:08.439] remote.SSH.lockfilesInTmp = false
[21:41:08.439] remote.SSH.localServerDownload = auto
[21:41:08.439] remote.SSH.remoteServerListenOnSocket = false
[21:41:08.439] remote.SSH.defaultExtensions = []
[21:41:08.440] remote.SSH.defaultExtensionsIfInstalledLocally = []
[21:41:08.440] remote.SSH.loglevel = 2
[21:41:08.440] remote.SSH.enableDynamicForwarding = true
[21:41:08.441] remote.SSH.enableRemoteCommand = false
[21:41:08.441] remote.SSH.serverPickPortsFromRange = {}
[21:41:08.441] remote.SSH.serverInstallPath = {}
[21:41:08.441] remote.SSH.permitPtyAllocation = false
[21:41:08.442] remote.SSH.preferredLocalPortRange = undefined
[21:41:08.442] remote.SSH.useCurlAndWgetConfigurationFiles = false
[21:41:08.442] remote.SSH.experimental.chat = false
[21:41:08.443] remote.SSH.experimental.enhancedSessionLogs = false
[21:41:08.443] remote.SSH.httpProxy = {}
[21:41:08.443] remote.SSH.httpsProxy = {}
[21:41:08.456] VS Code version: 1.105.0
[21:41:08.456] Remote-SSH version: remote-ssh@0.121.2025093015
[21:41:08.457] win32 x64
[21:41:08.502] SSH Resolver called for host: Proton
[21:41:08.503] Setting up SSH remote "Proton"
[21:41:08.536] Using commit id "03c265b1adee71ac88f833e065f7bb956b60550a" and quality "stable" for server
[21:41:08.537] Extensions to install: 
[21:41:08.550] Install and start server if needed
[21:41:08.560] Checking ssh with "C:\Users\Qwerty\cmd\ssh.exe -V"
[21:41:08.565] Got error from ssh: spawn C:\Users\Qwerty\cmd\ssh.exe ENOENT
[21:41:08.566] Checking ssh with "C:\WINDOWS\system32\ssh.exe -V"
[21:41:08.568] Got error from ssh: spawn C:\WINDOWS\system32\ssh.exe ENOENT
[21:41:08.569] Checking ssh with "C:\WINDOWS\ssh.exe -V"
[21:41:08.571] Got error from ssh: spawn C:\WINDOWS\ssh.exe ENOENT
[21:41:08.571] Checking ssh with "C:\WINDOWS\System32\Wbem\ssh.exe -V"
[21:41:08.573] Got error from ssh: spawn C:\WINDOWS\System32\Wbem\ssh.exe ENOENT
[21:41:08.573] Checking ssh with "C:\WINDOWS\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[21:41:08.575] Got error from ssh: spawn C:\WINDOWS\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[21:41:08.576] Checking ssh with "C:\WINDOWS\System32\OpenSSH\ssh.exe -V"
[21:41:08.626] > OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2

[21:41:08.636] Remote command length: 5051/8192 characters
[21:41:08.637] Running script with connection command: "C:\WINDOWS\System32\OpenSSH\ssh.exe" -T -D 54457 "Proton" powershell
[21:41:08.641] Generated SSH command: 'type "C:\Users\Qwerty\AppData\Local\Temp\vscode-linux-multi-line-command--roton-904599932.sh" | "C:\WINDOWS\System32\OpenSSH\ssh.exe" -T -D 54457 "Proton" powershell'
[21:41:08.642] Using connect timeout of 17 seconds
[21:41:08.645] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[21:41:09.689] > Invalid macro definition.
> Invalid macro definition.
> Invalid macro definition.
> Invalid macro definition.
> Invalid macro definition.
> Invalid macro definition.
> Invalid macro definition.
> Invalid macro definition.
> Invalid macro definition.
> Invalid macro definition.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Hi Qwerty, how are you today?
[21:41:09.690] Got some output, clearing connection timeout
[21:41:10.831] > Windows PowerShell
> Copyright (C) Microsoft Corporation. All rights reserved.
> 
> Install the latest PowerShell for new features and improvements! https://aka.ms/
> PSWindows
[21:41:10.847] > PS C:\Users\Qwerty>
> PS C:\Users\Qwerty> $uuid="c76b917a15b6"
[21:41:10.877] > PS C:\Users\Qwerty> 
[21:41:10.892] > PS C:\Users\Qwerty> "${uuid}: running"      
> c76b917a15b6: running
> PS C:\Users\Qwerty> "c76b917a15b6: pauseLog
[21:41:11.944] > c76b917a15b6: resumeLog
> PS C:\Users\Qwerty> main
[21:41:11.959] > 
[21:41:12.732] > Looking for existing CLI in C:\Users\Qwerty\.vscode-server
> Found installed CLI
> Starting cli: & 'C:\Users\Qwerty\.vscode-server\code-03c265b1adee71ac88f833e065f
> 7bb956b60550a.exe' command-shell --cli-data-dir 'C:\Users\Qwerty\.vscode-server\
> cli' --parent-process-id 31516 --on-host 127.0.0.1 --on-port --require-token 53e
[21:41:12.747] > 
> cdc89-5609-49ce-9e41-28cd22a70782 *> 'C:\Users\Qwerty\AppData\Local\Temp\tmpD47B
> .tmp'
[21:41:12.765] > 
[21:41:13.436] > c76b917a15b6: start
> SSH_AUTH_SOCK====
> listeningOn==49358==
> osReleaseId==windows==
[21:41:13.445] > 
> osVersion==10.0.26100==
> arch==x64==
> platform==windows==
> unpackResult====
> didLocalDownload==False==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime==49==
> execServerToken==11aaaa11-1111-11aa-1a11-11aa11a11111==
> c76b917a15b6: end
> 17140, watching 31516
[21:41:13.445] Received install output: 
SSH_AUTH_SOCK====
listeningOn==49358==
osReleaseId==windows==
osVersion==10.0.26100==
arch==x64==
platform==windows==
unpackResult====
didLocalDownload==False==
downloadTime====
installTime====
extInstallTime====
serverStartTime==49==
execServerToken==11aaaa11-1111-11aa-1a11-11aa11a11111==

[21:41:13.446] Remote server is listening on port 49358
[21:41:13.446] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":49358},"osReleaseId":"windows","arch":"x64","sshAuthSock":"","platform":"windows","execServerToken":"11aaaa11-1111-11aa-1a11-11aa11a11111"},"serverStartTime":49,"installUnpackCode":""}
[21:41:13.454] Starting forwarding server. local port 54468 -> socksPort 54457 -> remotePort 49358
[21:41:13.457] Forwarding server listening on port 54468
[21:41:13.457] Waiting for ssh tunnel to be ready
[21:41:13.460] > 
[21:41:13.461] [Forwarding server port 54468] Got connection 0
[21:41:13.465] Tunneled port 49358 to local port 54468
[21:41:13.466] Resolved "ssh-remote+7b22686f73744e616d65223a2250726f746f6e227d" to "port 54468"
[21:41:13.475] Initizing new exec server for ssh-remote+7b22686f73744e616d65223a2250726f746f6e227d
[21:41:13.475] Resolving exec server at port 54468
[21:41:13.491] [Forwarding server port 54468] Got connection 1
[21:41:13.521] Exec server for ssh-remote+7b22686f73744e616d65223a2250726f746f6e227d created and cached
[21:41:13.521] Extensions to install: 
[21:41:13.532] ------




[21:41:13.533] No hints found in the recent session.
[21:41:13.550] [server] Checking C:\Users\Qwerty\.vscode-server\cli\servers\Stable-03c265b1adee71ac88f833e065f7bb956b60550a\log.txt and C:\Users\Qwerty\.vscode-server\cli\servers\Stable-03c265b1adee71ac88f833e065f7bb956b60550a\pid.txt for a running server...
[21:41:13.552] [server] Found running server (pid=26904)
[21:41:22.703] Opening exec server for ssh-remote+7b22686f73744e616d65223a2250726f746f6e227d
[21:41:23.072] Opening exec server for ssh-remote+7b22686f73744e616d65223a2250726f746f6e227d
[21:41:23.240] Verified and reusing cached exec server for ssh-remote+7b22686f73744e616d65223a2250726f746f6e227d
[21:41:23.241] No hints found in the recent session.
[21:41:23.247] Verified and reusing cached exec server for ssh-remote+7b22686f73744e616d65223a2250726f746f6e227d
[21:41:23.249] No hints found in the recent session.
[21:41:23.263] Opening exec server for ssh-remote+7b22686f73744e616d65223a2250726f746f6e227d
[21:41:23.270] Opening exec server for ssh-remote+7b22686f73744e616d65223a2250726f746f6e227d
[21:41:23.357] Verified and reusing cached exec server for ssh-remote+7b22686f73744e616d65223a2250726f746f6e227d
[21:41:23.357] Verified and reusing cached exec server for ssh-remote+7b22686f73744e616d65223a2250726f746f6e227d
[21:41:23.359] No hints found in the recent session.
[21:41:23.361] No hints found in the recent session.

Expected Behavior

git operations don't hang and finish within seconds

Actual Behavior

In terminal, using git fetch or other git commands causes the terminal to hang.
Same goes with git extensions, they hang.

Steps To Reproduce
  1. connect over SSH to a remote server
  2. open terminal or git extension
  3. try to fetch from remote or push,
  4. Observe that the UI becomes locked without ability to cancel it. When run from terminal, it can be canceled with ctrl+c
Anything else?

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported flow: connect to the remote host, run the generated ssh -T command, then use git fetch or another Git operation. Compare the Remote-SSH log output with terminal behavior; done means Git operations complete within seconds and can be canceled normally.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
developer-experience, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.