microsoft / vscode

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

Worskpace Trust enabled breaks the workflow, opening a browser, every css / js in notepad, also empty tabs for each file in folder #182307

Closed sorinnn closed 1 year ago

sorinnn commented 1 year ago

Type: Bug

Preamble :

The problem ... In RESTRICTED MODE, opening a file is woking as it should. You click on a filename in explorer sidebar, then the file is opened in a tab. And that's all. But I can't use many extensions - too many restrictions.

In TRUSTED MODE I can use all extensions but opening any file is inducing a lot of unwanted actions.

Opening a file (index.html) for exemple, will induce a lot of actions as follows :

And this happen every time. When VS Code behavior is correct, I can't use some extensions - they are restricted. When VS Code is doing his thing under trusted workspace, I can't work (lot of interruption), but ironically I can use all extensions.

Can we choose the way of action if is possible ?. I am trying to find a solution to my problem over the Internet for some hours. Looks that it is possible, on youtube I can see other developers clicking on a file and only that file alone opens in a VS Code tab, not the whole project.

There is a short video I've made on the issue posted on youtube here

VS Code version: Code 1.78.2 (b3e4e68a0bc097f0ae7907b217c1119af9e03435, 2023-05-10T14:39:26.248Z) OS version: Windows_NT x64 10.0.19045 Modes: Sandboxed: No

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz (8 x 3999)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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)|15.95GB (7.23GB free)| |Process Argv|--crash-reporter-id 4d44cb02-6163-414c-8e46-56aeda9b2580| |Screen Reader|no| |VM|0%|
Extensions (73) Extension|Author (truncated)|Version ---|---|--- vscode-css-formatter|aes|1.0.2 aessoft-class-autocomplete|AES|0.1.0 html-class-suggestions|And|1.2.1 lit-html|bie|1.11.1 vscode-tailwindcss|bra|0.9.11 very-smart-select|clo|0.3.0 indent4to2|Com|0.1.2 quick-html-previewer|dai|1.0.1 vscode-eslint|dba|2.4.0 composer-php-vscode|DEV|1.34.13083 phptools-vscode|DEV|1.34.13083 profiler-php-vscode|DEV|1.34.13083 vscode-remove-final-newlines|DoC|1.2.0 vscode-html-css|ecm|1.13.1 EditorConfig|Edi|0.16.4 el-vsc-product-icon-theme|ElA|0.1.8 vsc-material-theme|Equ|33.2.0 vsc-material-theme-icons|equ|2.7.5 vscode-diff|fab|1.4.2 eventlistener-intellisense|fat|0.0.2 vscode-firefox-debug|fir|2.9.8 auto-close-tag|for|0.5.14 auto-rename-tag|for|0.1.10 vscode-mysql|for|0.4.1 customize-indentation-rules|gar|0.0.2 html-preview-vscode|geo|0.2.5 hclappscancodesweep|HCL|1.2.2 rest-client|hum|0.25.1 mysql-syntax|jak|1.3.1 vscode-wordpress-hooks|joh|1.1.0 vscode-phpfmt|kok|1.1.8 php-symbols|lin|2.1.0 vscode-generic-binary-preview|loc|0.0.2 lzwme-eye-care|lzw|1.0.2 fluent-icons|mig|0.0.18 vscode-apache|mrm|1.2.0 vscode-edge-devtools|ms-|2.1.1 sqltools|mtx|0.27.1 create-matching-css-file|Nat|0.6.0 live-server-preview|neg|0.1.4 mysql-autocomplete|nes|0.5.0 php-html-in-string|Nic|0.1.3 html-fmt-vscode|Nik|0.9.3 prettier-vscode-with-tabs|pas|1.1.0 convert-css-in-js|pau|1.1.3 phpstorm-snippets|phi|1.1.2 material-product-icons|PKi|1.5.0 vscode-css-peek|pra|4.2.0 open-php-html-js-in-browser|Pri|2.2.0 binary-viewer|Qia|1.1.1 format-html-in-php|rif|1.7.0 LiveServer|rit|5.7.9 ActiveFileInStatusBar|Ros|1.0.3 bootstrap-product-icons|rub|1.0.2 smart-css-autocomplete|sai|1.5.3 cocart-vscode|seb|1.2.0 html5-boilerplate|sid|1.1.1 html-to-css-autocompletion|sol|1.1.2 sonarlint-vscode|Son|3.17.0 css-auto-prefix|spo|0.1.7 sass-indented|syl|1.8.26 remove-blank-lines|tha|1.1.1 es6-string-html|Tob|2.12.1 highlight-logical-line|use|0.1.0 indent-one-space|use|1.0.0 intellicode-api-usage-examples|Vis|0.2.7 vscodeintellicode|Vis|1.2.30 yithemes|wan|0.19.0 vscode-backup|Wes|0.0.6 vsc-jsonsnippets|wmo|0.9.4 local-history|xyz|1.8.1 html-css-class-completion|Zig|1.20.0 classnametocss|zit|0.0.7 (35 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263cf:30335440 pythondataviewer:30285071 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593cf:30376535 pythonvs932:30410667 cppdebug:30492333 vsclangdc:30486549 c4g48928:30535728 dsvsc012cf:30540253 pynewext54:30695312 azure-dev_surveyone:30548225 2e4cg342:30602488 pyind779:30671433 f6dab269:30613381 pythonsymbol12:30671437 a9j8j154:30646983 showlangstatbar:30737416 vsccsb:30705552 azdwalk:30721579 pythonms35:30701012 pythonfmttext:30731395 pythoncmvfstr:30731969 fixshowwlkth:30730052 ```
sorinnn commented 1 year ago

Update I've installed VS Code Insiders and I observer that opening files under Trusted Workspace is behaving normal, as expected - a file is opened in a tab, no extra actions.

May be an extension ? ...

sorinnn commented 1 year ago

Update

I've tracked down the bug - there is an extension here : https://marketplace.visualstudio.com/items?itemName=lochbrunner.vscode-generic-binary-preview

Uninstalling this extension GENERIC BINARY PREVIEW fixed VS Code strange opening files behavior (over trusted workspaces / domains). This extension is trying to execute everything without consent. The owner should be noticed. I will send him a note also.

On his github the author received already complaints about the issue : https://github.com/lochbrunner/vscode-generic-binary-preview/issues/3 ... but seems like this extension is not maintained anymore.

gjsjohnmurray commented 1 year ago

/causedByExtension

vscodenpa commented 1 year ago

This issue is caused by an extension, please file it with the repository (or contact) the extension has linked in its overview in VS Code or the marketplace for VS Code. See also our issue reporting guidelines. If you don't know which extension is causing the problem, you can run Help: Start extension bisect from the command palette (F1) to help identify the problem extension.

Happy Coding!