Skip to content
Myr

Do not erase the line the prompt was on (#4918)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

- When the cursor is not at column 0, Init() makes space so fzf draws on the next line and the prompt line is left intact - Close() undid that: it moved up onto the prompt line before ESC[J, so the erase wiped a line fzf never wrote on - Shells repaint afterwards, so it showed as a flicker of the last prompt line. Reported on fish, also seen on bash and nushell. zsh erases the same line but repaints fast enough to hide it - Erase our own area first, then step back and restore the column, so nothing on that line is touched, RPROMPT included Fix #4913

authored by Junegunn Choi · committed by GitHub · parent 1578b7c · Browse files · 1 file+6 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−1 removed

  • other:+6 added−1 removed

1 file+6 added−1 removed

modified:src/tui/light.go+6 added-1 removed
173 unmodified lines
174 origState *term.State175 width int176 height int177 yoffset int178 xoffset int179 tabstop int180 escDelay int181 fullscreen bool182 upOneLine bool
94 unmodified lines
277 // captured by either of fzf process which can cause x offset to be278 // increased and we're left with unwanted extra new line.279 if x > 0 && r.clearOnExit {280 r.upOneLine = true281 r.xoffset = x282 r.makeSpace()283 }284 // We assume that --no-clear is used for repetitive relaunching of fzf.285 // So we do not clear the lower bottom of the screen.
893 unmodified lines
1179 if r.fullscreen {1180 r.rmcup()1181 } else {1182 r.origin()1183 // Erase our own area first, then step back onto the line the1184 // prompt was on, so nothing on that line is touched1185 r.csi("J")1186 if r.upOneLine {1187 r.csi("A")1188 r.csi(fmt.Sprintf("%dG", r.xoffset+1))1189 }1184 r.csi("J")1190 }1191 } else if !r.fullscreen {1192 r.stderr("\x1b8") // DECRC: restore cursor position1193 }
504 unmodified lines