mirror of https://github.com/status-im/op-geth.git
Fixes #49
This commit is contained in:
parent
3f5b348451
commit
b902de20c7
|
@ -18,13 +18,18 @@ import (
|
||||||
|
|
||||||
func initReadLine() {
|
func initReadLine() {
|
||||||
C.rl_catch_sigwinch = 0
|
C.rl_catch_sigwinch = 0
|
||||||
|
C.rl_catch_signals = 0
|
||||||
c := make(chan os.Signal, 1)
|
c := make(chan os.Signal, 1)
|
||||||
signal.Notify(c, syscall.SIGWINCH)
|
signal.Notify(c, syscall.SIGWINCH)
|
||||||
|
signal.Notify(c, os.Interrupt)
|
||||||
go func() {
|
go func() {
|
||||||
for sig := range c {
|
for sig := range c {
|
||||||
switch sig {
|
switch sig {
|
||||||
case syscall.SIGWINCH:
|
case syscall.SIGWINCH:
|
||||||
C.rl_resize_terminal()
|
C.rl_resize_terminal()
|
||||||
|
|
||||||
|
case os.Interrupt:
|
||||||
|
C.rl_cleanup_after_signal()
|
||||||
default:
|
default:
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue