Use mouse consts in termenv
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Christian Rocha · committed by Christian Rocha · parent f3fd9de · Browse files · 5 files·+13 added−11 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
5 files+13 added−11 removed
- other:+13 added−11 removed
Provenance
- Commit
8d26b4e- Tree
c578fc9- Author
Christian Rocha <christian@rocha.is>- Committer
Christian Rocha <christian@rocha.is>- Parent
f3fd9de
5 files changed+13 added−11 removed
modified:examples/go.mod+1 added-1 removed
7 unmodified lines8 github.com/charmbracelet/bubbles v0.3.1-0.20200623160017-c9196e5407ad9 github.com/charmbracelet/bubbletea v0.9.1-0.20200623143446-d6cf9e69b6f210 github.com/fogleman/ease v0.0.0-20170301025033-8da417bf177611 github.com/mattn/go-runewidth v0.0.912- github.com/muesli/termenv v0.5.3-0.20200617154346-da5de72b61c012+ github.com/muesli/termenv v0.5.3-0.20200625163851-04b5c30e4c0413 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect14 golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4 // indirect15 )modified:examples/go.sum+2 added
12 unmodified lines13 github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=14 github.com/muesli/termenv v0.5.3-0.20200617122104-66d435cfe924/go.mod h1:O1/I6sw+6KcrgAmcs6uiUVr7Lui+DNVbHTzt9Lm/PlI=15 github.com/muesli/termenv v0.5.3-0.20200617154346-da5de72b61c0 h1:IASsj5pQ478TEN9TLiuhP+ugUQEotZ1QdzQvcJUQ1dM=16 github.com/muesli/termenv v0.5.3-0.20200617154346-da5de72b61c0/go.mod h1:O1/I6sw+6KcrgAmcs6uiUVr7Lui+DNVbHTzt9Lm/PlI=17+github.com/muesli/termenv v0.5.3-0.20200625163851-04b5c30e4c04 h1:Wr876oXlAk6avTWi0daXAriOr+r5fqIuyDmtNc/KwY0=18+github.com/muesli/termenv v0.5.3-0.20200625163851-04b5c30e4c04/go.mod h1:O1/I6sw+6KcrgAmcs6uiUVr7Lui+DNVbHTzt9Lm/PlI=19 github.com/pkg/term v0.0.0-20200520122047-c3ffed290a03 h1:pd4YKIqCB0U7O2I4gWHgEUA2mCEOENmco0l/bM957bU=20 github.com/pkg/term v0.0.0-20200520122047-c3ffed290a03/go.mod h1:Z9+Ul5bCbBKnbCvdOWbLqTHhJiYV414CURZJba6L8qA=21 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=22 golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9 h1:vEg9joUBmeBcK9iSJftGNf3coIG4HqZElCPehJsfAYM=13 unmodified linesmodified:go.mod+2 added-2 removed
1 unmodified line2 3 go 1.134 5 require (6- github.com/muesli/termenv v0.5.3-0.20200617154346-da5de72b61c06+ github.com/muesli/termenv v0.5.3-0.20200625163851-04b5c30e4c047 github.com/pkg/term v0.0.0-20200520122047-c3ffed290a038 golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf99- golang.org/x/sys v0.0.0-20200620081246-981b61492c35 // indirect9+ golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4 // indirect10 )modified:go.sum+4 added-4 removed
2 unmodified lines3 github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac=4 github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=5 github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=6 github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=7-github.com/muesli/termenv v0.5.3-0.20200617154346-da5de72b61c0 h1:IASsj5pQ478TEN9TLiuhP+ugUQEotZ1QdzQvcJUQ1dM=8-github.com/muesli/termenv v0.5.3-0.20200617154346-da5de72b61c0/go.mod h1:O1/I6sw+6KcrgAmcs6uiUVr7Lui+DNVbHTzt9Lm/PlI=7+github.com/muesli/termenv v0.5.3-0.20200625163851-04b5c30e4c04 h1:Wr876oXlAk6avTWi0daXAriOr+r5fqIuyDmtNc/KwY0=8+github.com/muesli/termenv v0.5.3-0.20200625163851-04b5c30e4c04/go.mod h1:O1/I6sw+6KcrgAmcs6uiUVr7Lui+DNVbHTzt9Lm/PlI=9 github.com/pkg/term v0.0.0-20200520122047-c3ffed290a03 h1:pd4YKIqCB0U7O2I4gWHgEUA2mCEOENmco0l/bM957bU=10 github.com/pkg/term v0.0.0-20200520122047-c3ffed290a03/go.mod h1:Z9+Ul5bCbBKnbCvdOWbLqTHhJiYV414CURZJba6L8qA=11 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=12 golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9 h1:vEg9joUBmeBcK9iSJftGNf3coIG4HqZElCPehJsfAYM=1 unmodified line14 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=15 golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=16 golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=17 golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=18-golang.org/x/sys v0.0.0-20200620081246-981b61492c35 h1:wb/9mP8eUAmHfkM8RmpeLq6nUA7c2i5+bQOtcDftjaE=19-golang.org/x/sys v0.0.0-20200620081246-981b61492c35/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=18+golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4 h1:5/PjkGUjvEU5Gl6BxmvKRPpqo2uNMv4rcHBMwzk/st8=19+golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=20 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=modified:tea.go+4 added-4 removed
208 unmodified lines209 // button is pressed.210 func (p *Program) EnableMouseCellMotion() {211 p.mtx.Lock()212 defer p.mtx.Unlock()213- fmt.Fprintf(p.output, te.CSI+"?1002h")213+ fmt.Fprintf(p.output, te.CSI+te.EnableMouseCellMotionSeq)214 }215 216 // DisableMouseCellMotino disables Mouse Cell Motion tracking. If you've217 // enabled Cell Motion mouse trakcing be sure to call this as your program is218 // exiting or your users will be very upset!219 func (p *Program) DisableMouseCellMotion() {220 p.mtx.Lock()221 defer p.mtx.Unlock()222- fmt.Fprintf(p.output, te.CSI+"?1002l")222+ fmt.Fprintf(p.output, te.CSI+te.DisableMouseCellMotionSeq)223 }224 225 // EnableMouseAllMotion enables mouse click, release, wheel and motion events,226 // regardless of whether a button is pressed. Many modern terminals support227 // this, but not all.228 func (p *Program) EnableMouseAllMotion() {229 p.mtx.Lock()230 defer p.mtx.Unlock()231- fmt.Fprintf(p.output, te.CSI+"?1003h")231+ fmt.Fprintf(p.output, te.CSI+te.EnableMouseAllMotionSeq)232 }233 234 // DisableMouseAllMotion disables All Motion mouse tracking. If you've enabled235 // All Motion mouse tracking be sure you call this as your program is exiting236 // or your users will be very upset!237 func (p *Program) DisableMouseAllMotion() {238 p.mtx.Lock()239 defer p.mtx.Unlock()240- fmt.Fprintf(p.output, te.CSI+"?1003l")240+ fmt.Fprintf(p.output, te.CSI+te.DisableMouseAllMotionSeq)241 }