mirror of
https://github.com/Hilbis/Hilbish
synced 2025-04-04 12:43:22 +00:00
fix: revert "fix: resize if terminal has been resized during running command and fix readline segfault"
This reverts commit d270e8f66b929163102998b0d0eaeeb811ca23c3. causes breakage
This commit is contained in:
parent
d270e8f66b
commit
4e2e8ddf94
15
main.go
15
main.go
@ -34,9 +34,6 @@ var (
|
|||||||
hooks bait.Bait
|
hooks bait.Bait
|
||||||
defaultConfPath string
|
defaultConfPath string
|
||||||
defaultHistPath string
|
defaultHistPath string
|
||||||
|
|
||||||
resized bool
|
|
||||||
started bool
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -170,7 +167,6 @@ func main() {
|
|||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
started = true
|
|
||||||
input:
|
input:
|
||||||
for interactive {
|
for interactive {
|
||||||
running = false
|
running = false
|
||||||
@ -178,11 +174,6 @@ input:
|
|||||||
lr.SetPrompt(fmtPrompt())
|
lr.SetPrompt(fmtPrompt())
|
||||||
input, err := lr.Read()
|
input, err := lr.Read()
|
||||||
|
|
||||||
if resized {
|
|
||||||
resized = false
|
|
||||||
lr.Resize()
|
|
||||||
}
|
|
||||||
|
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
// Exit if user presses ^D (ctrl + d)
|
// Exit if user presses ^D (ctrl + d)
|
||||||
break
|
break
|
||||||
@ -279,12 +270,8 @@ func HandleSignals() {
|
|||||||
}
|
}
|
||||||
case syscall.SIGWINCH:
|
case syscall.SIGWINCH:
|
||||||
hooks.Em.Emit("signals.resize")
|
hooks.Em.Emit("signals.resize")
|
||||||
if interactive {
|
if !running && interactive {
|
||||||
if !running && started {
|
|
||||||
lr.Resize()
|
lr.Resize()
|
||||||
} else {
|
|
||||||
resized = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user