When the user presses Ctrl+C (Interrupted) or Ctrl+D (Eof) in the REPL, the shell_loop breaks immediately via lines 90-96 before reaching append_history on line 105. This means the current session's command history is silently discarded. The fix should save history before breaking on interrupt/eof.
When the user presses
Ctrl+C(Interrupted) orCtrl+D(Eof) in the REPL, the shell_loop breaks immediately via lines 90-96 before reachingappend_historyon line 105. This means the current session's command history is silently discarded. The fix should save history before breaking on interrupt/eof.