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

  1. Install https://open-vsx.org/extension/cweijan/vscode-mysql-client2
  2. Set up and open a table tab like below image
  3. Clicking on Close will close just the tab, but pressing ctrl+w will 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

image 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)

Most upvoted comments

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_SIGPIPE

Since I am running code-server as a user service, I overrided the service file like this:

systemctl --user edit code-server

Add the following lines:

[Service]
Environment=VSCODE_HANDLES_SIGPIPE=true

This is just a workaround. The correct solution would be for code-server to properly ignore the SIGPIPE signal and set the VSCODE_HANDLES_SIGPIPE environment variable to true.

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+w in 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~

Add the following lines:

[Service]
Environment=VSCODE_HANDLES_SIGPIPE=true

This made no difference for me

Another easier way to produce the problem.

image

  1. Open a new file
  2. Open any extension homepage
  3. Put the extension homepage on the left and new file on the right (See screenshot)
  4. Switch to extension homepage and press ctrl+w, the whole code-server will close