The fix is to modify the shell's text storage directly, not to do text replacement on the textview.
The fix is to modify the shell's text storage directly, not to do text replacement on the textview.