launcher: Write the executed commands to the history file