reverted f1e3820d09c69b705e43d03742829260f29e2dfa eaeeb5356504d2856a1b9cdf65a6f3a6d26b4399 (only save the document after the terminal step if pepper.keepTerminalDocs is set to "true")