Repository: vscode
Issue: preview flag not respected for custom editor
Labels: bug,api,custom-editors


Type: <b>Bug</b>

in a vscode extension open a file in the hex editor:

vscode.commands.executeCommand('vscode.openWith', uri, 'hexEditor.hexedit', {preview: true});

Note that the preview option is ignored (actually, overridden), as indicated by the tab title not being italicised.

This might just be a more general case of issue #154145.

VS Code version: Code 1.95.3 (f1a4fb101478ce6ec82fe9627c43efbf9e98c813, 2024-11-13T14:50:04.152Z)
OS version: Windows_NT x64 10.0.22621
Modes:

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|AMD Ryzen Threadripper 1950X 16-Core Processor  (32 x 3394)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: enabled_on<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_graphite: disabled_off<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled<br>webnn: disabled_off|
|Load (avg)|undefined|
|Memory (System)|63.89GB (32.70GB free)|
|Process Argv|--folder-uri file:///d%3A/dev/vscode_ext/modules --crash-reporter-id 22b24386-c25b-404a-a2ae-9ae86dee0ec7|
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (65)</summary>

Extension|Author (truncated)|Version
---|---|---
logcat|abh|0.0.7
android-dev-ext|ade|1.4.0
amazon-q-vscode|ama|1.39.0
aws-toolkit-vscode|ama|3.37.0
doxdocgen|csc|1.4.0
vscode-eslint|dba|3.0.10
vscode-wasm|dts|1.4.1
graphviz-preview|EFa|1.7.4
vscode-commands|fab|2.0.2
lex-flex-yacc-bison|fau|0.0.3
code-runner|for|0.12.2
vscode-github-actions|git|0.27.0
vscode-pull-request-github|Git|0.100.3
pdl-language|Goo|0.2.2
adb-filesystem-fork|hea|0.0.4
ispc|int|1.1.1
gitweb|iso|0.1.1
modules|iso|0.1.0
regedit-explorer|iso|0.5.0
thumbnails|iso|0.1.4
vstools|iso|0.0.1
llvm-tablegen|jak|0.0.2
svn-scm|joh|2.17.0
debug-tracker-vscode|mcu|0.0.15
peripheral-viewer|mcu|1.4.6
rtos-views|mcu|0.0.7
git-graph|mhu|1.30.0
csharp|ms-|2.55.29
vscode-dotnet-runtime|ms-|2.2.3
vscode-edge-devtools|ms-|2.1.6
debugpy|ms-|2024.12.0
python|ms-|2024.20.0
jupyter|ms-|2024.10.0
jupyter-renderers|ms-|1.0.21
remote-containers|ms-|0.388.0
remote-ssh|ms-|0.115.1
remote-ssh-edit|ms-|0.87.0
remote-wsl|ms-|0.88.5
cmake-tools|ms-|1.20.29
cpptools|ms-|1.23.1
cpptools-extension-pack|ms-|1.3.0
hexeditor|ms-|1.11.1
js-debug-nightly|ms-|2024.11.2917
live-server|ms-|0.4.15
makefile-tools|ms-|0.11.13
powershell|ms-|2024.4.0
remote-explorer|ms-|0.4.3
vscode-github-issue-notebooks|ms-|0.0.130
vscode-serial-monitor|ms-|0.13.1
pico-w-go|pau|4.1.0
platformio-ide|pla|3.3.3
vscode-xml|red|0.27.2
clangformat|sea|2.0.2
shader|sle|1.1.5
vscode-native-svg-preview|snd|1.72.0
memento-inputs|spa|1.0.0
rst-vscode|tht|3.0.1
pdf|tom|1.2.2
vscode-lldb|vad|1.11.1
vscodeintellicode|Vis|1.3.2
vscode-gradle|vsc|3.16.4
vscode-java-debug|vsc|0.58.1
vscode-java-pack|vsc|0.29.0
debug|web|0.27.0
cursor-align|yo1|2.0.2


</details><details>
<summary>A/B Experiments</summary>

```
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
a9j8j154:30646983
962ge761:30959799
pythonnoceb:30805159
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
dvdeprecation:31068756
dwnewjupyter:31046869
newcmakeconfigv2:31071590
nativerepl2:31139839
pythonrstrctxt:31112756
nativeloc1:31192215
cf971741:31144450
iacca1:31171482
notype1cf:31157160
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530

```

</details>

<!-- generated by issue reporter -->