mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-26 06:46:35 +00:00
Setup signal handlers before ncurses initialization
This prevents fzf from missing SIGWINCH during startup which occasionally happens with fzf-tmux
This commit is contained in:
parent
81a88693c1
commit
6bddffbca4
@ -9,6 +9,7 @@ CHANGELOG
|
|||||||
orthogonally controlling "exactness" of search
|
orthogonally controlling "exactness" of search
|
||||||
- Fixed not to display non-printable characters
|
- Fixed not to display non-printable characters
|
||||||
- Added `double-click` for `--bind` option
|
- Added `double-click` for `--bind` option
|
||||||
|
- More robust handling of SIGWINCH
|
||||||
|
|
||||||
0.10.8
|
0.10.8
|
||||||
------
|
------
|
||||||
|
@ -713,21 +713,6 @@ func executeCommand(template string, current string) {
|
|||||||
func (t *Terminal) Loop() {
|
func (t *Terminal) Loop() {
|
||||||
<-t.startChan
|
<-t.startChan
|
||||||
{ // Late initialization
|
{ // Late initialization
|
||||||
t.mutex.Lock()
|
|
||||||
t.initFunc()
|
|
||||||
t.calculateMargins()
|
|
||||||
t.printPrompt()
|
|
||||||
t.placeCursor()
|
|
||||||
C.Refresh()
|
|
||||||
t.printInfo()
|
|
||||||
t.printHeader()
|
|
||||||
t.mutex.Unlock()
|
|
||||||
go func() {
|
|
||||||
timer := time.NewTimer(initialDelay)
|
|
||||||
<-timer.C
|
|
||||||
t.reqBox.Set(reqRefresh, nil)
|
|
||||||
}()
|
|
||||||
|
|
||||||
intChan := make(chan os.Signal, 1)
|
intChan := make(chan os.Signal, 1)
|
||||||
signal.Notify(intChan, os.Interrupt, os.Kill)
|
signal.Notify(intChan, os.Interrupt, os.Kill)
|
||||||
go func() {
|
go func() {
|
||||||
@ -744,6 +729,21 @@ func (t *Terminal) Loop() {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
t.mutex.Lock()
|
||||||
|
t.initFunc()
|
||||||
|
t.calculateMargins()
|
||||||
|
t.printPrompt()
|
||||||
|
t.placeCursor()
|
||||||
|
C.Refresh()
|
||||||
|
t.printInfo()
|
||||||
|
t.printHeader()
|
||||||
|
t.mutex.Unlock()
|
||||||
|
go func() {
|
||||||
|
timer := time.NewTimer(initialDelay)
|
||||||
|
<-timer.C
|
||||||
|
t.reqBox.Set(reqRefresh, nil)
|
||||||
|
}()
|
||||||
|
|
||||||
// Keep the spinner spinning
|
// Keep the spinner spinning
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
|
Loading…
Reference in New Issue
Block a user