-
Notifications
You must be signed in to change notification settings - Fork 36k
Description
Environment:
- VS Code Version: 1.105.1
- OS: Windows 11
- Debugger Type: JavaScript Debug Terminal (Node.js)
Description
When debugging a Node.js process using the JavaScript Debug Terminal, copying object values from the console output or hover view doesn’t work as expected.
If an array of objects is logged to the console, and I try to copy a specific object value (using the “Copy Value” option from the hover dropdown), it only copies the key index or a plain text placeholder, not the full object data.
This also happens when trying to copy the complete variable value — the copied output is incorrect (for example, just brackets or [object Object] text).
Steps to Reproduce
-
Open the JavaScript Debug Terminal in VS Code.
-
Run a simple Node.js script, for example:
const arr = [ { name: "Alice", age: 25 }, { name: "Bob", age: 30 } ]; console.log(arr);
-
Wait for the console output to display.
-
Expand the array in the debug terminal.
-
Hover over any object and select “Copy Value” from the dropdown.
-
Paste the copied result into any text editor or console.
Expected Behavior
Copying should return the complete object content, for example:
{ "name": "Alice", "age": 25 }Actual Behavior
- Only the key index or text placeholder is copied (e.g.,
[object Object]). - When copying the entire variable, only plain text or brackets are copied instead of structured data.
Additional Context
🎥 Video Demo: https://jam.dev/c/d596a5b5-940a-4b63-91c9-05074920f983
Suggestion
To improve the developer experience:
-
Copy operations from the debug hover or console should return the full serialized object value.
-
Optionally, add:
- “Copy as JSON”
- “Copy as JS Object” options for clarity.