Skip to content

Commit

Permalink
Fix #20 alias 設定したコマンドで "&" が機能しない
Browse files Browse the repository at this point in the history
  • Loading branch information
hymkor committed Oct 8, 2014
1 parent 0a600ee commit 00835eb
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions alias/alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,21 @@ func hook(cmd *exec.Cmd, IsBackground bool, closer io.Closer) (interpreter.NextT
if !ok {
return nextHook(cmd, IsBackground, closer)
}
next, err := callee.Call(cmd)
if next != interpreter.THROUGH && closer != nil {
closer.Close()
if IsBackground {
go func() {
callee.Call(cmd)
if closer != nil {
closer.Close()
}
}()
return interpreter.CONTINUE, nil
} else {
next, err := callee.Call(cmd)
if next != interpreter.THROUGH && closer != nil {
closer.Close()
}
return next, err
}
return next, err
}

func Init() {
Expand Down

0 comments on commit 00835eb

Please sign in to comment.