]> git.lizzy.rs Git - micro.git/blob - internal/action/actions_posix.go
Fix cursor position change after CopyLine command (#2353)
[micro.git] / internal / action / actions_posix.go
1 // +build linux darwin dragonfly solaris openbsd netbsd freebsd
2
3 package action
4
5 import (
6         "syscall"
7
8         "github.com/zyedidia/micro/v2/internal/screen"
9 )
10
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 (*BufPane) Suspend() bool {
15         screenb := screen.TempFini()
16
17         // suspend the process
18         pid := syscall.Getpid()
19         err := syscall.Kill(pid, syscall.SIGSTOP)
20         if err != nil {
21                 screen.TermMessage(err)
22         }
23
24         screen.TempStart(screenb)
25
26         return false
27 }