From d19aba710a0b2ba355909307b2e1588d9ff60762 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 19:55:23 +0000 Subject: [PATCH] Bump github.com/gdamore/tcell/v2 from 2.13.7 to 2.13.9 Bumps [github.com/gdamore/tcell/v2](https://github.com/gdamore/tcell) from 2.13.7 to 2.13.9. - [Release notes](https://github.com/gdamore/tcell/releases) - [Changelog](https://github.com/gdamore/tcell/blob/main/CHANGESv3.md) - [Commits](https://github.com/gdamore/tcell/compare/v2.13.7...v2.13.9) --- updated-dependencies: - dependency-name: github.com/gdamore/tcell/v2 dependency-version: 2.13.9 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 +-- vendor/github.com/gdamore/tcell/v2/input.go | 20 +++++++++-- .../github.com/gdamore/tcell/v2/simulation.go | 4 +++ vendor/github.com/gdamore/tcell/v2/style.go | 34 +++++++++++++++++-- vendor/github.com/gdamore/tcell/v2/tscreen.go | 9 +++-- vendor/modules.txt | 2 +- 7 files changed, 65 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 54b13037a..e9ccad5bd 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/netobserv/network-observability-cli go 1.25.0 require ( - github.com/gdamore/tcell/v2 v2.13.7 + github.com/gdamore/tcell/v2 v2.13.9 github.com/gopacket/gopacket v1.5.0 github.com/jpillora/sizestr v1.0.0 github.com/mattn/go-sqlite3 v1.14.44 diff --git a/go.sum b/go.sum index 45847d177..e6ee82393 100644 --- a/go.sum +++ b/go.sum @@ -39,8 +39,8 @@ github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sa github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= github.com/gdamore/encoding v1.0.1 h1:YzKZckdBL6jVt2Gc+5p82qhrGiqMdG/eNs6Wy0u3Uhw= github.com/gdamore/encoding v1.0.1/go.mod h1:0Z0cMFinngz9kS1QfMjCP8TY7em3bZYeeklsSDPivEo= -github.com/gdamore/tcell/v2 v2.13.7 h1:yfHdeC7ODIYCc6dgRos8L1VujQtXHmUpU6UZotzD6os= -github.com/gdamore/tcell/v2 v2.13.7/go.mod h1:+Wfe208WDdB7INEtCsNrAN6O2m+wsTPk1RAovjaILlo= +github.com/gdamore/tcell/v2 v2.13.9 h1:uI5l3DYPcFvHINKlGft+en23evOKL+dwtD21QR8ejVA= +github.com/gdamore/tcell/v2 v2.13.9/go.mod h1:+Wfe208WDdB7INEtCsNrAN6O2m+wsTPk1RAovjaILlo= github.com/gkampitakis/ciinfo v0.3.2 h1:JcuOPk8ZU7nZQjdUhctuhQofk7BGHuIy0c9Ez8BNhXs= github.com/gkampitakis/ciinfo v0.3.2/go.mod h1:1NIwaOcFChN4fa/B0hEBdAb6npDlFL8Bwx4dfRLRqAo= github.com/gkampitakis/go-diff v1.3.2 h1:Qyn0J9XJSDTgnsgHRdz9Zp24RaJeKMUHg2+PDZZdC4M= diff --git a/vendor/github.com/gdamore/tcell/v2/input.go b/vendor/github.com/gdamore/tcell/v2/input.go index d5dbf51a6..4a577b9f2 100644 --- a/vendor/github.com/gdamore/tcell/v2/input.go +++ b/vendor/github.com/gdamore/tcell/v2/input.go @@ -502,7 +502,15 @@ func (ip *inputProcessor) scan() { } case inpStateCsi: // usual case for incoming keys - if r >= 0x30 && r <= 0x3F { // parameter bytes + if r == '\x1b' { + // Per ECMA-48 §5.3.1, ESC restarts the escape + // sequence machine from any intermediate state. + ip.state = inpStateEsc + if len(ip.buf) == 0 && ip.nested == nil { + ip.expire = time.Now().Add(time.Millisecond * 50) + ip.timer = time.AfterFunc(time.Millisecond*60, ip.escTimeout) + } + } else if r >= 0x30 && r <= 0x3F { // parameter bytes ip.csiParams = append(ip.csiParams, byte(r)) } else if r >= 0x20 && r <= 0x2F { // intermediate bytes, rarely used ip.csiInterm = append(ip.csiInterm, byte(r)) @@ -518,7 +526,15 @@ func (ip *inputProcessor) scan() { case inpStateSs3: // typically application mode keys or older terminals ip.state = inpStateInit - if k, ok := ss3Keys[r]; ok { + if r == '\x1b' { + // Per ECMA-48 §5.3.1, ESC restarts the escape + // sequence machine from any intermediate state. + ip.state = inpStateEsc + if len(ip.buf) == 0 && ip.nested == nil { + ip.expire = time.Now().Add(time.Millisecond * 50) + ip.timer = time.AfterFunc(time.Millisecond*60, ip.escTimeout) + } + } else if k, ok := ss3Keys[r]; ok { ip.post(NewEventKey(k, 0, ModNone)) } diff --git a/vendor/github.com/gdamore/tcell/v2/simulation.go b/vendor/github.com/gdamore/tcell/v2/simulation.go index 9a09c3c0e..63b94af02 100644 --- a/vendor/github.com/gdamore/tcell/v2/simulation.go +++ b/vendor/github.com/gdamore/tcell/v2/simulation.go @@ -143,6 +143,10 @@ func (s *simscreen) Init() error { func (s *simscreen) Fini() { s.Lock() + if s.fini { + s.Unlock() + return + } s.fini = true s.back.Resize(0, 0) s.Unlock() diff --git a/vendor/github.com/gdamore/tcell/v2/style.go b/vendor/github.com/gdamore/tcell/v2/style.go index 73995c0e4..86c071215 100644 --- a/vendor/github.com/gdamore/tcell/v2/style.go +++ b/vendor/github.com/gdamore/tcell/v2/style.go @@ -14,6 +14,11 @@ package tcell +import ( + "strings" + "unicode/utf8" +) + // Style represents a complete text style, including both foreground color, // background color, and additional attributes such as "bold" or "underline". // @@ -187,7 +192,7 @@ func (s Style) Attributes(attrs AttrMask) Style { // link to that Url. If the Url is empty, then this mode is turned off. func (s Style) Url(url string) Style { s2 := s - s2.url = url + s2.url = stripOSCControls(url) return s2 } @@ -197,6 +202,31 @@ func (s Style) Url(url string) Style { // were one Url, even if it spans multiple lines. func (s Style) UrlId(id string) Style { s2 := s - s2.urlId = "id=" + id + s2.urlId = "id=" + stripOSCControls(id) return s2 } + +func stripOSCControls(s string) string { + var b strings.Builder + b.Grow(len(s)) + for i := 0; i < len(s); { + r, size := utf8.DecodeRuneInString(s[i:]) + if r == utf8.RuneError && size == 1 { + c := s[i] + if c <= 0x1f || c == 0x7f || (c >= 0x80 && c <= 0x9f) { + i++ + continue + } + _ = b.WriteByte(c) + i++ + continue + } + if r <= 0x1f || r == 0x7f || (r >= 0x80 && r <= 0x9f) { + i += size + continue + } + b.WriteString(s[i : i+size]) + i += size + } + return b.String() +} diff --git a/vendor/github.com/gdamore/tcell/v2/tscreen.go b/vendor/github.com/gdamore/tcell/v2/tscreen.go index b4dfdf960..7dc7cdf81 100644 --- a/vendor/github.com/gdamore/tcell/v2/tscreen.go +++ b/vendor/github.com/gdamore/tcell/v2/tscreen.go @@ -622,7 +622,7 @@ func (t *tScreen) drawCell(x, y int) int { width = 1 str = " " } - if width > 1 { + if width > 1 && x+width < t.w { // Clobber over any content in the next cell. // This fixes a problem with some terminals where overwriting two // adjacent single cells with a wide rune would leave an image @@ -997,9 +997,14 @@ func (t *tScreen) buildAcsMap() { } func (t *tScreen) scanInput(buf *bytes.Buffer) { + // The end of the buffer isn't necessarily the end of the input, because + // large inputs are chunked. Set atEOF to false so the UTF-8 validating decoder + // returns ErrShortSrc instead of ErrInvalidUTF8 for incomplete multi-byte codepoints. + const atEOF = false + for buf.Len() > 0 { utf := make([]byte, min(8, max(buf.Len()*2, 128))) - nOut, nIn, e := t.decoder.Transform(utf, buf.Bytes(), true) + nOut, nIn, e := t.decoder.Transform(utf, buf.Bytes(), atEOF) _ = buf.Next(nIn) t.input.ScanUTF8(utf[:nOut]) if e == transform.ErrShortSrc { diff --git a/vendor/modules.txt b/vendor/modules.txt index cfd97a04a..dd56951ab 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -30,7 +30,7 @@ github.com/fxamacker/cbor/v2 # github.com/gdamore/encoding v1.0.1 ## explicit; go 1.9 github.com/gdamore/encoding -# github.com/gdamore/tcell/v2 v2.13.7 +# github.com/gdamore/tcell/v2 v2.13.9 ## explicit; go 1.24.0 github.com/gdamore/tcell/v2 github.com/gdamore/tcell/v2/terminfo