mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
ensure to call line.Close()
fix https://github.com/chrislusf/seaweedfs/issues/1995 similar to https://github.com/peterh/liner/issues/104
This commit is contained in:
parent
3f3268cd1b
commit
90677e1097
|
@ -2,6 +2,7 @@ package shell
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/chrislusf/seaweedfs/weed/util/grace"
|
||||
"io"
|
||||
"os"
|
||||
"path"
|
||||
|
@ -25,6 +26,9 @@ func RunShell(options ShellOptions) {
|
|||
|
||||
line = liner.NewLiner()
|
||||
defer line.Close()
|
||||
grace.OnInterrupt(func() {
|
||||
line.Close()
|
||||
})
|
||||
|
||||
line.SetCtrlCAborts(true)
|
||||
|
||||
|
|
Loading…
Reference in a new issue