microsoft / vscode

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

Why does it switch to search view by default when reloading the window in explorer view? #198984

Open czfadmin opened 9 months ago

czfadmin commented 9 months ago

Type: Bug

Why is it that when the explorer view is initially used and the window is reloaded, the view becomes the search view, but when other views reload the window, it does not become the search view?

Is this phenomenon set by you? Does it mean it works normally?

switch-search-view-bug

VS Code version: Code 1.84.2 (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e, 2023-11-09T10:51:52.184Z) OS version: Windows_NT x64 10.0.22631 Modes: Connection to 'wsl+Ubuntu' could not be established Remote OS version: Linux x64 5.15.133.1-microsoft-standard-WSL2

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 7 5800H with Radeon Graphics (16 x 3194)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|14.87GB (7.69GB free)| |Process Argv|--folder-uri=vscode-remote://wsl+Ubuntu/home/abchen/projects/myrepo/rspack --remote=wsl+Ubuntu| |Screen Reader|no| |VM|0%| Connection to 'wsl+Ubuntu' could not be established |Item|Value| |---|---| |Remote|WSL: Ubuntu| |OS|Linux x64 5.15.133.1-microsoft-standard-WSL2| |CPUs|AMD Ryzen 7 5800H with Radeon Graphics (16 x 3193)| |Memory (System)|7.20GB (4.24GB free)| |VM|0%|
Extensions (33) Extension|Author (truncated)|Version ---|---|--- better-comments|aar|3.0.2 Bookmarks|ale|13.4.2 tsl-problem-matcher|amo|0.6.2 ytheme|czf|1.3.20 es7-react-js-snippets|dsz|4.4.3 auto-rename-tag|for|0.1.10 codespaces|Git|1.16.2 remotehub|Git|0.62.0 jupyter-keymap|ms-|1.1.2 remote-containers|ms-|0.321.0 remote-ssh|ms-|0.107.0 remote-ssh-edit|ms-|0.86.0 remote-wsl|ms-|0.81.8 vscode-remote-extensionpack|ms-|0.24.0 azure-repos|ms-|0.38.0 remote-explorer|ms-|0.4.1 remote-repositories|ms-|0.40.0 material-icon-theme|PKi|4.32.0 pdf|tom|1.2.2 vscode-icons|vsc|12.6.0 bookmark-manager|czf|0.0.14 gitlens|eam|14.5.1 prettier-vscode|esb|10.1.0 git-graph|mhu|1.30.0 python|ms-|2023.20.0 vscode-pylance|ms-|2023.11.10 jupyter|ms-|2023.10.1100000000 jupyter-keymap|ms-|1.1.2 jupyter-renderers|ms-|1.0.17 vscode-jupyter-cell-tags|ms-|0.1.8 vscode-jupyter-slideshow|ms-|0.1.5 vscode-mdx|uni|1.5.0 volar|Vue|1.8.22 (1 theme extensions excluded)
gjsjohnmurray commented 9 months ago

/confirmPlease

VSCodeTriageBot commented 9 months ago

Please diagnose the root cause of the issue by running the command F1 > Help: Troubleshoot Issue and following the instructions. Once you have done that, please update the issue with the results.

Happy Coding!

czfadmin commented 9 months ago

Please diagnose the root cause of the issue by running the command F1 > Help: Troubleshoot Issue and following the instructions. Once you have done that, please update the issue with the results.

Happy Coding!

Why can’t I find the corresponding command? image

sandy081 commented 9 months ago

Sorry that this command is not enabled in Remote Window.

Can you please reproduce this with our latest insider - https://code.visualstudio.com/insiders

czfadmin commented 9 months ago

@sandy081. Hello, I verified again. When I open vscode in the local environment, the search view does not open by default. However, in the remote environment, this happens. When I open vscode, the search view opens by default. At the same time, locally The environment is verified through Troubleshoot Issue. At the same time, I also verified in the preview version, and this phenomenon does not occur.

sandy081 commented 9 months ago

Can you please check in the remote environment, if you have SCM / Extensions view open and reload window opens SCM / Extensions view correctly or it switches to Search view?

czfadmin commented 9 months ago

image I recreated a new configuration and the automatic switch to the search view did not occur. This phenomenon did not occur in other views such as scm. I did not find this problem in the preview version.

sandy081 commented 9 months ago

I recreated a new configuration and the automatic switch to the search view did not occur.

What do you mean by new configuration?

czfadmin commented 9 months ago

I recreated a new configuration and the automatic switch to the search view did not occur.

What do you mean by new configuration? Yes, I recreated a configuration file. The picture shows a new configuration file I created that disables all plug-ins. At the same time, there is no configuration in it. image

roshal commented 2 months ago

same bug occurs to me when opening dozens of windows

search view open in some random windows

open view does not persist in primary side bar across restarts

open view persists in secondary side bar across restarts

the view following to the explorer view is open when the search view is hidden

this appears to be caused by a race condition related to explorer initialization

disabling extensions only reduces the number of affected windows

roshal commented 2 months ago

directory preparation

mkdir -- a b c d e f g h i j k l m n o p q r s t u v w x y z

directory cleaning

rmdir -- a b c d e f g h i j k l m n o p q r s t u v w x y z

bug reproduction

code --new-window --disable-extensions
code -- a
code -- b
code -- c
code -- d
code -- e
code -- f
code -- g
code -- h
code -- i
code -- j
code -- k
code -- l
code -- m
code -- n
code -- o
code -- p
code -- q
code -- r
code -- s
code -- t
code -- u
code -- v
code -- w
code -- x
code -- y
code -- z