Use separate variable for fd used to read history file; use string interpolation to print code lines; do not use unit test to remove temporary file and instead use a process exit event handler