smart_exit
Synopsis
Section titled “Synopsis”smart_exit [-h] [-n]Description
Section titled “Description”Closes the shell session. In Kitty, captures the terminal scrollback to a timestamped log file in $SCROLLBACK_HISTORY_DIR before exiting. Automatically prunes junk and the oldest logs when the count exceeds $SCROLLBACK_HISTORY_MAX_FILES.
The log directory is private (700, tightened silently if an earlier version left it laxer) and the log file is written 600 whatever the umask.
Arguments
Section titled “Arguments”-h, --help |
Show help message |
-n, --no-log |
Exit without saving a scrollback log |
Exit Status
Section titled “Exit Status”0 |
Shell session exited |
2 |
Unknown option |
The exit builtin is wired to smart_exit for interactive sessions. Typing exit or Ctrl+D behaves identically to calling smart_exit directly.
Example
Section titled “Example”smart_exitsmart_exit --no-logDependencies: kitty, ps, _private_dir, _scrollback_prune_junk
Classification: self-limiting(rm), destructive