From da8f2067c0ec269d8495ba7cf61695439fb401ac Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 5 Jun 2021 05:36:16 -0700 Subject: [PATCH] Reset colors to default on suspend. For most terminals this also is done with 'sgr0', but on some it appears that we need to explicitly use the 'oc' capability. (This is the documented behavior in terminfo.) --- go.sum | 2 -- tscreen.go | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/go.sum b/go.sum index 54d4bee..068fabd 100644 --- a/go.sum +++ b/go.sum @@ -6,8 +6,6 @@ github.com/mattn/go-runewidth v0.0.10 h1:CoZ3S2P7pvtP45xOtBw+/mDL2z0RKI576gSkzRR github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/rivo/uniseg v0.1.0 h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756 h1:9nuHUbU8dRnRRfj9KjWUVrJeoexdbeMjttk6Oh1rD10= -golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf h1:MZ2shdL+ZM/XzY3ZGOnh4Nlpnxz5GSOhOmtHo3iPU6M= diff --git a/tscreen.go b/tscreen.go index de2338c..49aacf1 100644 --- a/tscreen.go +++ b/tscreen.go @@ -1682,6 +1682,7 @@ func (t *tScreen) disengage() { ti := t.ti t.cells.Resize(0, 0) t.TPuts(ti.ShowCursor) + t.TPuts(ti.ResetFgBg) t.TPuts(ti.AttrOff) t.TPuts(ti.Clear) t.TPuts(ti.ExitCA)