ProcessManager: bugfix: replace only the last prompt