microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.61k stars 275 forks source link

vscode-server: back button captured by browser #7276

Open leifwalsh opened 1 year ago

leifwalsh commented 1 year ago

Using VS Code Server, connected from Chrome, and running in Progressive Web App mode in its own window, the "back" button has unwanted behavior.

Normally, on other VS Code platforms, the back button takes you to the previous file you were looking at (or does other useful IDE things in other contexts, presumably).

Using VS Code Server, if you haven't changed folders or workspaces yet, it still has this behavior. However, after opening a folder/workspace, or after changing to a different one, VS Code does appear to register the back event and have the normal behavior briefly, but the event also appears to effect the browser, and this causes it to navigate back to the previous folder/workspace context. This rips you out of the project context you were working on and is disruptive to flow if you're used to using the normal back behavior.

Can you do something to prevent this event getting captured by the browser?

Steps to Reproduce:

  1. Open a connection, and go through the "install" flow to open PWA mode
  2. Open a different project folder
  3. Navigate between some files
  4. Click the "back" button on a mouse (notably, Alt-Left does not have this problem, but changing muscle memory is hard)

Does this issue occur when you try this locally?: No Does this issue occur when you try this locally and all extensions are disabled?: No

leifwalsh commented 1 year ago

For those following this issue, I have found a workaround: if you're going to open a new workspace or folder, control-click it to open it in a new window, or after opening it, copy the url, open it in a new browser tab, and pop that out into PWA mode.

As long as the browser doesn't have anywhere to go back to, it doesn't have this surprising behavior. The IDE just does what it should and the browser back operation is a no-op.

AkazaRenn commented 1 year ago

Same for F12, currently it opens the DevTools instead of going to the definition

leifwalsh commented 9 months ago

I think this is actually resolved, or maybe the way switching workspaces has changed such that it's not a problem anymore? @chrmarti maybe check internally and close?