Skip to content

Commit 07fe27f

Browse files
seefoodclaude
andcommitted
fix(themes/powerline): ensure prompt starts on a new line
When a command's output has no trailing newline, \e[G (column 1) in PS1 would overwrite that output with the prompt. Add a missing-newline indicator in PROMPT_COMMAND: reversed-video % marks the incomplete line, then \r\e[K moves to column 1 and clears it, so the prompt always renders cleanly regardless of the previous command's output. Fixes #2372 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 854c4ee commit 07fe27f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

themes/powerline/powerline.base.bash

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,10 @@ function __powerline_prompt_command() {
290290
local beginning_of_line='\[\e[G\]'
291291
local info prompt_color segment prompt
292292

293+
# Reversed % marks where a missing trailing newline was; \r\e[K then
294+
# clears the line so the prompt always starts cleanly at column 1.
295+
printf '%b' '\e[7m%\e[0m\r\e[K'
296+
293297
local LEFT_PROMPT=""
294298
local SEGMENTS_AT_LEFT=0
295299
local LAST_SEGMENT_COLOR=""

0 commit comments

Comments
 (0)