New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using ProxyCommand in Windows when creating the tunnel a new window appears #230
Comments
Having the same issue. |
I hope they solve it in the next release. At time, the issue isn't market as "bug". |
Please @roblourens , can you label this issue as BUG ? Thank you! |
I haven't had time to try this but can you explain what
What is this window, what does it show? A vscode window? |
Rob, whether you use connect.exe, nc.exe, or ssh.exe as the ProxyCommand for an SSH connection, the problem is that VSCode opens a new window to run that ProxyCommand, instead of running either silently, or within a Terminal window (within VSCode) |
@roblourens - sorry, missed the 2nd half of the question... The window remains empty. In the background it has established the tunnel (through whichever of the methods) and the ssh command to the host where the managed-source code is rides across that tunnel. A snapshot is attached, but it of course shows no content because there is no visible traffic within that TTY; it's all tunneled. |
Ok, I'm not sure why that window is showing up. vscode simply runs an |
So it is probably SSH that is causing the window to be started, since it is the command within the "ProxyCommand" that is causing it. I'm a Linux guy, not a Windows guy, so I'm not sure what "side-effect" causes a command execution to happen in a window, instead of being captured by the parent process (VSCode) of the initial SSH.exe command. I'm guessing that it is the method that VSCode is opening the SSH Process. If I run the same If this were Linux, then it might be a side effect of STDERR not being captured, or something like that. Is there a similar concept in Windows that would cause the extra window to open? |
Hi @roblourens ,
Off-topic: I suggest that Microsoft includes a native proxy helper (connect, ncat or any other) inside the Win32-OpenSSH distribution. It's a pain to require an external tool to drive the native OpenSSH client.
@d2inco has explained: a new CMD terminal is open.
I'm sure you're not doing this call (the one to open the SSH tunnel) in the same way as the previous (the two SSH connections to open the session to the server and start the service). The "SSH client" is executed three times, and just only one (the last that opens the tunnel) is causing this issue. Please, mark this as BUG. And do this simple test to check it:
Or if you use NetCat for Windows:
You see now the problem? |
Same problem appeared on my computer, my config file is like: Host jump Host target_server When I connect to target_server, a new pure black window with caption “C:\Windows\System32\OpenSSH\ssh.exe” is created. Just same as the picture post by @d2inco Fortunately, the remote function is working properly, I have not seen any problem yet since I am a shallow vscode user. |
So using I hope this bug will be solved in the MAY release (not included at time in the milestone): https://github.com/microsoft/vscode-remote-release/issues?q=is%3Aopen+is%3Aissue+milestone%3A%22May+2019%22). |
Can you tell me whether this happens if you set |
Ohhh!!!! If I set Futhermore, I have configured Cygwin/Bash as my default Terminal. Perhaps this is related. And I need also to comment that the In any case: I feel you're using a call to the Terminal for stablishing the Tunnel. And this is incorrect! The SSH command for the tunnel needs to be executed exactly as the rest of the initial SSH commands. Why you use the Terminal Shell to start it? I feel like we're close to finding the cause of this bug. |
In theory it seems that should work but in practice I understand a lot of windows tools expect a cmd environment and will open a window if they are not started in one.
When you set that setting we are, and that's why it works. The other SSH commands are started in terminals all the time so we can intercept their authentication prompts. Given all of this I don't think there's anything else I can do for now but recommend using that setting. It's likely that in the future we will always use a terminal by default. |
One problem/difference that I noted as I was trying to debug this last week was that when I Do Not have the "run in a terminal" explicitly set, I get the SSH Passphrase prompt at the top of the VSCode window, and the phrase gets added to the SSH Agent automatically, so things mostly work (other than the lingering window ... oh and that SSH_agent does not get passed to remote GIT for push/pull)... But, when I DO have "run in a terminal" set, then the SSH Passphrase gets asked in the terminal, and the key does NOT get added to the SSH Agent, so then I end up having to respond to the passphrase prompt on Every. Single. Operation.... which makes it pretty unusable. |
If the key is in your ssh agent and the agent is running and accessible from vscode's environment, then you shouldn't be asked for the passphrase on every operation when using the terminal. But vscode won't add the key to the agent automatically in that scenario. |
It was running. The only diff between the scenarios was when I toggled the run-in-terminal. |
Is it possible that you started the agent after vscode was started? I'm thinking that in theory the processes should have the same environment in the two cases but maybe when running in the terminal it has the old environment which is missing |
it should already have been running. I can try to play with it tomorrow to see if I can recreate it. |
Can confirm that @roblourens Would it be plausible to add a setting to get VS Code to hide this terminal session? or to move it to the |
Could you try this with vscode insiders, and the nightly ssh extension, and without that setting? Due to some changes I think it should work as you expect now. I forgot about this workaround when I commented in your other issue 😁 |
Hi @roblourens ,
Sorry, NO! Tested with the last version of VSCode Insiders and the last version of the plugin, and the same problem continues: when stablishing the SSH TUNNEL a COMMAND window appears. The only workaround until now is to use the I hope you can fix it. |
@roblourens Can confirm that removing the My only (very minor) criticism it that an integrated terminal session is still created on startup (albeit with my preferred shell this time) which differs to the standard behaviour of a blank window with no integrated terminal. I could definitely live with this if I had to though and is a great improvement over the pop up window. @lars18th make sure you have the nightly version of the extension rather than just the latest stable. |
How to install the nightly version of the extension? I use the nightly version of the VSCode, but I don't know about the Remote-SSH extension. |
@lars18th Just search for it like you would any other extension. (I uninstalled the stable version first, just in case of any conflict). |
Hi, I confirm that with the Remote-SSH (Nightly) the problem is GONE! ✌️ Thank you Rob for fixing it! 👍 PD: If you (@pd93 & @roblourens) want I can close this issue. |
Strange that we get different behaviour with the integrated terminal opening. Just to clarify what I'm talking about.. Stable VS Code with latest stable Remote SSH: No integrated terminal session started, but has an pop-up terminal window. Insiders VS Code with nightly Remote SSH: Integrated terminal automatically starts up, but the pop-up window is gone. |
If the terminal was open before, then it will be persisted as open the next time you open a window. Are you sure that's not just what you're seeing? Thanks for testing this though. I will close this. |
This is previously commented here: #149 (comment)
But I repost here as new issue.
Steps to Reproduce:
.ssh/config
with something likeconnect.exe -S proxy-server:1080 %h %p
connect.exe
helper tool.The problem is related to the solution used to launch the third SSH command. The expected behaviour is to run it in background.
Please, fix this bug.
Thank you!
The text was updated successfully, but these errors were encountered: