fix(lib): send carriage return after `title` to fix #11314 (#11315)
Window and tab titles are changed by emitting an unprintable escape
sequence to the terminal. These escape sequences do not play nicely
with the TAB character on multiple terminal emulators--they create
un-deletable characters on the first line after command execution.
Sending "\r" after changing the window and tab titles allows all
characters on the first line to be deleted.
Fixes #11314
Diff
1diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
2index 80ca7ef78fe64fd57359ae258026fb9841749117..fc1cde55e38f0388be699e411e33fa56b643376d 100644
3--- a/lib/termsupport.zsh
4+++ b/lib/termsupport.zsh
5@@ -36,6 +36,8 @@ function title {
6 fi
7 ;;
8 esac
9+
10+ print -Pn "\r" # move the cursor to the beginning of the line
11 }
1213 ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD