You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
As the title says, however I think this has been solved by aymanbagabas in #594
Setup
Please complete the following information along with version numbers, if applicable.
OS Windows11
Shell Powershell
Terminal Emulator Windows Terminal
Terminal Multiplexer
To Reproduce
Steps to reproduce the behavior:
Go to bubbletea/examples/mouse/main.go
I changed the code to make it easier to see the problem(see below)
run the code
Source Code
package main
// A simple program that opens the alternate screen buffer and displays mouse
// coordinates and events.
import (
"fmt"
"log"
tea "github.com/charmbracelet/bubbletea"
)
func main() {
p := tea.NewProgram(model{}, tea.WithAltScreen(), tea.WithMouseAllMotion())
if _, err := p.Run(); err != nil {
log.Fatal(err)
}
}
type model struct {
init bool
mouseEvent tea.MouseEvent
key tea.KeyMsg <---------------------------------------------------- (ADD)
}
func (m model) Init() tea.Cmd {
return nil
}
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case tea.KeyMsg:
if s := msg.String(); s == "ctrl+c" || s == "q" || s == "esc" {
return m, tea.Quit
} else {
m.key = msg <---------------------------------------------------- (ADD)
}
case tea.MouseMsg:
m.init = true
m.mouseEvent = tea.MouseEvent(msg)
}
return m, nil
}
func (m model) View() string {
s := "Do mouse stuff. When you're done press q to quit.\n\n"
if m.init {
e := m.mouseEvent
s += fmt.Sprintf("(X: %d, Y: %d) %s \n", e.X, e.Y, e)
s += m.key.String() <---------------------------------------------------- (ADD)
}
return s
}
Expected behavior
see below
Screenshots
With master branch, seeing this. Mouse events are recognized as key events when the terminal gains focus and it can not capture event beyound column 95.
With #594, run the same code, everything works well
Additional context
If there are no serious problems, perhaps we can merge this request, which would be significant for Windows Terminal users
The text was updated successfully, but these errors were encountered:
Describe the bug
As the title says, however I think this has been solved by aymanbagabas in #594
Setup
Please complete the following information along with version numbers, if applicable.
To Reproduce
Steps to reproduce the behavior:
Source Code
Expected behavior
see below
Screenshots
With master branch, seeing this. Mouse events are recognized as key events when the terminal gains focus and it can not capture event beyound column 95.
With #594, run the same code, everything works well
Additional context
If there are no serious problems, perhaps we can merge this request, which would be significant for Windows Terminal users
The text was updated successfully, but these errors were encountered: