mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-19 03:07:54 +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:
@@ -2,6 +2,7 @@ package shell
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/util/grace"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
@@ -25,6 +26,9 @@ func RunShell(options ShellOptions) {
|
|||||||
|
|
||||||
line = liner.NewLiner()
|
line = liner.NewLiner()
|
||||||
defer line.Close()
|
defer line.Close()
|
||||||
|
grace.OnInterrupt(func() {
|
||||||
|
line.Close()
|
||||||
|
})
|
||||||
|
|
||||||
line.SetCtrlCAborts(true)
|
line.SetCtrlCAborts(true)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user