Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

Store full shell command in shell history (#7378)

Yavor Konstantinov922bb1719441
diff --git a/weed/shell/shell_liner.go b/weed/shell/shell_liner.go
index 0eb2ad4a37..220b043439 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 {