I just followed the steps in this link to set up my vscode env for ssh:
VS code remote x11 cant get DISPLAY while connecting to remote server
All the things go well before the step 4.2, when I tried to test if the GUI can work well, an error msg feedbacked me like "Can't open display: xx.xxx.xxx.xxx:10.0"
Then I checked the output tab(Remote X11) in vscode, the 3rd line shows that "DISPLAY = xx.xxx.xxx.xxx:11.0"
I did some tests, like made a new connection without closing the old one, then on the new terminal, $DISPLAY returned xx.xxx.xxx.xxx:12.0 and the same output tab msg became "DISPLAY = xx.xxx.xxx.xxx:13.0"
It looks like the number would update orderly, but GUI function is supposed to work if the two DISPLAY variables are exactly the same. (I can make it by using "xeyes -display xx.xxx.xxx.xxx:13.0")
I am not sure if any setting can fix this weird situation, now it acts like the remote x11 connects after the ssh connection is done or something like that.
One more thing, I am not allowed to modify the server variable so I cannot fix this by the command "export DISPLAY=...", please tell me anything possible I might did it wrong to cause this.
Sincerely wish if anyone can help, thank you.