I've known that Alt+Space C could close PowerShell, but Alt+Space is already in use for me, I want to bind Alt+F4 to Alt+Space C, how to achieve that in AHK?
Asked
Active
Viewed 810 times
0
-
1Doesn't a regular Alt+F4 close PowerShell already? – u1686_grawity Aug 27 '21 at 09:08
-
2@user1686 Alt+F4 doesn't close PowerShell for me, seems to [require configuration](https://superuser.com/a/1388343/1023031). – Wenfang Du Aug 27 '21 at 09:10
-
Not familiar with AHK, but you can also type `Exit` to end a **PowerShell** console session. – Keith Miller Aug 27 '21 at 16:49
-
@user1686 Windows 11 seems to support Alt+F4 closing PowerShell, are you using it by any chance? – Wenfang Du Aug 28 '21 at 07:33
-
@WenfangDu change to Windows Terminal instead. It's much better than the default conhost and will close when you press Alt+F4 – phuclv Aug 28 '21 at 10:00
1 Answers
0
The following script enables using Alt+F4 or Ctrl+D to close PowerShell:
#IfWinActive ahk_exe powershell.exe
!F4::
^d::WinClose
#IfWinActive
Wenfang Du
- 549
- 6
- 16