From d131489b194ec7f6dfd760f6f91653522ea7f598 Mon Sep 17 00:00:00 2001 From: harveyshao Date: Sun, 8 Jan 2023 09:55:06 +0800 Subject: [PATCH] opt some --- base/ssh/script.go | 3 +-- core/chat/pod.go | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/base/ssh/script.go b/base/ssh/script.go index 90f8706d..c143490a 100644 --- a/base/ssh/script.go +++ b/base/ssh/script.go @@ -112,8 +112,7 @@ func (f *Frame) parse(m *ice.Message, h, line string) string { func (f *Frame) scan(m *ice.Message, h, line string) *Frame { f.ps1 = kit.Simple(m.Confv(PROMPT, kit.Keym(PS1))) f.ps2 = kit.Simple(m.Confv(PROMPT, kit.Keym(PS2))) - // m.Options(MESSAGE, m, ice.LOG_DISABLE, ice.TRUE) - m.Options(MESSAGE, m) + m.Options(MESSAGE, m, ice.LOG_DISABLE, ice.TRUE) m.I, m.O = f.stdin, f.stdout ps, bio := f.ps1, bufio.NewScanner(f.stdin) for f.prompt(m, ps...); f.stdin != nil && bio.Scan(); f.prompt(m, ps...) { diff --git a/core/chat/pod.go b/core/chat/pod.go index 5ab25dc5..fd39b8a2 100644 --- a/core/chat/pod.go +++ b/core/chat/pod.go @@ -2,13 +2,13 @@ package chat import ( "path" - "strings" ice "shylinux.com/x/icebergs" "shylinux.com/x/icebergs/base/aaa" "shylinux.com/x/icebergs/base/cli" "shylinux.com/x/icebergs/base/ctx" "shylinux.com/x/icebergs/base/mdb" + "shylinux.com/x/icebergs/base/nfs" "shylinux.com/x/icebergs/base/web" kit "shylinux.com/x/toolkits" ) @@ -31,7 +31,7 @@ func init() { if len(arg) == 0 || kit.Select("", arg, 0) == "" { web.RenderCmd(m, web.SPACE) } else if len(arg) == 1 { - if m.Cmd(web.SPACE, arg[0]).Length() == 0 && !strings.Contains(arg[0], ice.PT) { + if m.Cmd(web.SPACE, arg[0]).Length() == 0 && nfs.ExistsFile(m, path.Join(ice.USR_LOCAL_WORK, arg[0])) { m.Cmd(web.DREAM, cli.START, kit.Dict(mdb.NAME, arg[0])) } web.RenderMain(aaa.UserRoot(m), arg[0], "")