code-server: [Bug]: Ctrl+W closes tab + code-server
Is there an existing issue for this?
- I have searched the existing issues
OS/Web Information
- Web Browser: Chrome
- Local OS: Windows 10
- Remote OS: Ubuntu
- Remote Architecture: md64
code-server --version: 4.9.0 0502dfa1ff42ab8a43adb911f7bf21f8b09ee25f with Code 1.73.1
Steps to Reproduce
- Install https://open-vsx.org/extension/cweijan/vscode-mysql-client2
- Set up and open a table tab like below

- Clicking on
Closewill close just the tab, but pressingctrl+wwill close this table tab + code-server itself
Expected
I expect ctrl+w to close only this tab, unsure if it is a plugin issue or code-server, but feels more like code-server
Actual
pressing ctrl+w will close this table tab + code-server itself
Logs
No response
Screenshot/Video
No response
Does this issue happen in VS Code or GitHub Codespaces?
- I cannot reproduce this in VS Code.
- I cannot reproduce this in GitHub Codespaces.
Are you accessing code-server over HTTPS?
- I am using HTTPS.
Notes
NOTE
Cannot test in GitHub codespaces due to The 'MySQL' extension is not available in Visual Studio Code for the Web
Table tab closed properly in desktop VS Code
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (9 by maintainers)
The problem is due to SIGPIPE signal: https://github.com/microsoft/vscode/blob/14459d6db1a088fbf1c631350cb27ade59fe1e39/src/bootstrap.js#L31
If running code-server via systemd, there’s already IgnoreSIGPIPE=yes set by default for systemd service. All we have to do is set the environment variable
VSCODE_HANDLES_SIGPIPESince I am running code-server as a user service, I overrided the service file like this:
Add the following lines:
This is just a workaround. The correct solution would be for code-server to properly ignore the
SIGPIPEsignal and set theVSCODE_HANDLES_SIGPIPEenvironment variable totrue.Nice reproduction steps! It reproduces for me consistently. Thanks for reporting upstream.
I just gave it a shot as well and could not reproduce either 😢 (Codespaces nor code-server)
Wait how would binding
ctrl+win the browser be affected by sigpipe behavior?If this reproduces in Codespaces we could raise it upstream. Maybe it only happens on tabs with a webview? Web views use iframes so maybe there is something finicky there with how keys are bound.
~@pavelxdd thanks, let me try in a bit~
This made no difference for me
Another easier way to produce the problem.
ctrl+w, the whole code-server will close