[Bug]: Ctrl+W closes tab + code-server
See original GitHub issueIs 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
Close
will close just the tab, but pressingctrl+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
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:
- Created 9 months ago
- Comments:10 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub 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:
Add the following lines:
This is just a workaround. The correct solution would be for code-server to properly ignore the
SIGPIPE
signal and set theVSCODE_HANDLES_SIGPIPE
environment variable totrue
.I just gave it a shot as well and could not reproduce either 😢 (Codespaces nor code-server)