From 3f85c48fee4f88095f5545b91a7c5adc4c6b3581 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Wed, 4 Mar 2020 18:13:16 +0000 Subject: [PATCH] Updated a few details to work on macOS just like Linux --- cmd/fyneterm/main.go | 6 +++++- term.go | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/fyneterm/main.go b/cmd/fyneterm/main.go index 62ff6253..b190adb3 100644 --- a/cmd/fyneterm/main.go +++ b/cmd/fyneterm/main.go @@ -22,7 +22,11 @@ func setupListener(t *terminal.Terminal, w fyne.Window) { for { config := <-listen - w.SetTitle(termTitle + ": " + config.Title) + if config.Title == "" { + w.SetTitle(termTitle) + } else { + w.SetTitle(termTitle + ": " + config.Title) + } } }() t.AddListener(listen) diff --git a/term.go b/term.go index 35136c09..5e3bc44e 100644 --- a/term.go +++ b/term.go @@ -113,7 +113,9 @@ func (t *Terminal) run() { num, err := t.pty.Read(buf) if err != nil { // this is the pre-go 1.13 way to check for the read failing (terminal closed) - if err, ok := err.(*os.PathError); ok && err.Err.Error() == "input/output error" { + if err.Error() == "EOF" { + break // term exit on macOS + } else if err, ok := err.(*os.PathError); ok && err.Err.Error() == "input/output error" { break // broken pipe, terminal exit }