Skip to content

[Tasks] "focus": true with "reveal": "silent" won't focus on error #185359

@Phroneris

Description

@Phroneris

Type: Bug

Steps to reproduce

  1. Open "tasks.json" on VS Code
  2. Create this task and save:
    {
      "version": "2.0.0",
      "tasks": [
        {
          "label": "Throw my error",
          "type": "shell",
          "command": "exit 1",
          "presentation": {
            "focus": true, // Issue!
            "reveal": "silent" // Issue!
          },
          "problemMatcher": []
        }
      ]
    }
  3. Run this task ([Terminal] > [Run Task] > [Throw my error])
  4. Press Enter

Expected behavior

  • The integrated terminal shows an error because of "command": "exit 1".
  • Pressing Enter closes it because of "focus": true.

Actual behavior

  • The integrated terminal shows an error because of "command": "exit 1". ✔️
  • Pressing Enter inserts a line break into the current opened "tasks.json", or at least leaves the terminal open. ❌

Notes

  • Terminal display:
     *  The terminal process "C:\Program Files\Git\bin\bash.exe '--login', '-i', '-c', 'exit 1'" terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it. 
    
  • I use Git Bash of Git for Windows as my default terminal ("terminal.integrated.defaultProfile.windows": "Git Bash"), but I've tried cmd.exe and PowerShell and got the same result.
  • Of cause, if the command is exit 0, the terminal doesn't appear because of "reveal": "silent".
  • "Reload With Extensions Disabled" has no effect.

TBH, I know this is a duplicate of #88208.
It has already been closed as a "feature-request" that didn't receive enough upvotes.
It may be impolite to reopen a closed issue in this way, and I'm very hesitant to do so, but for the life of me, I can't believe that fixing this counter-intuitive behavior is within the scope of feature requests.
The current behavior is surprising, not convincing.

I'm sorry if there are already other ways to achieve the expected behavior.

Specs

VS Code version: Code 1.79.2 (695af09, 2023-06-14T08:57:04.379Z)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz (4 x 3193)
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: unavailable_off
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 31.89GB (22.79GB free)
Process Argv --crash-reporter-id 0d0f4325-8fb8-4df0-af46-0539e77eed8e
Screen Reader no
VM 0%
Extensions (23)
Extension Author (truncated) Version
Bookmarks ale 13.3.1
project-manager ale 12.7.0
laravel-extra-intellisense ami 0.6.3
markdown-preview-github-styles bie 2.0.2
insert-unicode bru 0.14.0
laravel-blade cjh 1.1.2
vscode-eslint dba 2.4.0
vscode-deno den 3.19.1
EditorConfig Edi 0.16.4
gc-excelviewer Gra 4.2.57
code-eol jef 1.0.12
haml kar 1.4.1
live-stylus-compiler liv 0.0.4
zenkaku mos 0.0.3
vscode-language-pack-ja MS- 1.79.2023061409
remote-containers ms- 0.295.0
live-server ms- 0.4.8
laravel-blade one 1.34.0
laravel5-snippets one 1.17.0
LiveServer rit 5.7.9
language-stylus sys 1.16.0
vscode-input-sequence tom 0.2.0
markdown-all-in-one yzh 3.5.1
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
vsclangdf:30486550
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
282f8724:30602487
pyind779:30671433
f6dab269:30613381
pythonsymbol12:30671437
a9j8j154:30646983
showlangstatbar:30737416
vsctsb:30748421
pythonms35:30701012
pythonfmttext:30731395
pythoncmvfstrcf:30756944
fixshowwlkth:30730052
pythongtdpath:30769146
i26e3531:30769768
dh2dc718:30763024

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitiesinsiders-releasedPatch has been released in VS Code InsiderstasksTask system issuesverifiedVerification succeeded

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions