question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: Ctrl+W closes tab + code-server

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 9 months ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
pavelxddcommented, Dec 14, 2022

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.

1reaction
code-ashercommented, Dec 20, 2022

I just gave it a shot as well and could not reproduce either 😢 (Codespaces nor code-server)

Read more comments on GitHub >

github_iconTop Results From Across the Web

prevent ctrl+w from closing tab · Issue #53 · coder/code-server
Can you use Ctrl + W to close editor tabs or some other VSCode functions? And I think it's better to close browser...
Read more >
How to prevent VScode from closing editor when pressing ctrl ...
Go to File -> Preferences -> Keyboard Shortcuts (or press Ctrl+K Ctrl+S). Find the "Close Window" setting with Ctrl+W as the Keybinding.
Read more >
Close all Windows but pinned closes pinned tab too when ...
I mapped the command 'Close All Windows but pinned' to Ctrl+Shift+W and when using shortcut all the tabs (pinned too) are closed, ...
Read more >
too easy to hit CTRL+Q instead of CTRL+W - Bugzilla@Mozilla
4) Change the Close Tab from Ctrl-W to some other key stroke. But keep in mind on this one that people who use...
Read more >
Visual Studio: Close Current Tab Keyboard Shortcut
Navigate to TOOLS > OPTIONS > KEYBOARD; Add CTRL+W global shortcut to Window.CloseDocumentWindow; Remove the CTRL+W shortcut for Edit.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found