How do I find the length of readline's mode string (eg @ or (cmd) or (ins)) which is printed in front of the bash prompt? This mode string is activated by set show-mode-in-prompt on in .inputrc.
I want to determine the length of this string from within $PROMPT_COMMAND.
I'm trying to do some cursor movement with tput inside the prompt to print some info on the terminal's right hand side (so that it can be overwritten if need be), then resume printing the prompt on the left, but I need to take into account the length of the mode string.
Is $PROMPT_COMMAND called again and the prompt reprinted if changing mode (e.g) emacs-mode-string to vi-ins-mode-string as the prefix?
tputfor this, though.tput scto capture the current cursor position andètput rc` to return back there.\e[sand\e[u.