Ghostty regression on coloured terminal prompt #9470
-
Issue DescriptionScreen.Recording.2025-11-04.at.3.03.53.pm.movbash
PROMPT_COMMAND=''
PS1=$'\e[31m#\e[0m 'Type 20 or so characters, then use your home key (ctrl+a on macos) and it won't go to the correct location. Moving around the cursor will corrupt data. Ghostty 1.2.0 broke support, but Ghostty 1.2.1 fixed it, but it seems Ghostty 1.2.3 broke it again. Character lengths are not being calculated correctly because it is counting the invisible ANSI escape sequences. The Dorothy oz theme uses such colours to distinguish when the shell is now sudo escalated. Expected BehaviorCursor movement should reflect the visible characters. Actual BehaviorCursor movement is corrupted due to the invisible characters. Reproduction StepsSee earlier. Ghostty LogsGhostty VersionOS Version InformationmacOS 15.7.2 (24G325) (Linux only) Display ServerNone (Linux only) Desktop Environment/Window ManagerNo response Minimal Ghostty Configuration# applicable even when emptyyAdditional Relevant ConfigurationNo response I acknowledge that:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
It's your Bash prompt that's causing this. You must wrap the escape sequences in See https://www.gnu.org/software/bash/manual/bash.html#Controlling-the-Prompt |
Beta Was this translation helpful? Give feedback.
It's your Bash prompt that's causing this. You must wrap the escape sequences in
\[and\]like this:See https://www.gnu.org/software/bash/manual/bash.html#Controlling-the-Prompt