diff --git a/weed/shell/shell_liner.go b/weed/shell/shell_liner.go index 0eb2ad4a3..220b04343 100644 --- a/weed/shell/shell_liner.go +++ b/weed/shell/shell_liner.go @@ -84,6 +84,10 @@ func RunShell(options ShellOptions) { return } + if strings.TrimSpace(cmd) != "" { + line.AppendHistory(cmd) + } + for _, c := range util.StringSplit(cmd, ";") { if processEachCmd(reg, c, commandEnv) { return @@ -95,8 +99,6 @@ func RunShell(options ShellOptions) { func processEachCmd(reg *regexp.Regexp, cmd string, commandEnv *CommandEnv) bool { cmds := reg.FindAllString(cmd, -1) - line.AppendHistory(cmd) - if len(cmds) == 0 { return false } else {