From 8cf85a370dad0cf322a2351747943c24ced9fdf8 Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Sat, 26 Jun 2021 20:16:00 +0200 Subject: [PATCH] fix(transient): count newlines and not ; relates to #807 --- src/engine.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/engine.go b/src/engine.go index 60a1f77d..2e9e9558 100644 --- a/src/engine.go +++ b/src/engine.go @@ -219,11 +219,8 @@ func (e *engine) renderTooltip(tip string) string { } func (e *engine) renderTransientPrompt(command string) string { - newlines := strings.Count(command, ";") - if strings.HasSuffix(command, ";") { - newlines-- - } - command = strings.Replace(command, ";", fmt.Sprintf(";%s", e.ansi.newLine()), newlines) + newlines := strings.Count(command, "\n") + command = strings.Replace(command, "\n", e.ansi.newLine(), newlines) promptTemplate := e.config.TransientPrompt.Template if len(promptTemplate) == 0 { promptTemplate = "{{ .Shell }}> <#f7dc66>{{ .Command }}"