From bf260287d3fde776585a7a21bd8eb41b935d7300 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 06:35:30 +0000 Subject: [PATCH] Bump github.com/navidys/tvxwidgets from 0.11.1 to 0.12.1 Bumps [github.com/navidys/tvxwidgets](https://github.com/navidys/tvxwidgets) from 0.11.1 to 0.12.1. - [Release notes](https://github.com/navidys/tvxwidgets/releases) - [Commits](https://github.com/navidys/tvxwidgets/compare/v0.11.1...v0.12.1) --- updated-dependencies: - dependency-name: github.com/navidys/tvxwidgets dependency-version: 0.12.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 10 +- go.sum | 45 +-- .../github.com/gdamore/tcell/v2/.appveyor.yml | 13 - .../github.com/gdamore/tcell/v2/.travis.yml | 18 -- vendor/github.com/gdamore/tcell/v2/README.md | 80 +----- .../gdamore/tcell/v2/charset_plan9.go | 23 ++ .../gdamore/tcell/v2/charset_stub.go | 4 +- .../gdamore/tcell/v2/console_win.go | 41 ++- vendor/github.com/gdamore/tcell/v2/style.go | 10 + .../gdamore/tcell/v2/terminfo/base/base.go | 1 + vendor/github.com/gdamore/tcell/v2/tscreen.go | 6 +- .../gdamore/tcell/v2/tscreen_plan9.go | 36 +++ .../gdamore/tcell/v2/tscreen_stub.go | 4 +- .../github.com/gdamore/tcell/v2/tty_plan9.go | 270 ++++++++++++++++++ vendor/github.com/gdamore/tcell/v2/wscreen.go | 10 +- .../navidys/tvxwidgets/.golangci.yml | 48 ++-- vendor/github.com/navidys/tvxwidgets/Makefile | 2 +- .../github.com/navidys/tvxwidgets/barchart.go | 5 +- .../github.com/navidys/tvxwidgets/dialog.go | 7 +- .../github.com/navidys/tvxwidgets/gauge_am.go | 7 +- .../github.com/navidys/tvxwidgets/gauge_pm.go | 7 +- .../github.com/navidys/tvxwidgets/gauge_um.go | 17 +- vendor/github.com/navidys/tvxwidgets/plot.go | 21 +- .../navidys/tvxwidgets/sparkline.go | 6 +- .../github.com/navidys/tvxwidgets/spinner.go | 21 +- vendor/github.com/navidys/tvxwidgets/utils.go | 5 +- vendor/github.com/rivo/tview/README.md | 5 +- vendor/github.com/rivo/tview/ansi.go | 11 +- vendor/github.com/rivo/tview/application.go | 27 +- vendor/github.com/rivo/tview/box.go | 2 +- vendor/github.com/rivo/tview/doc.go | 2 +- vendor/github.com/rivo/tview/inputfield.go | 26 +- vendor/github.com/rivo/tview/pages.go | 17 +- vendor/github.com/rivo/tview/strings.go | 121 ++++---- vendor/github.com/rivo/tview/table.go | 6 +- vendor/modules.txt | 10 +- 36 files changed, 629 insertions(+), 315 deletions(-) delete mode 100644 vendor/github.com/gdamore/tcell/v2/.appveyor.yml delete mode 100644 vendor/github.com/gdamore/tcell/v2/.travis.yml create mode 100644 vendor/github.com/gdamore/tcell/v2/charset_plan9.go create mode 100644 vendor/github.com/gdamore/tcell/v2/tscreen_plan9.go create mode 100644 vendor/github.com/gdamore/tcell/v2/tty_plan9.go diff --git a/go.mod b/go.mod index 4c3745fd..9858e5bb 100644 --- a/go.mod +++ b/go.mod @@ -1,15 +1,13 @@ module github.com/netobserv/network-observability-cli -go 1.24.0 - -toolchain go1.24.4 +go 1.24.7 require ( - github.com/gdamore/tcell/v2 v2.8.1 + github.com/gdamore/tcell/v2 v2.9.0 github.com/gopacket/gopacket v1.4.0 github.com/jpillora/sizestr v1.0.0 github.com/mattn/go-sqlite3 v1.14.32 - github.com/navidys/tvxwidgets v0.11.1 + github.com/navidys/tvxwidgets v0.12.1 github.com/netobserv/flowlogs-pipeline v1.9.2-community github.com/netobserv/netobserv-ebpf-agent v1.9.2-community github.com/onsi/ginkgo/v2 v2.25.3 @@ -65,7 +63,7 @@ require ( github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.66.1 github.com/prometheus/procfs v0.16.1 // indirect - github.com/rivo/tview v0.0.0-20250501113434-0c592cd31026 + github.com/rivo/tview v0.42.0 github.com/rivo/uniseg v0.4.7 // indirect github.com/segmentio/kafka-go v0.4.49 // indirect github.com/spf13/pflag v1.0.9 // indirect diff --git a/go.sum b/go.sum index 92ca38d2..21ef0fd8 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.8.1 h1:KPNxyqclpWpWQlPLx6Xui1pMk8S+7+R37h3g07997NU= -github.com/gdamore/tcell/v2 v2.8.1/go.mod h1:bj8ori1BG3OYMjmb3IklZVWfZUJ1UBQt9JXrOCOhGWw= +github.com/gdamore/tcell/v2 v2.9.0 h1:N6t+eqK7/xwtRPwxzs1PXeRWnm0H9l02CrgJ7DLn1ys= +github.com/gdamore/tcell/v2 v2.9.0/go.mod h1:8/ZoqM9rxzYphT9tH/9LnunhV9oPBqwS8WHGYm5nrmo= github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= @@ -63,7 +63,6 @@ github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/gnostic-models v0.7.0 h1:qwTtogB15McXDaNqTZdzPJRHvaVJlAl+HVQnLmJEJxo= github.com/google/gnostic-models v0.7.0/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -121,8 +120,8 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/navidys/tvxwidgets v0.11.1 h1:H/H3IdD1bxRoDt6yPl8/I2ZG+dGARMao7nK7kYnprxc= -github.com/navidys/tvxwidgets v0.11.1/go.mod h1:3Pdk7b/8myzGTediDaeaG5i4Nv+ozVoPtorU3Ihcx9M= +github.com/navidys/tvxwidgets v0.12.1 h1:/5yJf/0MPlg50VKnaAfnRF1sBMPos/Aeb9tY0/UXJ3M= +github.com/navidys/tvxwidgets v0.12.1/go.mod h1:3EQbBvdokrZsEjnXKfOdcYAQk4dZIQSfmTJPxQbBE9A= github.com/netobserv/flowlogs-pipeline v1.9.2-community h1:RYwbuxFCghfTyufn1QiSo2TPWeb69pg2SvQorglwFnc= github.com/netobserv/flowlogs-pipeline v1.9.2-community/go.mod h1:shv+KbOGiM2IYWPQWjVOcuaXu/y/ZdBIem59wLAVQ/M= github.com/netobserv/netobserv-ebpf-agent v1.9.2-community h1:ghW16OO4QRWj0Uh1gMYX+NjAlgx2sZmCsO3Tkwoj4Do= @@ -156,10 +155,9 @@ github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9Z github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA= github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg= github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is= -github.com/rivo/tview v0.0.0-20250501113434-0c592cd31026 h1:ij8h8B3psk3LdMlqkfPTKIzeGzTaZLOiyplILMlxPAM= -github.com/rivo/tview v0.0.0-20250501113434-0c592cd31026/go.mod h1:02iFIz7K/A9jGCvrizLPvoqr4cEIx7q54RH5Qudkrss= +github.com/rivo/tview v0.42.0 h1:b/ftp+RxtDsHSaynXTbJb+/n/BxDEi+W3UfF5jILK6c= +github.com/rivo/tview v0.42.0/go.mod h1:cSfIYfhpSGCjp3r/ECJb+GKS7cGJnqV8vfjQPwoXyfY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= @@ -245,16 +243,10 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -262,10 +254,6 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= @@ -275,10 +263,6 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -288,22 +272,11 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4= golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -311,11 +284,7 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0= @@ -326,8 +295,6 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/vendor/github.com/gdamore/tcell/v2/.appveyor.yml b/vendor/github.com/gdamore/tcell/v2/.appveyor.yml deleted file mode 100644 index 435dfe3a..00000000 --- a/vendor/github.com/gdamore/tcell/v2/.appveyor.yml +++ /dev/null @@ -1,13 +0,0 @@ -version: 1.0.{build} -clone_folder: c:\gopath\src\github.com\gdamore\tcell -environment: - GOPATH: c:\gopath -build_script: -- go version -- go env -- SET PATH=%LOCALAPPDATA%\atom\bin;%GOPATH%\bin;%PATH% -- go get -t ./... -- go build -- go install ./... -test_script: -- go test ./... diff --git a/vendor/github.com/gdamore/tcell/v2/.travis.yml b/vendor/github.com/gdamore/tcell/v2/.travis.yml deleted file mode 100644 index 967b5b33..00000000 --- a/vendor/github.com/gdamore/tcell/v2/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: go - -go: - - 1.15.x - - master - -arch: - - amd64 - - ppc64le - -before_install: - - go get -t -v ./... - -script: - - go test -race -coverprofile=coverage.txt -covermode=atomic - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/gdamore/tcell/v2/README.md b/vendor/github.com/gdamore/tcell/v2/README.md index 8f5a7af5..93ceb845 100644 --- a/vendor/github.com/gdamore/tcell/v2/README.md +++ b/vendor/github.com/gdamore/tcell/v2/README.md @@ -7,12 +7,14 @@ It was inspired by _termbox_, but includes many additional improvements. [![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua) [![Linux](https://img.shields.io/github/actions/workflow/status/gdamore/tcell/linux.yml?branch=main&logoColor=grey&logo=linux&label=)](https://github.com/gdamore/tcell/actions/workflows/linux.yml) -[![Windows](https://img.shields.io/github/actions/workflow/status/gdamore/tcell/windows.yml?branch=main&logoColor=grey&logo=windows&label=)](https://github.com/gdamore/tcell/actions/workflows/windows.yml) +[![Windows](https://img.shields.io/github/actions/workflow/status/gdamore/tcell/windows.yml?branch=main&logoColor=grey&label=Windows)](https://github.com/gdamore/tcell/actions/workflows/windows.yml) +[![Web Assembly](https://img.shields.io/github/actions/workflow/status/gdamore/tcell/webasm.yml?branch=main&logoColor=grey&logo=webassembly&label=)](https://github.com/gdamore/tcell/actions/workflows/webasm.yml) [![Apache License](https://img.shields.io/github/license/gdamore/tcell.svg?logoColor=silver&logo=opensourceinitiative&color=blue&label=)](https://github.com/gdamore/tcell/blob/master/LICENSE) [![Docs](https://img.shields.io/badge/godoc-reference-blue.svg?label=&logo=go)](https://pkg.go.dev/github.com/gdamore/tcell/v2) [![Discord](https://img.shields.io/discord/639503822733180969?label=&logo=discord)](https://discord.gg/urTTxDN) [![Coverage](https://img.shields.io/codecov/c/github/gdamore/tcell?logoColor=grey&logo=codecov&label=)](https://codecov.io/gh/gdamore/tcell) [![Go Report Card](https://goreportcard.com/badge/github.com/gdamore/tcell/v2)](https://goreportcard.com/report/github.com/gdamore/tcell/v2) +[![Latest Release](https://img.shields.io/github/v/release/gdamore/tcell.svg?logo=github&label=)](https://github.com/gdamore/tcell/releases) Please see [here](UKRAINE.md) for an important message for the people of Russia. @@ -25,50 +27,9 @@ A brief, and still somewhat rough, [tutorial](TUTORIAL.md) is available. ## Examples -- [proxima5](https://github.com/gdamore/proxima5) - space shooter ([video](https://youtu.be/jNxKTCmY_bQ)) -- [govisor](https://github.com/gdamore/govisor) - service management UI ([screenshot](http://2.bp.blogspot.com/--OsvnfzSNow/Vf7aqMw3zXI/AAAAAAAAARo/uOMtOvw4Sbg/s1600/Screen%2BShot%2B2015-09-20%2Bat%2B9.08.41%2BAM.png)) -- mouse demo - included mouse test ([screenshot](http://2.bp.blogspot.com/-fWvW5opT0es/VhIdItdKqJI/AAAAAAAAATE/7Ojc0L1SpB0/s1600/Screen%2BShot%2B2015-10-04%2Bat%2B11.47.13%2BPM.png)) -- [gomatrix](https://github.com/gdamore/gomatrix) - converted from Termbox -- [micro](https://github.com/zyedidia/micro/) - lightweight text editor with syntax-highlighting and themes -- [godu](https://github.com/viktomas/godu) - utility to discover large files/folders -- [tview](https://github.com/rivo/tview/) - rich interactive widgets -- [cview](https://code.rocketnine.space/tslocum/cview) - user interface toolkit (fork of _tview_) -- [awesome gocui](https://github.com/awesome-gocui/gocui) - Go Console User Interface -- [gomandelbrot](https://github.com/rgm3/gomandelbrot) - Mandelbrot! -- [WTF](https://github.com/senorprogrammer/wtf) - personal information dashboard -- [browsh](https://github.com/browsh-org/browsh) - modern web browser ([video](https://www.youtube.com/watch?v=HZq86XfBoRo)) -- [go-life](https://github.com/sachaos/go-life) - Conway's Game of Life -- [gowid](https://github.com/gcla/gowid) - compositional widgets for terminal UIs, inspired by _urwid_ -- [termshark](https://termshark.io) - interface for _tshark_, inspired by Wireshark, built on _gowid_ -- [go-tetris](https://github.com/MichaelS11/go-tetris) - Go Tetris with AI option -- [fzf](https://github.com/junegunn/fzf) - command-line fuzzy finder -- [ascii-fluid](https://github.com/esimov/ascii-fluid) - fluid simulation controlled by webcam -- [cbind](https://code.rocketnine.space/tslocum/cbind) - key event encoding, decoding and handling -- [tpong](https://github.com/spinzed/tpong) - old-school Pong -- [aerc](https://git.sr.ht/~sircmpwn/aerc) - email client -- [tblogs](https://github.com/ezeoleaf/tblogs) - development blogs reader -- [spinc](https://github.com/lallassu/spinc) - _irssi_ inspired chat application for Cisco Spark/WebEx -- [gorss](https://github.com/lallassu/gorss) - RSS/Atom feed reader -- [memoryalike](https://github.com/Bios-Marcel/memoryalike) - memorization game -- [lf](https://github.com/gokcehan/lf) - file manager -- [goful](https://github.com/anmitsu/goful) - CUI file manager -- [gokeybr](https://github.com/bunyk/gokeybr) - deliberately practice your typing -- [gonano](https://github.com/jbaramidze/gonano) - editor, mimics _nano_ -- [uchess](https://github.com/tmountain/uchess) - UCI chess client -- [min](https://github.com/a-h/min) - Gemini browser -- [ov](https://github.com/noborus/ov) - file pager -- [tmux-wormhole](https://github.com/gcla/tmux-wormhole) - _tmux_ plugin to transfer files -- [gruid-tcell](https://github.com/anaseto/gruid-tcell) - driver for the grid based UI and game framework -- [aretext](https://github.com/aretext/aretext) - minimalist text editor with _vim_ key bindings -- [sync](https://github.com/kyprifog/sync) - GitHub repo synchronization tool -- [statusbar](https://github.com/kyprifog/statusbar) - statusbar motivation tool for tracking periodic tasks/goals -- [todo](https://github.com/kyprifog/todo) - simple todo app -- [gosnakego](https://github.com/liweiyi88/gosnakego) - a snake game -- [gbb](https://github.com/sdemingo/gbb) - A classical bulletin board app for tildes or public unix servers -- [lil](https://github.com/andrievsky/lil) - A simple and flexible interface for any service by implementing only list and get operations -- [hero.go](https://github.com/barisbll/hero.go) - 2d monster shooter ([video](https://user-images.githubusercontent.com/40062673/277157369-240d7606-b471-4aa1-8c54-4379a513122b.mp4)) -- [go-tetris](https://github.com/aaronriekenberg/go-tetris) - simple tetris game for native terminal and WASM using github actions+pages -- [oddshub](https://github.com/dos-2/oddshub) - A TUI designed for analyzing sports betting odds +A number of example are posted up on our [Gallery](https://github.com/gdamore/tcell/wikis/Gallery/). + +Let us know if you want to add your masterpiece to the list! ## Pure Go Terminfo Database @@ -85,6 +46,11 @@ _Tcell_ is portable to a wide variety of systems, and is pure Go, without any need for CGO. _Tcell_ is believed to work with mainstream systems officially supported by golang. +Following the Go support policy, _Tcell_ officially only supports the current ("stable") version of go, +and the version immediately prior ("oldstable"). This policy is necessary to make sure that we can +update dependencies to pick up security fixes and new features, and it allows us to adopt changes +(such as library and language features) that are only supported in newer versions of Go. + ## No Async IO _Tcell_ is able to operate without requiring `SIGIO` signals (unlike _termbox_), @@ -117,11 +83,6 @@ _Tcell_ will respect your terminal's color space as specified within your termin For example attempts to emit color sequences on VT100 terminals won't result in unintended consequences. -In legacy Windows mode, _Tcell_ supports 16 colors, bold, dim, and reverse, -instead of just termbox's 8 colors with reverse. (Note that there is some -conflation with bold/dim and colors.) -Modern Windows 10 can benefit from much richer colors however. - _Tcell_ maps 16 colors down to 8, for terminals that need it. (The upper 8 colors are just brighter versions of the lower 8.) @@ -130,10 +91,6 @@ _Tcell_ maps 16 colors down to 8, for terminals that need it. _Tcell_ supports enhanced mouse tracking mode, so your application can receive regular mouse motion events, and wheel events, if your terminal supports it. -(Note: The Windows 10 Terminal application suffers from a flaw in this regard, -and does not support mouse interaction. The stock Windows 10 console host -fired up with cmd.exe or PowerShell works fine however.) - ## _Termbox_ Compatibility A compatibility layer for _termbox_ is provided in the `compat` directory. @@ -159,9 +116,6 @@ taken in the application to avoid explicitly attempting to set content in the next cell, otherwise the results are undefined. (Normally the wide character is displayed, and the other character is not; do not depend on that behavior.) -Older terminal applications (especially on systems like Windows 8) lack support -for advanced Unicode, and thus may not fare well. - ## Colors _Tcell_ assumes the ANSI/XTerm color model, including the 256 color map that @@ -265,22 +219,16 @@ platforms (e.g., AIX) may need to be added. Pull requests are welcome! Windows console mode applications are supported. -Modern console applications like ConEmu and the Windows 10 terminal, +Modern console applications like ConEmu and the Windows Terminal, support all the good features (resize, mouse tracking, etc.) ### WASM WASM is supported, but needs additional setup detailed in [README-wasm](README-wasm.md). -### Plan9 and others - -These platforms won't work, but compilation stubs are supplied -for folks that want to include parts of this in software for those -platforms. The Simulation screen works, but as _Tcell_ doesn't know how to -allocate a real screen object on those platforms, `NewScreen()` will fail. +### Plan9 and its variants -If anyone has wisdom about how to improve support for these, -please let me know. PRs are especially welcome. +Plan 9 is supported on a limited basis. The Plan 9 backend opens `/dev/cons` for I/O, enables raw mode by writing `rawon`/`rawoff` to `/dev/consctl`, watches `/dev/wctl` for resize notifications, and then constructs a **terminfo-backed** `Screen` (so `NewScreen` works as on other platforms). Typical usage is inside `vt(1)` with `TERM=vt100`. Expect **monochrome text** and **no mouse reporting** under stock `vt(1)` (it generally does not emit ANSI color or xterm mouse sequences). If a Plan 9 terminal supplies ANSI color escape sequences and xterm-style mouse reporting, color can be picked up via **terminfo** and mouse support could be added by wiring those sequences into the Plan 9 TTY path; contributions that improve terminal detection and broaden feature support are welcome. ### Commercial Support diff --git a/vendor/github.com/gdamore/tcell/v2/charset_plan9.go b/vendor/github.com/gdamore/tcell/v2/charset_plan9.go new file mode 100644 index 00000000..959d181e --- /dev/null +++ b/vendor/github.com/gdamore/tcell/v2/charset_plan9.go @@ -0,0 +1,23 @@ +//go:build plan9 +// +build plan9 + +// Copyright 2025 The TCell Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use file except in compliance with the License. +// You may obtain a copy of the license at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tcell + +// Plan 9 uses UTF-8 system-wide, so we return "UTF-8" unconditionally. +func getCharset() string { + return "UTF-8" +} diff --git a/vendor/github.com/gdamore/tcell/v2/charset_stub.go b/vendor/github.com/gdamore/tcell/v2/charset_stub.go index ec4d260d..829be2c2 100644 --- a/vendor/github.com/gdamore/tcell/v2/charset_stub.go +++ b/vendor/github.com/gdamore/tcell/v2/charset_stub.go @@ -1,5 +1,5 @@ -//go:build plan9 || nacl -// +build plan9 nacl +//go:build nacl +// +build nacl // Copyright 2015 The TCell Authors // diff --git a/vendor/github.com/gdamore/tcell/v2/console_win.go b/vendor/github.com/gdamore/tcell/v2/console_win.go index 78077175..a46f3c31 100644 --- a/vendor/github.com/gdamore/tcell/v2/console_win.go +++ b/vendor/github.com/gdamore/tcell/v2/console_win.go @@ -655,25 +655,28 @@ var vkKeys = map[uint16]Key{ func getu32(v []byte) uint32 { return uint32(v[0]) + (uint32(v[1]) << 8) + (uint32(v[2]) << 16) + (uint32(v[3]) << 24) } + func geti32(v []byte) int32 { return int32(getu32(v)) } + func getu16(v []byte) uint16 { return uint16(v[0]) + (uint16(v[1]) << 8) } + func geti16(v []byte) int16 { return int16(getu16(v)) } // Convert windows dwControlKeyState to modifier mask -func mod2mask(cks uint32) ModMask { +func mod2mask(cks uint32, filter_ctrl_alt bool) ModMask { mm := ModNone // Left or right control ctrl := (cks & (0x0008 | 0x0004)) != 0 // Left or right alt alt := (cks & (0x0002 | 0x0001)) != 0 // Filter out ctrl+alt (it means AltGr) - if !(ctrl && alt) { + if !filter_ctrl_alt || !(ctrl && alt) { if ctrl { mm |= ModCtrl } @@ -788,10 +791,10 @@ func (s *cScreen) getConsoleInput() error { // synthesized key code for krec.repeat > 0 { // convert shift+tab to backtab - if mod2mask(krec.mod) == ModShift && krec.ch == vkTab { + if mod2mask(krec.mod, false) == ModShift && krec.ch == vkTab { s.postEvent(NewEventKey(KeyBacktab, 0, ModNone)) } else { - s.postEvent(NewEventKey(KeyRune, rune(krec.ch), mod2mask(krec.mod))) + s.postEvent(NewEventKey(KeyRune, rune(krec.ch), mod2mask(krec.mod, true))) } krec.repeat-- } @@ -803,7 +806,7 @@ func (s *cScreen) getConsoleInput() error { return nil } for krec.repeat > 0 { - s.postEvent(NewEventKey(key, rune(krec.ch), mod2mask(krec.mod))) + s.postEvent(NewEventKey(key, rune(krec.ch), mod2mask(krec.mod, false))) krec.repeat-- } @@ -816,7 +819,7 @@ func (s *cScreen) getConsoleInput() error { mrec.flags = getu32(rec.data[12:]) btns := mrec2btns(mrec.btns, mrec.flags) // we ignore double click, events are delivered normally - s.postEvent(NewEventMouse(int(mrec.x), int(mrec.y), btns, mod2mask(mrec.mod))) + s.postEvent(NewEventMouse(int(mrec.x), int(mrec.y), btns, mod2mask(mrec.mod, false))) case resizeEvent: var rrec resizeRecord @@ -938,7 +941,7 @@ func (s *cScreen) mapStyle(style Style) uint16 { return attr } -func (s *cScreen) sendVtStyle(style Style) { +func (s *cScreen) makeVtStyle(style Style) string { esc := &strings.Builder{} fg, bg, attrs := style.fg, style.bg, style.attrs @@ -998,30 +1001,40 @@ func (s *cScreen) sendVtStyle(style Style) { esc.WriteString(vtExitUrl) } - s.emitVtString(esc.String()) + return esc.String() } -func (s *cScreen) writeString(x, y int, style Style, ch []uint16) { +func (s *cScreen) sendVtStyle(style Style) { + s.emitVtString(s.makeVtStyle(style)) +} + +func (s *cScreen) writeString(x, y int, style Style, vtBuf, ch []uint16) { // we assume the caller has hidden the cursor if len(ch) == 0 { return } - s.setCursorPos(x, y, s.vten) if s.vten { - s.sendVtStyle(style) + vtBuf = append(vtBuf, utf16.Encode([]rune(fmt.Sprintf(vtCursorPos, y+1, x+1)))...) + styleStr := s.makeVtStyle(style) + vtBuf = append(vtBuf, utf16.Encode([]rune(styleStr))...) + vtBuf = append(vtBuf, ch...) + _ = syscall.WriteConsole(s.out, &vtBuf[0], uint32(len(vtBuf)), nil, nil) + vtBuf = vtBuf[:0] } else { + s.setCursorPos(x, y, s.vten) _, _, _ = procSetConsoleTextAttribute.Call( uintptr(s.out), uintptr(s.mapStyle(style))) + _ = syscall.WriteConsole(s.out, &ch[0], uint32(len(ch)), nil, nil) } - _ = syscall.WriteConsole(s.out, &ch[0], uint32(len(ch)), nil, nil) } func (s *cScreen) draw() { // allocate a scratch line bit enough for no combining chars. // if you have combining characters, you may pay for extra allocations. buf := make([]uint16, 0, s.w) + var vtBuf []uint16 wcs := buf[:] lstyle := styleInvalid @@ -1040,7 +1053,7 @@ func (s *cScreen) draw() { // write out any data queued thus far // because we are going to skip over some // cells, or because we need to change styles - s.writeString(lx, ly, lstyle, wcs) + s.writeString(lx, ly, lstyle, vtBuf, wcs) wcs = buf[0:0] lstyle = StyleDefault if !dirty { @@ -1067,7 +1080,7 @@ func (s *cScreen) draw() { } x += width - 1 } - s.writeString(lx, ly, lstyle, wcs) + s.writeString(lx, ly, lstyle, vtBuf, wcs) wcs = buf[0:0] lstyle = styleInvalid } diff --git a/vendor/github.com/gdamore/tcell/v2/style.go b/vendor/github.com/gdamore/tcell/v2/style.go index 14d05b15..73995c0e 100644 --- a/vendor/github.com/gdamore/tcell/v2/style.go +++ b/vendor/github.com/gdamore/tcell/v2/style.go @@ -164,6 +164,16 @@ func (s Style) Underline(params ...interface{}) Style { return s2 } +// GetUnderlineStyle returns the underline style for the style. +func (s Style) GetUnderlineStyle() UnderlineStyle { + return s.ulStyle +} + +// GetUnderlineColor returns the underline color for the style. +func (s Style) GetUnderlineColor() Color { + return s.ulColor +} + // Attributes returns a new style based on s, with its attributes set as // specified. func (s Style) Attributes(attrs AttrMask) Style { diff --git a/vendor/github.com/gdamore/tcell/v2/terminfo/base/base.go b/vendor/github.com/gdamore/tcell/v2/terminfo/base/base.go index d54a381f..75aeb15f 100644 --- a/vendor/github.com/gdamore/tcell/v2/terminfo/base/base.go +++ b/vendor/github.com/gdamore/tcell/v2/terminfo/base/base.go @@ -25,6 +25,7 @@ import ( // The following imports just register themselves -- // these are the terminal types we aggregate in this package. _ "github.com/gdamore/tcell/v2/terminfo/a/ansi" + _ "github.com/gdamore/tcell/v2/terminfo/t/tmux" _ "github.com/gdamore/tcell/v2/terminfo/v/vt100" _ "github.com/gdamore/tcell/v2/terminfo/v/vt102" _ "github.com/gdamore/tcell/v2/terminfo/v/vt220" diff --git a/vendor/github.com/gdamore/tcell/v2/tscreen.go b/vendor/github.com/gdamore/tcell/v2/tscreen.go index 962aa9f4..2c1d32d3 100644 --- a/vendor/github.com/gdamore/tcell/v2/tscreen.go +++ b/vendor/github.com/gdamore/tcell/v2/tscreen.go @@ -898,7 +898,7 @@ func (t *tScreen) drawCell(x, y int) int { } // URL string can be long, so don't send it unless we really need to - if t.enterUrl != "" && t.curstyle != style { + if t.enterUrl != "" && t.curstyle.url != style.url { if style.url != "" { t.TPuts(ti.TParm(t.enterUrl, style.url, style.urlId)) } else { @@ -1339,6 +1339,10 @@ func (t *tScreen) buildMouseEvent(x, y, btn int) *EventMouse { button = WheelUp case 0x41: button = WheelDown + case 0x42: + button = WheelLeft + case 0x43: + button = WheelRight } if btn&0x4 != 0 { diff --git a/vendor/github.com/gdamore/tcell/v2/tscreen_plan9.go b/vendor/github.com/gdamore/tcell/v2/tscreen_plan9.go new file mode 100644 index 00000000..fdd55b8c --- /dev/null +++ b/vendor/github.com/gdamore/tcell/v2/tscreen_plan9.go @@ -0,0 +1,36 @@ +//go:build plan9 +// +build plan9 + +// Copyright 2025 The TCell Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use file except in compliance with the License. +// You may obtain a copy of the license at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tcell + +import "os" + +// initialize on Plan 9: if no TTY was provided, use the Plan 9 TTY. +func (t *tScreen) initialize() error { + if os.Getenv("TERM") == "" { + // TERM should be "vt100" in a vt(1) window; color/mouse support will be limited. + _ = os.Setenv("TERM", "vt100") + } + if t.tty == nil { + tty, err := NewDevTty() + if err != nil { + return err + } + t.tty = tty + } + return nil +} diff --git a/vendor/github.com/gdamore/tcell/v2/tscreen_stub.go b/vendor/github.com/gdamore/tcell/v2/tscreen_stub.go index 0e4deae0..5d0649dd 100644 --- a/vendor/github.com/gdamore/tcell/v2/tscreen_stub.go +++ b/vendor/github.com/gdamore/tcell/v2/tscreen_stub.go @@ -1,5 +1,5 @@ -//go:build plan9 || windows -// +build plan9 windows +//go:build windows +// +build windows // Copyright 2022 The TCell Authors // diff --git a/vendor/github.com/gdamore/tcell/v2/tty_plan9.go b/vendor/github.com/gdamore/tcell/v2/tty_plan9.go new file mode 100644 index 00000000..6c99ee6d --- /dev/null +++ b/vendor/github.com/gdamore/tcell/v2/tty_plan9.go @@ -0,0 +1,270 @@ +//go:build plan9 +// +build plan9 + +// Copyright 2025 The TCell Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use file except in compliance with the License. +// You may obtain a copy of the license at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tcell + +import ( + "bufio" + "errors" + "fmt" + "io" + "os" + "strconv" + "strings" + "sync" + "sync/atomic" +) + +// p9Tty implements tcell.Tty using Plan 9's /dev/cons and /dev/consctl. +// Raw mode is enabled by writing "rawon" to /dev/consctl while the fd stays open. +// Resize notifications are read from /dev/wctl: the first read returns geometry, +// subsequent reads block until the window changes (rio(4)). +// +// References: +// - kbdfs(8): cons/consctl rawon|rawoff semantics +// - rio(4): wctl geometry and blocking-on-change behavior +// - vt(1): VT100 emulator typically used for TUI programs on Plan 9 +// +// Limitations: +// - We assume VT100-level capabilities (often no colors, no mouse). +// - Window size is conservative: we return 80x24 unless overridden. +// Set LINES/COLUMNS (or TCELL_LINES/TCELL_COLS) to refine. +// - Mouse and bracketed paste are not wired; terminfo/xterm queries +// are not attempted because vt(1) may not support them. +type p9Tty struct { + cons *os.File // /dev/cons (read+write) + consctl *os.File // /dev/consctl (write "rawon"/"rawoff") + wctl *os.File // /dev/wctl (resize notifications) + + // protect close/stop; Read/Write are serialized by os.File + mu sync.Mutex + closed atomic.Bool + + // resize callback + onResize atomic.Value // func() + wg sync.WaitGroup + stopCh chan struct{} +} + +func NewDevTty() (Tty, error) { // tcell signature + return newPlan9TTY() +} + +func NewStdIoTty() (Tty, error) { // also required by tcell + // On Plan 9 there is no POSIX tty discipline on stdin/stdout; + // use /dev/cons explicitly for robustness. + return newPlan9TTY() +} + +func NewDevTtyFromDev(_ string) (Tty, error) { // required by tcell + // Plan 9 does not have multiple "ttys" in the POSIX sense; + // always bind to /dev/cons and /dev/consctl. + return newPlan9TTY() +} + +func newPlan9TTY() (Tty, error) { + cons, err := os.OpenFile("/dev/cons", os.O_RDWR, 0) + if err != nil { + return nil, fmt.Errorf("open /dev/cons: %w", err) + } + consctl, err := os.OpenFile("/dev/consctl", os.O_WRONLY, 0) + if err != nil { + _ = cons.Close() + return nil, fmt.Errorf("open /dev/consctl: %w", err) + } + // /dev/wctl may not exist (console without rio); best-effort. + wctl, _ := os.OpenFile("/dev/wctl", os.O_RDWR, 0) + + t := &p9Tty{ + cons: cons, + consctl: consctl, + wctl: wctl, + stopCh: make(chan struct{}), + } + return t, nil +} + +func (t *p9Tty) Start() error { + t.mu.Lock() + defer t.mu.Unlock() + + if t.closed.Load() { + return errors.New("tty closed") + } + + // Recreate stop channel if absent or closed (supports resume). + if t.stopCh == nil || isClosed(t.stopCh) { + t.stopCh = make(chan struct{}) + } + + // Put console into raw mode; remains active while consctl is open. + if _, err := t.consctl.Write([]byte("rawon")); err != nil { + return fmt.Errorf("enable raw mode: %w", err) + } + + // Reopen /dev/wctl on resume; best-effort (system console may lack it). + if t.wctl == nil { + if f, err := os.OpenFile("/dev/wctl", os.O_RDWR, 0); err == nil { + t.wctl = f + } + } + + if t.wctl != nil { + t.wg.Add(1) + go t.watchResize() + } + return nil +} + +func (t *p9Tty) Drain() error { + // Per tcell docs, this may reasonably be a no-op on non-POSIX ttys. + // Read deadlines are not available on plan9 os.File; we rely on Stop(). + return nil +} + +func (t *p9Tty) Stop() error { + t.mu.Lock() + defer t.mu.Unlock() + + // Signal watcher to stop (if not already). + if t.stopCh != nil && !isClosed(t.stopCh) { + close(t.stopCh) + } + + // Exit raw mode first. + _, _ = t.consctl.Write([]byte("rawoff")) + + // Closing wctl unblocks watchResize; nil it so Start() can reopen later. + if t.wctl != nil { + _ = t.wctl.Close() + t.wctl = nil + } + + // Ensure watcher goroutine has exited before returning. + t.wg.Wait() + return nil +} + +func (t *p9Tty) Close() error { + t.mu.Lock() + defer t.mu.Unlock() + + if t.closed.Swap(true) { + return nil + } + + if t.stopCh != nil && !isClosed(t.stopCh) { + close(t.stopCh) + } + _, _ = t.consctl.Write([]byte("rawoff")) + + _ = t.cons.Close() + _ = t.consctl.Close() + if t.wctl != nil { + _ = t.wctl.Close() + t.wctl = nil + } + + t.wg.Wait() + return nil +} + +func (t *p9Tty) Read(p []byte) (int, error) { + return t.cons.Read(p) +} + +func (t *p9Tty) Write(p []byte) (int, error) { + return t.cons.Write(p) +} + +func (t *p9Tty) NotifyResize(cb func()) { + if cb == nil { + t.onResize.Store((func())(nil)) + return + } + t.onResize.Store(cb) +} + +func (t *p9Tty) WindowSize() (WindowSize, error) { + // Strategy: + // 1) honor explicit overrides (TCELL_LINES/TCELL_COLS, LINES/COLUMNS), + // 2) otherwise return conservative 80x24. + // Reading /dev/wctl gives pixel geometry, but char cell metrics are + // not generally available to non-draw clients; vt(1) is fixed-cell. + lines, cols := envInt("TCELL_LINES"), envInt("TCELL_COLS") + if lines == 0 { + lines = envInt("LINES") + } + if cols == 0 { + cols = envInt("COLUMNS") + } + if lines <= 0 { + lines = 24 + } + if cols <= 0 { + cols = 80 + } + return WindowSize{Width: cols, Height: lines}, nil +} + +// watchResize blocks on /dev/wctl reads; each read returns when the window +// changes size/position/state, per rio(4). We ignore the parsed geometry and +// just notify tcell to re-query WindowSize(). +func (t *p9Tty) watchResize() { + defer t.wg.Done() + + r := bufio.NewReader(t.wctl) + for { + select { + case <-t.stopCh: + return + default: + } + // Each read delivers something like: + // " minx miny maxx maxy visible current\n" + // We don't need to parse here; just signal. + _, err := r.ReadString('\n') + if err != nil { + if errors.Is(err, io.EOF) { + return + } + // transient errors: continue + } + if cb, _ := t.onResize.Load().(func()); cb != nil { + cb() + } + } +} + +func envInt(name string) int { + if s := strings.TrimSpace(os.Getenv(name)); s != "" { + if v, err := strconv.Atoi(s); err == nil { + return v + } + } + return 0 +} + +// helper: safe check if a channel is closed +func isClosed(ch <-chan struct{}) bool { + select { + case <-ch: + return true + default: + return false + } +} diff --git a/vendor/github.com/gdamore/tcell/v2/wscreen.go b/vendor/github.com/gdamore/tcell/v2/wscreen.go index 8f66079e..44734c27 100644 --- a/vendor/github.com/gdamore/tcell/v2/wscreen.go +++ b/vendor/github.com/gdamore/tcell/v2/wscreen.go @@ -1,4 +1,4 @@ -// Copyright 2024 The TCell Authors +// Copyright 2025 The TCell Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use file except in compliance with the License. @@ -145,7 +145,7 @@ func (t *wScreen) drawCell(x, y int) int { s := "" if len(combc) > 0 { - b := make([]rune, 0, 1 + len(combc)) + b := make([]rune, 0, 1+len(combc)) b = append(b, mainc) b = append(b, combc...) s = string(b) @@ -277,6 +277,12 @@ func (t *wScreen) DisableFocus() { t.Unlock() } +func (s *wScreen) GetClipboard() { +} + +func (s *wScreen) SetClipboard(_ []byte) { +} + func (t *wScreen) Size() (int, int) { t.Lock() w, h := t.w, t.h diff --git a/vendor/github.com/navidys/tvxwidgets/.golangci.yml b/vendor/github.com/navidys/tvxwidgets/.golangci.yml index e4c4fbb1..7a6a3c87 100644 --- a/vendor/github.com/navidys/tvxwidgets/.golangci.yml +++ b/vendor/github.com/navidys/tvxwidgets/.golangci.yml @@ -1,26 +1,36 @@ +version: "2" run: - timeout: 10m - deadline: 5m + modules-download-mode: readonly + +formatters: + enable: + - gofmt + - goimports + exclusions: + generated: disable + linters: - enable-all: true + default: all disable: - varnamelen - exhaustruct - depguard - # deprecated - - tenv - - rowserrcheck - - wastedassign -linters-settings: - errcheck: - check-blank: false - exclude-functions: - - fmt:.* - nolintlint: - require-specific: true - + - wsl + settings: + errcheck: + check-blank: false + exclude-functions: + - fmt:.* + nolintlint: + require-specific: true + revive: + rules: + - name: package-comments + disabled: true + exclusions: + paths: + - demos + - ".*_test.go" issues: - exclude-dirs: - - demos - exclude-files: - - ".*_test.go" + max-issues-per-linter: 0 + max-same-issues: 0 diff --git a/vendor/github.com/navidys/tvxwidgets/Makefile b/vendor/github.com/navidys/tvxwidgets/Makefile index e15182f5..9d532d9e 100644 --- a/vendor/github.com/navidys/tvxwidgets/Makefile +++ b/vendor/github.com/navidys/tvxwidgets/Makefile @@ -32,7 +32,7 @@ install.tools: .install.pre-commit .install.codespell .install.golangci-lint .in .PHONY: .install.golangci-lint .install.golangci-lint: - VERSION=1.64.4 ./hack/install_golangci.sh + VERSION=2.3.1 ./hack/install_golangci.sh #================================================= # Testing (units, functionality, ...) targets diff --git a/vendor/github.com/navidys/tvxwidgets/barchart.go b/vendor/github.com/navidys/tvxwidgets/barchart.go index 815e0b7d..4af011e2 100644 --- a/vendor/github.com/navidys/tvxwidgets/barchart.go +++ b/vendor/github.com/navidys/tvxwidgets/barchart.go @@ -23,6 +23,7 @@ type BarChartItem struct { // BarChart represents bar chart primitive. type BarChart struct { *tview.Box + // bar items bars []BarChartItem // maximum value of bars @@ -62,9 +63,9 @@ func (c *BarChart) HasFocus() bool { // Draw draws this primitive onto the screen. func (c *BarChart) Draw(screen tcell.Screen) { //nolint:funlen,cyclop - c.Box.DrawForSubclass(screen, c) + c.DrawForSubclass(screen, c) - x, y, width, height := c.Box.GetInnerRect() + x, y, width, height := c.GetInnerRect() maxValY := y + 1 xAxisStartY := y + height - 2 //nolint:mnd diff --git a/vendor/github.com/navidys/tvxwidgets/dialog.go b/vendor/github.com/navidys/tvxwidgets/dialog.go index a9a65350..8827910a 100644 --- a/vendor/github.com/navidys/tvxwidgets/dialog.go +++ b/vendor/github.com/navidys/tvxwidgets/dialog.go @@ -16,6 +16,7 @@ const ( // MessageDialog represents message dialog primitive. type MessageDialog struct { *tview.Box + // layout message dialog layout layout *tview.Flex // message view @@ -122,8 +123,8 @@ func (d *MessageDialog) SetTextColor(color tcell.Color) { // Draw draws this primitive onto the screen. func (d *MessageDialog) Draw(screen tcell.Screen) { - d.Box.DrawForSubclass(screen, d) - x, y, width, height := d.Box.GetInnerRect() + d.DrawForSubclass(screen, d) + x, y, width, height := d.GetInnerRect() d.layout.SetRect(x, y, width, height) d.layout.Draw(screen) } @@ -196,7 +197,7 @@ func (d *MessageDialog) setColor() { func (d *MessageDialog) setRect() { maxHeight := d.height - maxWidth := d.width //nolint:ifshort + maxWidth := d.width messageHeight := len(strings.Split(d.message, "\n")) messageWidth := getMessageWidth(d.message) diff --git a/vendor/github.com/navidys/tvxwidgets/gauge_am.go b/vendor/github.com/navidys/tvxwidgets/gauge_am.go index 4f70e265..3fb407bf 100644 --- a/vendor/github.com/navidys/tvxwidgets/gauge_am.go +++ b/vendor/github.com/navidys/tvxwidgets/gauge_am.go @@ -10,6 +10,7 @@ import ( // ActivityModeGauge represents activity mode gauge permitive. type ActivityModeGauge struct { *tview.Box + // counter value counter int @@ -30,8 +31,8 @@ func NewActivityModeGauge() *ActivityModeGauge { // Draw draws this primitive onto the screen. func (g *ActivityModeGauge) Draw(screen tcell.Screen) { - g.Box.DrawForSubclass(screen, g) - x, y, width, height := g.Box.GetInnerRect() + g.DrawForSubclass(screen, g) + x, y, width, height := g.GetInnerRect() tickStr := g.tickStr(width) for i := range height { @@ -40,7 +41,7 @@ func (g *ActivityModeGauge) Draw(screen tcell.Screen) { } // Focus is called when this primitive receives focus. -func (g *ActivityModeGauge) Focus(delegate func(p tview.Primitive)) { //nolint:revive +func (g *ActivityModeGauge) Focus(delegate func(p tview.Primitive)) { } // HasFocus returns whether or not this primitive has focus. diff --git a/vendor/github.com/navidys/tvxwidgets/gauge_pm.go b/vendor/github.com/navidys/tvxwidgets/gauge_pm.go index 6f35a251..c6034f7c 100644 --- a/vendor/github.com/navidys/tvxwidgets/gauge_pm.go +++ b/vendor/github.com/navidys/tvxwidgets/gauge_pm.go @@ -10,6 +10,7 @@ import ( // PercentageModeGauge represents percentage mode gauge permitive. type PercentageModeGauge struct { *tview.Box + // maxValue value maxValue int // value is current value @@ -31,13 +32,13 @@ func NewPercentageModeGauge() *PercentageModeGauge { // Draw draws this primitive onto the screen. func (g *PercentageModeGauge) Draw(screen tcell.Screen) { - g.Box.DrawForSubclass(screen, g) + g.DrawForSubclass(screen, g) if g.maxValue == 0 { return } - x, y, width, height := g.Box.GetInnerRect() + x, y, width, height := g.GetInnerRect() pcWidth := 3 pc := g.value * gaugeMaxPc / g.maxValue pcString := fmt.Sprintf("%d%%", pc) @@ -71,7 +72,7 @@ func (g *PercentageModeGauge) Draw(screen tcell.Screen) { } // Focus is called when this primitive receives focus. -func (g *PercentageModeGauge) Focus(delegate func(p tview.Primitive)) { //nolint:revive +func (g *PercentageModeGauge) Focus(delegate func(p tview.Primitive)) { } // HasFocus returns whether or not this primitive has focus. diff --git a/vendor/github.com/navidys/tvxwidgets/gauge_um.go b/vendor/github.com/navidys/tvxwidgets/gauge_um.go index e810b993..6af2eba9 100644 --- a/vendor/github.com/navidys/tvxwidgets/gauge_um.go +++ b/vendor/github.com/navidys/tvxwidgets/gauge_um.go @@ -10,6 +10,7 @@ import ( // UtilModeGauge represents utilisation mode gauge permitive. type UtilModeGauge struct { *tview.Box + // pc percentage value pc float64 // warn percentage value @@ -59,7 +60,7 @@ func (g *UtilModeGauge) SetLabelColor(color tcell.Color) { } // Focus is called when this primitive receives focus. -func (g *UtilModeGauge) Focus(delegate func(p tview.Primitive)) { //nolint:revive +func (g *UtilModeGauge) Focus(delegate func(p tview.Primitive)) { } // HasFocus returns whether or not this primitive has focus. @@ -91,8 +92,8 @@ func (g *UtilModeGauge) GetValue() float64 { // Draw draws this primitive onto the screen. func (g *UtilModeGauge) Draw(screen tcell.Screen) { - g.Box.DrawForSubclass(screen, g) - x, y, width, height := g.Box.GetInnerRect() + g.DrawForSubclass(screen, g) + x, y, width, height := g.GetInnerRect() labelPCWidth := 7 labelWidth := len(g.label) barWidth := width - labelPCWidth - labelWidth @@ -138,6 +139,11 @@ func (g *UtilModeGauge) SetCritPercentage(percentage float64) { } } +// SetEmptyColor sets empty gauge color. +func (g *UtilModeGauge) SetEmptyColor(color tcell.Color) { + g.emptyColor = color +} + func (g *UtilModeGauge) getBarColor(percentage float64) tcell.Color { if percentage < g.warnPc { return g.okColor @@ -147,8 +153,3 @@ func (g *UtilModeGauge) getBarColor(percentage float64) tcell.Color { return g.critColor } - -// SetEmptyColor sets empty gauge color. -func (g *UtilModeGauge) SetEmptyColor(color tcell.Color) { - g.emptyColor = color -} diff --git a/vendor/github.com/navidys/tvxwidgets/plot.go b/vendor/github.com/navidys/tvxwidgets/plot.go index efe45a5e..2a085cbd 100644 --- a/vendor/github.com/navidys/tvxwidgets/plot.go +++ b/vendor/github.com/navidys/tvxwidgets/plot.go @@ -16,7 +16,6 @@ import ( type Marker uint const ( - // plot marker. PlotMarkerBraille Marker = iota PlotMarkerDot ) @@ -54,6 +53,7 @@ type brailleCell struct { // Plot represents a plot primitive used for different charts. type Plot struct { *tview.Box + data [][]float64 // maxVal is the maximum y-axis (vertical) value found in any of the lines in the data set. maxVal float64 @@ -100,7 +100,7 @@ func NewPlot() *Plot { // Draw draws this primitive onto the screen. func (plot *Plot) Draw(screen tcell.Screen) { - plot.Box.DrawForSubclass(screen, plot) + plot.DrawForSubclass(screen, plot) switch plot.marker { case PlotMarkerDot: @@ -194,14 +194,17 @@ func (plot *Plot) SetData(data [][]float64) { } } +// SetMaxVal sets plot maximum value. func (plot *Plot) SetMaxVal(maxVal float64) { plot.maxVal = maxVal } +// SetMinVal sets plot minimum value. func (plot *Plot) SetMinVal(minVal float64) { plot.minVal = minVal } +// SetYRange sets plot Y range. func (plot *Plot) SetYRange(minVal float64, maxVal float64) { plot.minVal = minVal plot.maxVal = maxVal @@ -212,14 +215,9 @@ func (plot *Plot) SetDotMarkerRune(r rune) { plot.dotMarkerRune = r } -// Figure out the text width necessary to display the largest data value. -func (plot *Plot) getYAxisLabelsWidth() int { - return len(fmt.Sprintf("%.2f", plot.maxVal)) -} - // GetPlotRect returns the rect for the inner part of the plot, ie not including axes. func (plot *Plot) GetPlotRect() (int, int, int, int) { - x, y, width, height := plot.Box.GetInnerRect() + x, y, width, height := plot.GetInnerRect() plotYAxisLabelsWidth := plot.getYAxisLabelsWidth() if plot.drawAxes { @@ -234,6 +232,11 @@ func (plot *Plot) GetPlotRect() (int, int, int, int) { return x, y, width, height } +// Figure out the text width necessary to display the largest data value. +func (plot *Plot) getYAxisLabelsWidth() int { + return len(fmt.Sprintf("%.2f", plot.maxVal)) +} + func (plot *Plot) getData() [][]float64 { plot.mu.Lock() data := plot.data @@ -247,7 +250,7 @@ func (plot *Plot) drawAxesToScreen(screen tcell.Screen) { return } - x, y, width, height := plot.Box.GetInnerRect() + x, y, width, height := plot.GetInnerRect() plotYAxisLabelsWidth := plot.getYAxisLabelsWidth() axesStyle := tcell.StyleDefault.Background(plot.GetBackgroundColor()).Foreground(plot.axesColor) diff --git a/vendor/github.com/navidys/tvxwidgets/sparkline.go b/vendor/github.com/navidys/tvxwidgets/sparkline.go index 7b2d8ef2..493c752e 100644 --- a/vendor/github.com/navidys/tvxwidgets/sparkline.go +++ b/vendor/github.com/navidys/tvxwidgets/sparkline.go @@ -8,7 +8,7 @@ import ( "github.com/rivo/tview" ) -// Spartline represents a sparkline widgets. +// Sparkline represents a sparkline widgets. type Sparkline struct { *tview.Box @@ -28,9 +28,9 @@ func NewSparkline() *Sparkline { // Draw draws this primitive onto the screen. func (sl *Sparkline) Draw(screen tcell.Screen) { - sl.Box.DrawForSubclass(screen, sl) + sl.DrawForSubclass(screen, sl) - x, y, width, height := sl.Box.GetInnerRect() + x, y, width, height := sl.GetInnerRect() barHeight := height // print label diff --git a/vendor/github.com/navidys/tvxwidgets/spinner.go b/vendor/github.com/navidys/tvxwidgets/spinner.go index c211f2e6..50833bc9 100644 --- a/vendor/github.com/navidys/tvxwidgets/spinner.go +++ b/vendor/github.com/navidys/tvxwidgets/spinner.go @@ -15,6 +15,7 @@ type Spinner struct { styles map[SpinnerStyle][]rune } +// SpinnerStyle spinner style. type SpinnerStyle int const ( @@ -63,8 +64,8 @@ func NewSpinner() *Spinner { // Draw draws this primitive onto the screen. func (s *Spinner) Draw(screen tcell.Screen) { - s.Box.DrawForSubclass(screen, s) - x, y, width, _ := s.Box.GetInnerRect() + s.DrawForSubclass(screen, s) + x, y, width, _ := s.GetInnerRect() tview.Print(screen, s.getCurrentFrame(), x, y, width, tview.AlignLeft, tcell.ColorDefault) } @@ -85,6 +86,14 @@ func (s *Spinner) SetStyle(style SpinnerStyle) *Spinner { return s } +// SetCustomStyle sets a list of runes as custom frames to show as the spinner. +func (s *Spinner) SetCustomStyle(frames []rune) *Spinner { + s.styles[spinnerCustom] = frames + s.currentStyle = spinnerCustom + + return s +} + func (s *Spinner) getCurrentFrame() string { frames := s.styles[s.currentStyle] if len(frames) == 0 { @@ -93,11 +102,3 @@ func (s *Spinner) getCurrentFrame() string { return string(frames[s.counter%len(frames)]) } - -// SetCustomStyle sets a list of runes as custom frames to show as the spinner. -func (s *Spinner) SetCustomStyle(frames []rune) *Spinner { - s.styles[spinnerCustom] = frames - s.currentStyle = spinnerCustom - - return s -} diff --git a/vendor/github.com/navidys/tvxwidgets/utils.go b/vendor/github.com/navidys/tvxwidgets/utils.go index 454f17d1..a9ac3a6e 100644 --- a/vendor/github.com/navidys/tvxwidgets/utils.go +++ b/vendor/github.com/navidys/tvxwidgets/utils.go @@ -166,11 +166,12 @@ func absInt(x int) int { } func drawLine(screen tcell.Screen, startX int, startY int, length int, mode drawLineMode, style tcell.Style) { - if mode == horizontalLine { + switch mode { + case horizontalLine: for i := range length { tview.PrintJoinedSemigraphics(screen, startX+i, startY, tview.BoxDrawingsLightTripleDashHorizontal, style) } - } else if mode == verticalLine { + case verticalLine: for i := range length { tview.PrintJoinedSemigraphics(screen, startX, startY+i, tview.BoxDrawingsLightTripleDashVertical, style) } diff --git a/vendor/github.com/rivo/tview/README.md b/vendor/github.com/rivo/tview/README.md index 75e4bac2..245f9b85 100644 --- a/vendor/github.com/rivo/tview/README.md +++ b/vendor/github.com/rivo/tview/README.md @@ -140,6 +140,7 @@ For a presentation highlighting this package, compile and run the program found - [chiko: Ultimate Beauty TUI gRPC Client](https://github.com/felangga/chiko) - [kmip-explorer: Browse & manage your KMIP objects from the terminal](https://github.com/phsym/kmip-explorer) - [stui: Slurm TUI for managing HPC clusters](https://github.com/antvirf/stui) +- [nerdlog: Fast, remote-first, multi-host log viewer with timeline histogram](https://github.com/dimonomid/nerdlog) ## Documentation @@ -153,9 +154,9 @@ This package is based on [github.com/gdamore/tcell](https://github.com/gdamore/t [Become a Sponsor on GitHub](https://github.com/sponsors/rivo?metadata_source=tview_readme) to further this project! -## Versioning and Backwards-Compatibility +## Backwards-Compatibility -I try really hard to keep this project backwards compatible. Your software should not break when you upgrade `tview`. But this also means that some of its shortcomings that were present in the initial versions will remain. In addition, at least for the time being, you won't find any version tags in this repo. The newest version should be the one to upgrade to. It has all the bugfixes and latest features. Having said that, backwards compatibility may still break when: +I try really hard to keep this project backwards compatible. Your software should not break when you upgrade `tview`. But this also means that some of its shortcomings that were present in the initial versions will remain. Having said that, backwards compatibility may still break when: - a new version of an imported package (most likely [`tcell`](https://github.com/gdamore/tcell)) changes in such a way that forces me to make changes in `tview` as well, - I fix something that I consider a bug, rather than a feature, something that does not work as originally intended, diff --git a/vendor/github.com/rivo/tview/ansi.go b/vendor/github.com/rivo/tview/ansi.go index 1b7d2e3c..53bccd10 100644 --- a/vendor/github.com/rivo/tview/ansi.go +++ b/vendor/github.com/rivo/tview/ansi.go @@ -95,11 +95,9 @@ func (a *ansi) Write(text []byte) (int, error) { fields := strings.Split(params, ";") if len(params) == 0 || fields[0] == "" || fields[0] == "0" { // Reset. - a.attributes = "" - if _, err := a.buffer.WriteString("[-:-:-]"); err != nil { - return 0, err - } - break + foreground = "-" + background = "-" + a.attributes = "-" } lookupColor := func(colorNumber int) string { if colorNumber < 0 || colorNumber > 15 { @@ -232,6 +230,9 @@ func (a *ansi) Write(text []byte) (int, error) { } } var colon string + if len(a.attributes) > 1 && a.attributes[0] == '-' { + a.attributes = a.attributes[1:] + } if len(a.attributes) > 0 { colon = ":" } diff --git a/vendor/github.com/rivo/tview/application.go b/vendor/github.com/rivo/tview/application.go index 6e6666b1..3c5fde84 100644 --- a/vendor/github.com/rivo/tview/application.go +++ b/vendor/github.com/rivo/tview/application.go @@ -77,6 +77,10 @@ type Application struct { // Fini(), to set a new screen (or nil to stop the application). screen tcell.Screen + // The application's title. If not empty, it will be set on every new screen + // that is added. + title string + // The primitive which currently has the keyboard focus. focus Primitive @@ -187,7 +191,9 @@ func (a *Application) GetMouseCapture() func(event *tcell.EventMouse, action Mou // SetScreen allows you to provide your own tcell.Screen object. For most // applications, this is not needed and you should be familiar with -// tcell.Screen when using this function. +// tcell.Screen when using this function. As the tcell.Screen interface may +// change in the future, you may need to update your code when this package +// updates to a new tcell version. // // This function is typically called before the first call to Run(). Init() need // not be called on the screen. @@ -214,6 +220,19 @@ func (a *Application) SetScreen(screen tcell.Screen) *Application { return a } +// SetTitle sets the title of the terminal window, to the extent that the +// terminal supports it. A non-empty title will be set on every new tcell.Screen +// that is created by or added to this application. +func (a *Application) SetTitle(title string) *Application { + a.Lock() + defer a.Unlock() + a.title = title + if a.screen != nil { + a.screen.SetTitle(title) + } + return a +} + // EnableMouse enables mouse events or disables them (if "false" is provided). func (a *Application) EnableMouse(enable bool) *Application { a.Lock() @@ -286,6 +305,9 @@ func (a *Application) Run() error { } else { a.screen.DisablePaste() } + if a.title != "" { + a.screen.SetTitle(a.title) + } } // We catch panics to clean up because they mess up the terminal. @@ -354,6 +376,9 @@ func (a *Application) Run() error { } else { screen.DisablePaste() } + if a.title != "" { + screen.SetTitle(a.title) + } a.draw() } }() diff --git a/vendor/github.com/rivo/tview/box.go b/vendor/github.com/rivo/tview/box.go index 04ce0852..c05994cc 100644 --- a/vendor/github.com/rivo/tview/box.go +++ b/vendor/github.com/rivo/tview/box.go @@ -314,7 +314,7 @@ func (b *Box) SetBorderColor(color tcell.Color) *Box { // SetBorderAttributes sets the border's style attributes. You can combine // different attributes using bitmask operations: // -// box.SetBorderAttributes(tcell.AttrUnderline | tcell.AttrBold) +// box.SetBorderAttributes(tcell.AttrItalic | tcell.AttrBold) func (b *Box) SetBorderAttributes(attr tcell.AttrMask) *Box { b.borderStyle = b.borderStyle.Attributes(attr) return b diff --git a/vendor/github.com/rivo/tview/doc.go b/vendor/github.com/rivo/tview/doc.go index bfefa03a..b4ddbc66 100644 --- a/vendor/github.com/rivo/tview/doc.go +++ b/vendor/github.com/rivo/tview/doc.go @@ -65,7 +65,7 @@ Throughout this package, styles are specified using the [tcell.Style] type. Styles specify colors with the [tcell.Color] type. Functions such as [tcell.GetColor], [tcell.NewHexColor], and [tcell.NewRGBColor] can be used to create colors from W3C color names or RGB values. The [tcell.Style] type also -allows you to specify text attributes such as "bold" or "underline" or a URL +allows you to specify text attributes such as "bold" or "italic" or a URL which some terminals use to display hyperlinks. Almost all strings which are displayed may contain style tags. A style tag's diff --git a/vendor/github.com/rivo/tview/inputfield.go b/vendor/github.com/rivo/tview/inputfield.go index 2edc98d5..f5439343 100644 --- a/vendor/github.com/rivo/tview/inputfield.go +++ b/vendor/github.com/rivo/tview/inputfield.go @@ -542,14 +542,11 @@ func (i *InputField) InputHandler() func(event *tcell.EventKey, setFocus func(p var skipAutocomplete bool currentText := i.textArea.GetText() defer func() { - newText := i.textArea.GetText() - if newText != currentText { - if !skipAutocomplete { - i.Autocomplete() - } - if i.changed != nil { - i.changed(newText) - } + if skipAutocomplete { + return + } + if i.textArea.GetText() != currentText { + i.Autocomplete() } }() @@ -649,14 +646,11 @@ func (i *InputField) MouseHandler() func(action MouseAction, event *tcell.EventM var skipAutocomplete bool currentText := i.GetText() defer func() { - newText := i.GetText() - if newText != currentText { - if !skipAutocomplete { - i.Autocomplete() - } - if i.changed != nil { - i.changed(newText) - } + if skipAutocomplete { + return + } + if i.textArea.GetText() != currentText { + i.Autocomplete() } }() diff --git a/vendor/github.com/rivo/tview/pages.go b/vendor/github.com/rivo/tview/pages.go index 83410ada..d2b6dbd3 100644 --- a/vendor/github.com/rivo/tview/pages.go +++ b/vendor/github.com/rivo/tview/pages.go @@ -66,12 +66,12 @@ func (p *Pages) GetPageNames(visibleOnly bool) []string { // AddPage adds a new page with the given name and primitive. If there was // previously a page with the same name, it is overwritten. Leaving the name -// empty may cause conflicts in other functions so always specify a non-empty -// name. +// empty may cause conflicts in other functions so you should always specify a +// non-empty name. // // Visible pages will be drawn in the order they were added (unless that order // was changed in one of the other functions). If "resize" is set to true, the -// primitive will be set to the size available to the Pages primitive whenever +// primitive will be set to the size available to the [Pages] primitive whenever // the pages are drawn. func (p *Pages) AddPage(name string, item Primitive, resize, visible bool) *Pages { hasFocus := p.HasFocus() @@ -248,6 +248,17 @@ func (p *Pages) GetFrontPage() (name string, item Primitive) { return } +// GetPage returns the page with the given name. If no such page exists, nil is +// returned. +func (p *Pages) GetPage(name string) Primitive { + for _, page := range p.pages { + if page.Name == name { + return page.Item + } + } + return nil +} + // HasFocus returns whether or not this primitive has focus. func (p *Pages) HasFocus() bool { for _, page := range p.pages { diff --git a/vendor/github.com/rivo/tview/strings.go b/vendor/github.com/rivo/tview/strings.go index 81c6a711..1c13fe23 100644 --- a/vendor/github.com/rivo/tview/strings.go +++ b/vendor/github.com/rivo/tview/strings.go @@ -254,7 +254,6 @@ func parseTag(str string, state *stepState) (length int, style tcell.Style, regi // Attribute map. attrs := map[byte]tcell.AttrMask{ 'B': tcell.AttrBold, - 'U': tcell.AttrUnderline, 'I': tcell.AttrItalic, 'L': tcell.AttrBlink, 'D': tcell.AttrDim, @@ -284,17 +283,18 @@ func parseTag(str string, state *stepState) (length int, style tcell.Style, regi return } case tagStateStart: - if ch == '"' { // Start of a region tag. + switch { + case ch == '"': // Start of a region tag. tempStr.Reset() tagState = tagStateRegionStart - } else if !isOneOf(ch, "#:-") { // Invalid style tag. + case !isOneOf(ch, "#:-"): // Invalid style tag. return - } else if ch == '-' { // Reset foreground color. + case ch == '-': // Reset foreground color. tStyle = tStyle.Foreground(state.initialForeground) tagState = tagStateEndForeground - } else if ch == ':' { // No foreground color. + case ch == ':': // No foreground color. tagState = tagStateStartBackground - } else { + default: tempStr.Reset() tempStr.WriteByte(ch) if ch == '#' { // Numeric foreground color. @@ -304,11 +304,12 @@ func parseTag(str string, state *stepState) (length int, style tcell.Style, regi } } case tagStateEndForeground: - if ch == ']' { // End of tag. + switch ch { + case ']': // End of tag. tagState = tagStateDoneTag - } else if ch == ':' { + case ':': tagState = tagStateStartBackground - } else { // Invalid tag. + default: // Invalid tag. return } case tagStateNumericForeground: @@ -318,14 +319,15 @@ func parseTag(str string, state *stepState) (length int, style tcell.Style, regi } tStyle = tStyle.Foreground(tcell.GetColor(tempStr.String())) } - if ch == ']' { // End of tag. + switch { + case ch == ']': // End of tag. tagState = tagStateDoneTag - } else if ch == ':' { // Start of background color. + case ch == ':': // Start of background color. tagState = tagStateStartBackground - } else if strings.IndexByte("0123456789abcdefABCDEF", ch) >= 0 { // Hex digit. + case strings.IndexByte("0123456789abcdefABCDEF", ch) >= 0: // Hex digit. tempStr.WriteByte(ch) tagState = tagStateNumericForeground - } else { // Invalid tag. + default: // Invalid tag. return } case tagStateNameForeground: @@ -336,26 +338,28 @@ func parseTag(str string, state *stepState) (length int, style tcell.Style, regi } tStyle = tStyle.Foreground(tcell.ColorNames[name]) } - if !isOneOf(ch, "]:") { // Invalid tag. + switch { + case !isOneOf(ch, "]:"): // Invalid tag. return - } else if ch == ']' { // End of tag. + case ch == ']': // End of tag. tagState = tagStateDoneTag - } else if ch == ':' { // Start of background color. + case ch == ':': // Start of background color. tagState = tagStateStartBackground - } else { // Letters or numbers. + default: // Letters or numbers. tempStr.WriteByte(ch) } case tagStateStartBackground: - if !isOneOf(ch, "#:-]") { // Invalid style tag. + switch { + case !isOneOf(ch, "#:-]"): // Invalid style tag. return - } else if ch == ']' { // End of tag. + case ch == ']': // End of tag. tagState = tagStateDoneTag - } else if ch == '-' { // Reset background color. + case ch == '-': // Reset background color. tStyle = tStyle.Background(state.initialBackground) tagState = tagStateEndBackground - } else if ch == ':' { // No background color. + case ch == ':': // No background color. tagState = tagStateStartAttributes - } else { + default: tempStr.Reset() tempStr.WriteByte(ch) if ch == '#' { // Numeric background color. @@ -365,11 +369,12 @@ func parseTag(str string, state *stepState) (length int, style tcell.Style, regi } } case tagStateEndBackground: - if ch == ']' { // End of tag. + switch ch { + case ']': // End of tag. tagState = tagStateDoneTag - } else if ch == ':' { // Start of attributes. + case ':': // Start of attributes. tagState = tagStateStartAttributes - } else { // Invalid tag. + default: // Invalid tag. return } case tagStateNumericBackground: @@ -397,28 +402,30 @@ func parseTag(str string, state *stepState) (length int, style tcell.Style, regi } tStyle = tStyle.Background(tcell.ColorNames[name]) } - if !isOneOf(ch, "]:") { // Invalid tag. + switch { + case !isOneOf(ch, "]:"): // Invalid tag. return - } else if ch == ']' { // End of tag. + case ch == ']': // End of tag. tagState = tagStateDoneTag - } else if ch == ':' { // Start of background color. + case ch == ':': // Start of background color. tagState = tagStateStartAttributes - } else { // Letters or numbers. + default: // Letters or numbers. tempStr.WriteByte(ch) } case tagStateStartAttributes: - if ch == ']' { // End of tag. + switch { + case ch == ']': // End of tag. tagState = tagStateDoneTag - } else if ch == '-' { // Reset attributes. + case ch == '-': // Reset attributes. tStyle = tStyle.Attributes(state.initialAttributes) tagState = tagStateEndAttributes - } else if ch == ':' { // Start of URL. + case ch == ':': // Start of URL. tagState = tagStateStartURL - } else if strings.IndexByte("buildsrBUILDSR", ch) >= 0 { // Attribute tag. + case strings.IndexByte("buildsrBUILDSR", ch) >= 0: // Attribute tag. tempStr.Reset() tempStr.WriteByte(ch) tagState = tagStateAttributes - } else { // Invalid tag. + default: // Invalid tag. return } case tagStateAttributes: @@ -427,38 +434,46 @@ func parseTag(str string, state *stepState) (length int, style tcell.Style, regi _, _, a := tStyle.Decompose() for index := 0; index < len(flags); index++ { ch := flags[index] - if ch >= 'a' && ch <= 'z' { + switch { + case ch == 'u': + tStyle = tStyle.Underline(true) + case ch == 'U': + tStyle = tStyle.Underline(false) + case ch >= 'a' && ch <= 'z': a |= attrs[ch-('a'-'A')] - } else { + default: a &^= attrs[ch] } } tStyle = tStyle.Attributes(a) } - if ch == ']' { // End of tag. + switch { + case ch == ']': // End of tag. tagState = tagStateDoneTag - } else if ch == ':' { // Start of URL. + case ch == ':': // Start of URL. tagState = tagStateStartURL - } else if strings.IndexByte("buildsrBUILDSR", ch) >= 0 { // Attribute tag. + case strings.IndexByte("buildsrBUILDSR", ch) >= 0: // Attribute tag. tempStr.WriteByte(ch) - } else { // Invalid tag. + default: // Invalid tag. return } case tagStateEndAttributes: - if ch == ']' { // End of tag. + switch ch { + case ']': // End of tag. tagState = tagStateDoneTag - } else if ch == ':' { // Start of URL. + case ':': // Start of URL. tagState = tagStateStartURL - } else { // Invalid tag. + default: // Invalid tag. return } case tagStateStartURL: - if ch == ']' { // End of tag. + switch ch { + case ']': // End of tag. tagState = tagStateDoneTag - } else if ch == '-' { // Reset URL. + case '-': // Reset URL. tStyle = tStyle.Url("").UrlId("") tagState = tagStateEndURL - } else { // URL character. + default: // URL character. tempStr.Reset() tempStr.WriteByte(ch) tStyle = tStyle.UrlId(strconv.Itoa(int(rand.Uint32()))) // Generate a unique ID for this URL. @@ -478,12 +493,13 @@ func parseTag(str string, state *stepState) (length int, style tcell.Style, regi tempStr.WriteByte(ch) } case tagStateRegionStart: - if ch == '"' { // End of region tag. + switch { + case ch == '"': // End of region tag. tagState = tagStateRegionEnd - } else if isOneOf(ch, "_,;: -.") { // Region name. + case isOneOf(ch, "_,;: -."): // Region name. tempStr.WriteByte(ch) tagState = tagStateRegionName - } else { // Invalid tag. + default: // Invalid tag. return } case tagStateRegionEnd: @@ -494,11 +510,12 @@ func parseTag(str string, state *stepState) (length int, style tcell.Style, regi return } case tagStateRegionName: - if ch == '"' { // End of region tag. + switch { + case ch == '"': // End of region tag. tagState = tagStateRegionEnd - } else if isOneOf(ch, "_,;: -.") { // Region name. + case isOneOf(ch, "_,;: -."): // Region name. tempStr.WriteByte(ch) - } else { // Invalid tag. + default: // Invalid tag. return } } diff --git a/vendor/github.com/rivo/tview/table.go b/vendor/github.com/rivo/tview/table.go index 2dd88029..c04fc400 100644 --- a/vendor/github.com/rivo/tview/table.go +++ b/vendor/github.com/rivo/tview/table.go @@ -155,7 +155,7 @@ func (c *TableCell) SetTransparency(transparent bool) *TableCell { // SetAttributes sets the cell's text attributes. You can combine different // attributes using bitmask operations: // -// cell.SetAttributes(tcell.AttrUnderline | tcell.AttrBold) +// cell.SetAttributes(tcell.AttrItalic | tcell.AttrBold) func (c *TableCell) SetAttributes(attr tcell.AttrMask) *TableCell { if c.Style == tcell.StyleDefault { c.Attributes = attr @@ -1474,6 +1474,7 @@ func (t *Table) InputHandler() func(event *tcell.EventKey, setFocus func(p Primi down = func() { if t.rowsSelectable { + row, column := t.selectedRow, t.selectedColumn t.selectedRow++ if t.selectedRow >= rowCount { if t.wrapVertically { @@ -1482,7 +1483,6 @@ func (t *Table) InputHandler() func(event *tcell.EventKey, setFocus func(p Primi t.selectedRow = rowCount - 1 } } - row, column := t.selectedRow, t.selectedColumn finalRow, finalColumn := rowCount-1, lastColumn if t.wrapVertically { finalRow = row @@ -1499,6 +1499,7 @@ func (t *Table) InputHandler() func(event *tcell.EventKey, setFocus func(p Primi up = func() { if t.rowsSelectable { + row, column := t.selectedRow, t.selectedColumn t.selectedRow-- if t.selectedRow < 0 { if t.wrapVertically { @@ -1507,7 +1508,6 @@ func (t *Table) InputHandler() func(event *tcell.EventKey, setFocus func(p Primi t.selectedRow = 0 } } - row, column := t.selectedRow, t.selectedColumn finalRow, finalColumn := 0, 0 if t.wrapVertically { finalRow = row diff --git a/vendor/modules.txt b/vendor/modules.txt index dc74f006..ca9f6ba5 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -30,8 +30,8 @@ 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.8.1 -## explicit; go 1.12 +# github.com/gdamore/tcell/v2 v2.9.0 +## explicit; go 1.23.0 github.com/gdamore/tcell/v2 github.com/gdamore/tcell/v2/terminfo github.com/gdamore/tcell/v2/terminfo/a/aixterm @@ -171,8 +171,8 @@ github.com/mwitkow/go-conntrack # github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f ## explicit github.com/mxk/go-flowrate/flowrate -# github.com/navidys/tvxwidgets v0.11.1 -## explicit; go 1.23.3 +# github.com/navidys/tvxwidgets v0.12.1 +## explicit; go 1.24.7 github.com/navidys/tvxwidgets # github.com/netobserv/flowlogs-pipeline v1.9.2-community ## explicit; go 1.24.0 @@ -262,7 +262,7 @@ github.com/prometheus/common/model github.com/prometheus/procfs github.com/prometheus/procfs/internal/fs github.com/prometheus/procfs/internal/util -# github.com/rivo/tview v0.0.0-20250501113434-0c592cd31026 +# github.com/rivo/tview v0.42.0 ## explicit; go 1.18 github.com/rivo/tview # github.com/rivo/uniseg v0.4.7