microsoft / vscode

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

keybinding for vscode.open command error #181209

Closed tt-mohsen closed 1 year ago

tt-mohsen commented 1 year ago

Type: Bug

I created a keybinding but it does not opens the file,

[
  {
    "key": "ctrl+numpad_decimal",
    "command": "vscode.open",
    "args": {
      "uri": "file:///D:/a.txt"
    }
  }
]

here is the keybindings.json content.

but it does not opens the file instead it show the error page,

"The editor could not be opened due to an unexpected error: unknown error courred."

File path is correct on pressing on its link opens the file

here is error image

window log image

VS Code version: Code 1.77.3 (704ed70d4fd1c6bd6342c436f1ede30d1cff4710, 2023-04-12T09:16:02.548Z) OS version: Windows_NT x64 10.0.19045 Modes: Sandboxed: Yes

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-10810U CPU @ 1.10GHz (12 x 1608)| |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
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|undefined| |Memory (System)|15.61GB (5.66GB free)| |Process Argv|--crash-reporter-id 19549124-78bd-4dc4-a474-ed0f1d3f493f| |Screen Reader|no| |VM|0%|
Extensions (36) Extension|Author (truncated)|Version ---|---|--- cucumberautocomplete|ale|2.15.2 ng-template|Ang|15.2.1 ngx-translate-lookup|apk|1.3.1 markdown-mermaid|bie|1.18.1 vscode-intelephense-client|bme|1.9.5 quick-material-icons|box|0.2.0 vscode-tailwindcss|bra|0.9.11 angular-schematics|cyr|5.3.1 vscode-eslint|dba|2.4.0 gitlens|eam|13.5.0 vscode-html-css|ecm|1.13.1 EditorConfig|Edi|0.16.4 prettier-vscode|esb|9.12.0 vscode-jest-runner|fir|0.4.60 copilot|Git|1.84.51 vscode-pull-request-github|Git|0.62.0 vscode-graphql|Gra|0.8.7 vscode-graphql-syntax|Gra|1.1.0 auto-save|mcr|1.0.3 git-graph|mhu|1.30.0 vscode-scss|mrm|0.10.0 vscode-docker|ms-|1.25.0 remote-containers|ms-|0.288.1 remote-wsl|ms-|0.77.0 sqltools|mtx|0.27.1 sqltools-driver-mysql|mtx|0.5.1 angular-console|nrw|18.1.0 laravel-blade|one|1.34.0 material-icon-theme|PKi|4.26.0 prisma|Pri|4.13.0 LiveServer|rit|5.7.9 vscode-blade-formatter|shu|0.20.14 code-spell-checker|str|2.20.4 vscode-stylelint|sty|1.2.4 sass-indented|syl|1.8.26 vscode-icons|vsc|12.4.0 (1 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 vsdfh931cf:30280410 vshan820:30294714 vstes263cf:30335440 vscoreces:30445986 pythondataviewer:30285071 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593:30376534 pythonvs932:30410667 cppdebug:30492333 vsclangdf:30486550 c4g48928:30535728 dsvsc012cf:30540253 pynewext54:30695312 azure-dev_surveyone:30548225 nodejswelcome1cf:30587006 3biah626:30602489 pyind779:30671433 f6dab269:30613381 pythonsymbol12:30671437 2i9eh265:30646982 6233i204:30672705 vsctsb:30705553 azdwalk:30721579 pythonms35:30701012 03d35959:30706073 pythonfmttextcf:30716743 pythonclientmvcf:30725893 ```
bpasero commented 1 year ago

Try like this:

{
    "key": "ctrl+o",
    "command": "vscode.open",
    "args": "file:///D:/a.txt"
}