3 ms·
A slight improvement: adding "\\033[K" to the end, i.e.: PROMPT_COMMAND='printf "⏎%$((COLUMNS-1))s\\r\\033[K"' kills the extra spaces at the end, which can
by nneonneo 6y ago
A slight improvement: adding "\\033[K" to the end, i.e.:
PROMPT_COMMAND='printf "⏎%$((COLUMNS-1))s\\r\\033[K"'
kills the extra spaces at the end, which can help alleviate some of the weirder line wrapping that occurs when resizing a terminal window.
(I believe zsh uses something like \033[J${PS1}\033[K for similar effect).
- JetSpiegel 6y agoThis is a great addition to the post, thanks for this.