From ca95bcf1d873ea82326d6747534b8ad1168e7f7b Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Fri, 8 Feb 2019 19:19:28 +0300 Subject: [PATCH] add shell prefixes to history --- eval.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eval.go b/eval.go index 027b576..6d3921e 100644 --- a/eval.go +++ b/eval.go @@ -873,7 +873,7 @@ func (e *callExpr) eval(app *app, args []string) { case ":": log.Printf("command: %s", s) app.ui.cmdPrefix = "" - app.cmdHistory = append(app.cmdHistory, cmdItem{app.ui.cmdPrefix, s}) + app.cmdHistory = append(app.cmdHistory, cmdItem{":", s}) p := newParser(strings.NewReader(s)) for p.parse() { p.expr.eval(app, nil) @@ -884,11 +884,11 @@ func (e *callExpr) eval(app *app, args []string) { case "$": log.Printf("shell: %s", s) app.ui.cmdPrefix = "" - app.cmdHistory = append(app.cmdHistory, cmdItem{app.ui.cmdPrefix, s}) + app.cmdHistory = append(app.cmdHistory, cmdItem{"$", s}) app.runShell(s, nil, "$") case "%": log.Printf("shell-pipe: %s", s) - app.cmdHistory = append(app.cmdHistory, cmdItem{app.ui.cmdPrefix, s}) + app.cmdHistory = append(app.cmdHistory, cmdItem{"%", s}) app.runShell(s, nil, "%") case ">": io.WriteString(app.cmdIn, s+"\n") @@ -896,12 +896,12 @@ func (e *callExpr) eval(app *app, args []string) { case "!": log.Printf("shell-wait: %s", s) app.ui.cmdPrefix = "" - app.cmdHistory = append(app.cmdHistory, cmdItem{app.ui.cmdPrefix, s}) + app.cmdHistory = append(app.cmdHistory, cmdItem{"!", s}) app.runShell(s, nil, "!") case "&": log.Printf("shell-async: %s", s) app.ui.cmdPrefix = "" - app.cmdHistory = append(app.cmdHistory, cmdItem{app.ui.cmdPrefix, s}) + app.cmdHistory = append(app.cmdHistory, cmdItem{"&", s}) app.runShell(s, nil, "&") case "/": if gOpts.incsearch {