mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-20 04:54:24 +02:00
Store full shell command in shell history (#7378)
Store shell command in history before parsing Store the shell command in history before parsing it. This will allow users to press the 'Up' arrow and see the entire command.
This commit is contained in:
1 parent
fa35efc076
commit
922bb17194
1 file changed
+4
-2
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user