diff --git a/cmd/vinegar/binary.go b/cmd/vinegar/binary.go index 436fcef4..39ff3091 100644 --- a/cmd/vinegar/binary.go +++ b/cmd/vinegar/binary.go @@ -104,9 +104,14 @@ func (b *Binary) Run(args ...string) error { signal.Notify(c, os.Interrupt, syscall.SIGTERM) go func() { <-c - log.Println("Killing Roblox") - // This way, cmd.Run() will return and the wineprefix killer will be ran. - cmd.Process.Kill() + + // Only kill the process if it even had a PID + if cmd.Process != nil { + log.Println("Killing Roblox") + // This way, cmd.Run() will return and the wineprefix killer will be ran. + cmd.Process.Kill() + } + // Don't handle INT after it was recieved, this way if another signal was sent, // Vinegar will immediately exit. signal.Stop(c) @@ -118,6 +123,11 @@ func (b *Binary) Run(args ...string) error { b.Splash.Message("Launching " + b.Alias) defer func() { + // Don't do anything if the process even ran correctly. + if cmd.Process == nil { + return + } + for { time.Sleep(100 * time.Millisecond) diff --git a/cmd/vinegar/vinegar.go b/cmd/vinegar/vinegar.go index f0c21c9e..d3693c02 100644 --- a/cmd/vinegar/vinegar.go +++ b/cmd/vinegar/vinegar.go @@ -198,8 +198,10 @@ func Sysinfo(pfx *wine.Prefix) { * Processor: %s * Supports AVX: %t * Kernel: %s -* Wine: %s -` +* Wine: %s` fmt.Printf(info, sysinfo.Distro, sysinfo.CPU, sysinfo.HasAVX, sysinfo.Kernel, ver) + if sysinfo.InFlatpak { + fmt.Println("* Flatpak: [x]") + } }