Debugger times out if shell startup is "slow"
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python, vscode
- Domain
- developer-experience, devtools
Research direction
Reproduce the timeout by adding a long sleep to ~/.zshrc or ~/.bashrc, then starting a debugpy session from VS Code. Trace the terminal startup and debug command handoff; done means the debugger waits for the shell to become ready and starts successfully instead of discarding the command.
Written by the indexing model from the issue text.
Description
Environment data
- debugpy version: v2024.6.0
- OS and version: macos 14.4.1
- Python version (& distribution if applicable, e.g. Anaconda): 3.10 CPython
- Using VS Code or Visual Studio: VS Code
Actual behavior
Debugger never starts and shows "timeout" error window.
In the terminal output you can see that the debugger command has been "pasted"/send to the terminal but the terminal was not ready yet. Hence, the command is discarded.
Its very similar to the issue described here: https://github.com/microsoft/vscode-js-debug/issues/1642
Expected behavior
Debugger waits for terminal to finish and then sends the command to the terminal.
Steps to reproduce:
- add a slow command to shell startup, e.g. "sleep 120" to ~/.zshrc or ~/.bashrc
- start any debug session with debugpy
- debugger will timeout
Background:
I have a zshrc setup that includes some startup scripts which usually take ~0.5-3 seconds. I've never found a satisfying workaround for this and many of the suggested solutions in the Issues in this repo never worked for me.
Current Workaround:
Currently, I am using a setting which works well enough for me
Here is the link to the vscode docs: https://code.visualstudio.com/docs/terminal/profiles#_configuring-the-taskdebug-profile
and here is the setting for me:
{
"terminal.integrated.automationProfile.osx": {
"path": "bash",
},
}
However, I wish this extension/debugger would support the same solution as https://github.com/microsoft/vscode-js-debug/issues/1642.
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 202
- Avg merge
- 5d 1h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/debugpy
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
All issues in microsoft/debugpy
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
xinnan-tech/xiaozhi-fde-talk#263 ·
-
rules
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
huggingface/Repo2RLEnv#163 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 95/100
huggingface/sentence-transformers#4074 ·
-
comp/dashboard invalid P3
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
NousResearch/hermes-agent#121143 ·