This is the sixth day of my participation in the First Challenge 2022. For details: First Challenge 2022.

The introduction

I just changed my MAC recently, so I spent some time learning how to use MacBook, and also downloaded VScode. However, I encountered a bug while connecting to the remote server.

Problem description

When I connect to A remote server using VScode, let’s say I connect to server A first. At this moment, everything is normal. The terminal I open is also the terminal of server A.

As can be seen from the lower left corner, the server I am connected to at this time is A (port number is ****1).

Without closing this remote connection, I open another remote connection, at this point I connect to server B (port number ****2);

But then something strange happened. Although the lower left corner shows another server I am connected to (the port number is ****2), the terminal he opens is on server A, and the file system is also on server A.

Problem solving

When I ran into that problem, I tried it on my old Windows laptop and found no problem. After Github asked, someone suggested taking a look at the log information.

The following figure shows how to open the log information (select the output of remote-SSH extension in the upper right corner) :

Then I compared the remote – SSH the output of the plugin, found in the plugin Settings on Windows VScode in remote. SSH. UseLocalServer parameter is set to false.

"remote.SSH.useLocalServer": true
Copy the code

VScode on the Macbook defaults to false.

"remote.SSH.useLocalServer": false
Copy the code

When I realized that this was different, I changed it back and the problem was fixed. The setting mode is shown as follows:

Remove the pair hook:

P.S. about the use of MacBook, you can refer to the b station this video: Apple Mac computer macOS system novice from the master version of the tutorial

reference

  1. I can not open another server when it had open a server # 6219 github.com/microsoft/v…