[WIP] Fixing Debugger Breakage Due to %reset Command in VS Code Jupyter
#16767
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TITLE: Fixing Debugger Breakage Due to
%resetCommand in VS Code JupyterUSER INTENT: The user intends to implement a fix for the issue where the
%resetcommand in VS Code Jupyter breaks the debugger functionality.TASK DESCRIPTION: The goal is to modify the behavior of the
%resetcommand to prevent it from removing critical debugger-related variables and modules, ensuring that breakpoints continue to function after the command is executed.EXISTING: The user has identified the issue and provided a workaround using the command
#!%reset_selective -f ^(?!(debugpy|get_ipython|os|trace_this_thread)$).*$, which allows the debugger to remain functional by selectively resetting variables.PENDING: The user has requested a code change to implement a solution that prevents the
%resetcommand from affecting debugger-related variables. The specific implementation details need to be determined.CODE STATE: The conversation does not provide specific file paths or code snippets that have been modified yet, as the user has just requested to fix the issue.
RELEVANT CODE/DOCUMENTATION SNIPPETS:
#!%reset_selective -f ^(?!(debugpy|get_ipython|os|trace_this_thread)$).*$%resetclears the user namespace, affecting debugger functionality.OTHER NOTES: The assistant has suggested potential directions for the fix, including preventing the removal of debugger-related variables, patching the IPython kernel, or re-injecting debugger hooks when
%resetis executed. The user has opted to proceed with a code change without requesting further technical details.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.