-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trouble disabling SC_CLOSE
for terminal
's window
#15702
Comments
Why would you like to disable the close button? |
Yea, messing with Terminal's HWND is 100% not supported. Focus mode might be something that interests you, though, that'll entirely hide the titlebar (including the tabs). We could theoretically make this a window theme setting. You can already hide the close button on the tabs, so there's probably room for configuring the close button too. Something ala: #12632 (comment) |
I need to trigger some cleanup scripts on exit, but So, I thought I'd just try to disable the X button.
@zadjii-msft That would be super helpful, actually. I realize that it wouldn't disable |
Hokay, so we talked a bit with @SteveL-MSFT about this. He's gonna take another shot at PowerShell/PowerShell#8000. Because honestly, that's the right solution here. Just fix that. Not disable the close button for the Terminal. That seems like it's an unnecessarily big hammer for a weird edge case in the shell scripting engine 😅 |
Hi! We've identified this issue as a duplicate of one that exists on somebody else's Issue Tracker. Please make sure you subscribe to the referenced external issue for future updates. Thanks for your report! |
Windows Terminal version
1.17.11461.0
Windows build number
10.0.19044.0
Other Software
PowerShell 7+
Steps to reproduce
I would like to disable the close (from the
ALT+Space
floating menu and the top-left window's "X") button for theterminal
that my PowerShell session is loaded in. So, I run the following function (based on this SO answer and this blog post):Run this function (or, paste it's body into a PowerShell 7+ session.
Expected Behavior
I was hoping that the close button (both X and in floating menu) would be disabled.
Actual Behavior
Close/X are not disabled.
The text was updated successfully, but these errors were encountered: