Skip to content

Commit

Permalink
fix(transient): count newlines and not ;
Browse files Browse the repository at this point in the history
relates to #807
  • Loading branch information
JanDeDobbeleer committed Jun 26, 2021
1 parent f19460a commit 8cf85a3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/engine.go
Expand Up @@ -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 }}</>"
Expand Down

0 comments on commit 8cf85a3

Please sign in to comment.