From a51e0624bf3a8663fd71ddd8dbee3bd257400e79 Mon Sep 17 00:00:00 2001 From: Daniel Milde Date: Wed, 31 May 2023 23:06:57 +0200 Subject: fix: stop process for windows --- tui/exec_other.go | 5 +++++ tui/exec_windows.go | 4 ++++ tui/keys.go | 3 +-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tui/exec_other.go b/tui/exec_other.go index 081462b..6fd0b91 100644 --- a/tui/exec_other.go +++ b/tui/exec_other.go @@ -5,6 +5,7 @@ package tui import ( "os" + "syscall" ) func getShellBin() string { @@ -31,3 +32,7 @@ func (ui *UI) spawnShell() { } }) } + +func stopProcess() error { + return syscall.Kill(syscall.Getpid(), syscall.SIGTSTP) +} diff --git a/tui/exec_windows.go b/tui/exec_windows.go index 2f91740..def10f0 100644 --- a/tui/exec_windows.go +++ b/tui/exec_windows.go @@ -27,3 +27,7 @@ func (ui *UI) spawnShell() { ui.showErr("Error executing shell", err) } } + +func stopProcess() error { + return nil +} diff --git a/tui/keys.go b/tui/keys.go index 6c4dc57..76629dc 100644 --- a/tui/keys.go +++ b/tui/keys.go @@ -2,7 +2,6 @@ package tui import ( "fmt" - "syscall" "github.com/dundee/gdu/v5/pkg/fs" "github.com/gdamore/tcell/v2" @@ -121,7 +120,7 @@ func (ui *UI) handleCtrlZ(key *tcell.EventKey) *tcell.EventKey { termApp.Lock() defer termApp.Unlock() - err := syscall.Kill(syscall.Getpid(), syscall.SIGTSTP) + err := stopProcess() if err != nil { ui.showErr("Error sending STOP signal", err) } -- cgit v1.2.3