That's still only best effort, for example it will depend on the terminal but it doesn't reset things like xterm's control keys send escape sequences property, so:
printf "\e]4;1;?\a\e[>4;2m"
In xterm+fish will result in a messed up shell which you can't escape from (as ^C to clear the input doesn't work anymore).