mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-28 21:39:02 +08: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 New Issue
Block a user