Add "logout script" for interactive shell #12733
Labels
enhancement
New feature or request
hooks
Hooks are used to react to changes during interactive execution
needs-design
this feature requires design
Related problem
In ZSH or Bash, I can execute scripts/commands when I close the interactive shell. In Bash and ZSH this functionnality is given by a script file, respectively ".bash_logout" and ".zlogout". Code inside this file is executed while the shell is closing. It seems that this functionnality doesnt exist in Nushell.
Describe the solution you'd like
Add any kind of functionality that allow code to be run while the shell exit.
Describe alternatives you've considered
No response
Additional context and details
Simple usage case :
While using the shell I use custom commands to populate in-memory database. I can initialise the database in the config.nu file for example but I cannot automaticaly save the database when exiting the shell.
This can be useful too for some cleaning like deleting temp files.
The text was updated successfully, but these errors were encountered: