Use stdout as controlling terminal

Soves an issue with go1.15 not letting ctty be a parent. See
https://github.com/creack/pty/pull/97 for more details.

Signed-off-by: Guillaume J. Charmes <git+guillaume@charmes.net>
This commit is contained in:
Guillaume J. Charmes 2020-05-06 10:25:11 -04:00 committed by Drew DeVault
parent 38a6d187b9
commit dc281e46d2
3 changed files with 5 additions and 2 deletions

View file

@ -4,6 +4,7 @@ import (
"os"
"os/exec"
"sync"
"syscall"
"git.sr.ht/~sircmpwn/aerc/lib/ui"
@ -237,7 +238,7 @@ func (term *Terminal) Draw(ctx *ui.Context) {
if term.pty == nil {
term.vterm.SetSize(ctx.Height(), ctx.Width())
tty, err := pty.StartWithSize(term.cmd, &winsize)
tty, err := pty.StartWithAttrs(term.cmd, &winsize, &syscall.SysProcAttr{Setsid: true, Setctty: true, Ctty: 1})
term.pty = tty
if err != nil {
term.Close(err)