Python appears in macOS Dock when Copilot CLI starts LSP servers
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 11.2k
- Forks
- 1.9k
- Avg merge
- 14h 16m
- Merged PRs (30d)
- 6
Description
Summary
When the Copilot CLI app starts a session, it launches Python LSP language servers that register as GUI applications in the macOS Dock. The Python icon appears in the Dock and persists even after the server process exits (with failure). This is disruptive — users do not expect a terminal/CLI tool to spawn visible GUI processes.
Filed by GitHub Copilot on behalf of @hubwriter.
Environment
- OS: macOS (Darwin, Apple Silicon)
- Copilot CLI version: 1.0.70
- Python:
/usr/bin/python3(system Python) - Affected LSP servers:
lsp-python(and possibly others — all 6 LSP servers fail on startup in this environment)
Steps to Reproduce
- Open the Copilot CLI app
- Start or resume any session in a repository
- Observe the macOS Dock
Expected Behavior
- LSP servers should run as background-only processes
- No icons should appear in the macOS Dock or app switcher
- Failed LSP servers should not leave visible artifacts in the UI
Actual Behavior
- Python icon appears in the macOS Dock when
lsp-pythonis launched - The icon persists even after the process exits with code 1
- This happens on every session start/refresh, repeatedly
- All 6 LSP servers (typescript, omnisharp, ruby, rust, python, go) fail to initialize but Python is the only one that shows a Dock icon
LSP Server Status (all failing)
lsp-typescript — exited with code 1
lsp-omnisharp — exited with code 131
lsp-ruby — exited with code 127
lsp-rust — exited with code 1
lsp-python — exited with code 1
lsp-go — exited with code 1
Suggested Fix
- Set
LSBackgroundOnlyorLSUIElementin the Python subprocess environment or useLSBackgroundOnlyin the process launch to prevent Dock registration - Use
NSApplication.setActivationPolicy(.prohibited)or equivalent when spawning LSP subprocesses - Do not launch LSP servers that will fail — if the server binary is not available or crashes on startup, skip it rather than retrying each session
- Launch Python with
-Sor as a module in a way that does not trigger the macOS window server registration (e.g., avoid importing Tk/tkinter)
Workaround
Users can manually add LSBackgroundOnly to the Python.app Info.plist:
sudo /usr/libexec/PlistBuddy -c "Add :LSBackgroundOnly bool true" \
/Library/Frameworks/Python.framework/Versions/3.X/Resources/Python.app/Contents/Info.plist
But this affects all Python GUI applications system-wide, which is not ideal.
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.
Research direction
Start by reproducing the issue on macOS, then trace how the Copilot CLI launches the lsp-python subprocess and whether failed LSP servers are retried on session start. Compare the launch environment with the suggested background-only options. Done means LSP servers run without Dock or app-switcher entries, and failed servers leave no persistent UI artifacts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos, python
- Domain
- cli, devtools, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100