2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-07-04 18:22:02 +00:00

Compare commits

...

2 Commits

2 changed files with 4 additions and 2 deletions

View File

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

View File

@ -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"))
} }