microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.16k stars 28.54k forks source link

black-only tooltip windows (when running vscode from an ssh session) #111372

Closed rhaschke closed 3 years ago

rhaschke commented 3 years ago

All tooltip windows just show a black rectangle, like this when vscode is run from within an ssh session to localhost: image

Version: 1.51.1 Commit: e5a624b788d92b8d34d1392e4c4d9789406efe8f Date: 2020-11-10T23:31:29.624Z Electron: 9.3.3 Chrome: 83.0.4103.122 Node.js: 12.14.1 V8: 8.3.110.13-electron.0 OS: Xubuntu 18.04, Linux x64 5.4.0-54-generic

I'm using color theme Dark+, but the issue occurs in all color themes.

Does this issue occur when all extensions are disabled?: Yes (see screenshot above) I remember having seen this issue in other applications as well: somehow the desktop theme cannot be retrieved in an ssh session.

rhaschke commented 3 years ago

I just noticed that this issue only occurs when running from an ssh session. I augmented the main comment appropriately.

rhaschke commented 3 years ago

Xubuntu 20.04 is even worse: there, vscode just shows a uniformly greyish window when starting from an ssh session - no content at all.

deepak1556 commented 3 years ago

Does the issue occur when you start with --no-xshm ?

rhaschke commented 3 years ago

Thanks, with that option the issue is gone on Xubuntu 20.04, but gives a warning:

$ code --no-xshm
Warning: 'xshm' is not in the list of known options, but still passed to Electron/Chromium.

Need to test on Xubuntu 18.04 as well. Would it be possible to auto-detect when this option is needed?

rhaschke commented 3 years ago

Xubuntu 18.04 works as well. Thanks a lot. Would be great to have that option auto-enabled though. I'm sure I will have forgotten about this the next time I need it.

deepak1556 commented 3 years ago

You can ignore the command warning, the option was needed because of how chromium changed its detection for MIT-SHM, the issue is tracked in https://github.com/microsoft/vscode/issues/101069#issuecomment-662150152. I haven't looked much into this issue on how to auto-enable this switch, pull request is welcome. Merging to https://github.com/microsoft/vscode/issues/101069.

rhaschke commented 3 years ago

I have configured a workaround for me that configures an alias when in a ssh environment: [[ $SSH_AUTH_SOCK == /tmp/ssh-* ]] && alias code='code --no-xshm'

This assumes that ssh-agent forwarding is enabled.