This is workflow to turn on/off Hotcorners by pressing hotkey. This workflow requires Antigen to be installed https://antigen.sharats.me/
Also you should change terminal's shell setting too.
In Terminal > Preferences… > Profiles > Shell, the default setting for When the shell exits: is: Don't close the window
This can be changed to: Close the window
Then the exit command will close the window.
You can change hotkeys to whatever you want.
Enjoy!