Skip to content

debugger::Start ignores "save" property of task #53284

@zjin123

Description

@zjin123

Reproduction steps

  1. Change main.cpp but do not save
  2. Ctrl+Shift+P
  3. Select ''debugger: start"
  4. Select "Debug"
$ tree -a
.
├── main.cpp
└── .zed
    ├── debug.json
    └── tasks.json
$ cat main.cpp
int main() { return 0; }
$ cat .zed/tasks.json
[
  {
    "label": "Build",
    "command": "g++ $ZED_WORKTREE_ROOT/main.cpp -o a.out",
    "use_new_terminal": true,
    "save": "all",
  },
]
$ cat .zed/debug.json 
[
  {
    "label": "Debug",
    "adapter": "GDB",
    "program": "$ZED_WORKTREE_ROOT/a.out",
    "request": "launch",
    "build": "Build",
  },
]

Current vs. Expected behavior

Current behavior:
Zed does not save the modified main.cpp (ignoring that the "save" property of the Build task) but runs the Build task and starts debugging.

(However, if Ctrl+Shift+P and select "task: spawn" the Build task, main.cpp is saved as expected before build.)

Expected behavior:
Zed saves the modified main.cpp, runs the Build task and starts debugging.

Zed version and system specs

Zed: v0.230.1+stable.210.bf3a14350a4fa4b67747afe2e50128fb8fea4fa3 (Zed)
OS: Linux Wayland debian 13
Memory: 15.6 GiB
Architecture: x86_64
GPU: llvmpipe (LLVM 19.1.7, 256 bits) || llvmpipe || Mesa 25.0.7-2 (LLVM 19.1.7)

Attach Zed log file

Zed.log

Relevant Zed settings

settings.json

Relevant Keymap

keymap.json

(for AI issues) Model provider details

No response

If you are using WSL on Windows, what flavor of Linux are you using?

None

Metadata

Metadata

Assignees

Labels

area:debuggerFeedback for Zed's debuggerarea:tasksFeedback for Zed's task supportfrequency:commonBugs that happen for at least a third of the users across all platforms and kinds of usagepriority:P3Papercuts, minor issues with a clear workaround, cosmetic bugsstate:reproducibleVerified steps to reproduce included and someone on the team managed to reproduce

Type

No fields configured for Bug.

Projects

Status

Bug Bashers

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions