1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 01:24:05 +08:00
This commit is contained in:
harveyshao 2023-01-08 09:55:06 +08:00
parent 98c3461152
commit d131489b19
2 changed files with 3 additions and 4 deletions

View File

@ -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...) {

View File

@ -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], "")