Search code examples
visual-studio-coderemote-server

Explorer and Source Control don't refresh automatically when working on remote directory


I'm using VS Code 1.85.1 in my two laptops (Ubuntu 20.04 and 22.04). I have an SFTP connection to a remote host (Red Hat Linux) in the file explorer (Other locations -> connect to server -> sftp://remote-host-nickname/). I open VS Code and then Open folder -> and I open a directory located in my remote host (clicking on that Other locations section I mentioned). The problem here is that, unlike in local directories, the Explorer and the Git built-in extensions (Source Control and Source Control Repositories) are not refreshing automatically. I have to manually click Refresh in Source Control to actually see Git changes there and in the Explorer part (manually refreshing the Explorer has no effect)

What I've tried:

  • Open Default Settings (JSON) -> set "git.autorefresh": true (it was already set to true; setting it to false, closing and setting it to true again doesn't work either)
  • Open User Settings (JSON) -> set "git.autorefresh": true (here I actually had to add it, same result)
  • Open Workspace Settings (JSON) -> set "git.autorefresh": true (this creates .vscode/settings.json in my remote directory. Some loading bar appears on the Source Control section, but again no refreshing)
  • Disabling and enabling again the built-in Git plugins (no effect)
  • All the above with all my plugins disabled (same result)
  • SFTP plugin: Long story short, I would prefer to work directly on the remote code. This would do the trick since auto-refreshing in local works nicely, but it generates me way worse problems that remembering to refresh manually.

Anyway, I would like to know if there is a way to achieve auto-refreshing in my situation. Thanks in advance!


Solution

  • Answering my own question since I found a solution. Just in case someone has the same problem: The extensions Remote - SSH (ms-vscode-remote.remote-ssh) and Remote - SSH: Editing Configuration Files (ms-vscode-remote.remote-ssh-edit) allowed me to work with Source and Explorer autorefreshing. Not sure about the second extension being mandatory for this to work, but in the description it says that it complements the first plugin.