edit text in the middle of a shell pipeline, and store a diff to replay changes after further invocations