Skip to content

Commit

Permalink
Updated a few details to work on macOS just like Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Mar 4, 2020
1 parent d83d9fd commit 3f85c48
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cmd/fyneterm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion term.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 3f85c48

Please sign in to comment.