1 // +build linux darwin dragonfly solaris openbsd netbsd freebsd
8 "github.com/zyedidia/micro/cmd/micro/screen"
11 // Suspend sends micro to the background. This is the same as pressing CtrlZ in most unix programs.
12 // This only works on linux and has no default binding.
13 // This code was adapted from the suspend code in nsf/godit
14 func (*BufHandler) Suspend() bool {
15 screenb := screen.TempFini()
17 // suspend the process
18 pid := syscall.Getpid()
19 err := syscall.Kill(pid, syscall.SIGSTOP)
21 screen.TermMessage(err)
24 screen.TempStart(screenb)