mirror of
https://github.com/Hilbis/Hilbish
synced 2025-07-04 18:22:02 +00:00
Compare commits
2 Commits
80d72a29bb
...
e676c095c2
Author | SHA1 | Date | |
---|---|---|---|
e676c095c2 | |||
ef4c925e37 |
@ -66,6 +66,8 @@ func (s *Snail) Run(cmd string, strms *util.Streams) (bool, io.Writer, io.Writer
|
|||||||
buf := new(bytes.Buffer)
|
buf := new(bytes.Buffer)
|
||||||
//printer := syntax.NewPrinter()
|
//printer := syntax.NewPrinter()
|
||||||
|
|
||||||
|
replacer := strings.NewReplacer("[", "\\[", "]", "\\]")
|
||||||
|
|
||||||
var bg bool
|
var bg bool
|
||||||
for _, stmt := range file.Stmts {
|
for _, stmt := range file.Stmts {
|
||||||
bg = false
|
bg = false
|
||||||
@ -95,7 +97,7 @@ func (s *Snail) Run(cmd string, strms *util.Streams) (bool, io.Writer, io.Writer
|
|||||||
_, argstring = splitInput(strings.Join(args, " "))
|
_, argstring = splitInput(strings.Join(args, " "))
|
||||||
|
|
||||||
// If alias was found, use command alias
|
// If alias was found, use command alias
|
||||||
argstring = util.MustDoString(s.runtime, fmt.Sprintf(`return hilbish.aliases.resolve("%s")`, argstring)).AsString()
|
argstring = util.MustDoString(s.runtime, fmt.Sprintf(`return hilbish.aliases.resolve [[%s]]`, replacer.Replace(argstring))).AsString()
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
args, err = shell.Fields(argstring, nil)
|
args, err = shell.Fields(argstring, nil)
|
||||||
|
@ -240,7 +240,7 @@ func NewInstance() *Instance {
|
|||||||
var err error
|
var err error
|
||||||
rl.regexSearch, err = regexp.Compile("(?i)" + string(rl.tfLine))
|
rl.regexSearch, err = regexp.Compile("(?i)" + string(rl.tfLine))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
rl.RefreshPromptLog(err.Error())
|
//rl.RefreshPromptLog(err.Error())
|
||||||
rl.infoText = []rune(Red("Failed to match search regexp"))
|
rl.infoText = []rune(Red("Failed to match search regexp"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user