sed "s///g" | sed "s/\x0d//g" | sed -r "s/\[([0-9]{1,2}(;[0-9]{1,2}?)?)?[m|K]//g"'
The first sed command didn’t paste properly
Edit. Found it in my commit message for one of my scripts.
busybox sed does not undertstan \x1b control code, but does understand when <ctrl>-v <ESC>
is used to insert ^[
\x0d works just fine for for ^M escape code.