-
In https://github.com/antonmedv/llama for some reason shift+up/shift+down not working. (macOS, Terminal.app). I tried to debug it but could not figure out the reason. Please help. |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments
-
Hi @antonmedv can you please provide some details to reproduce? Did you install the program from source or through |
Beta Was this translation helpful? Give feedback.
-
Hey, @antonmedv! Did this ever work in |
Beta Was this translation helpful? Give feedback.
-
Also, for what it's worth, I was able to bind to shift up/down okay with the following: package main
import (
"fmt"
"os"
tea "github.com/charmbracelet/bubbletea"
)
type model string
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:
switch s := msg.String(); s {
case "q", "esc", "ctrl+c":
return m, tea.Quit
case "shift+up", "shift+down":
m = model(s)
}
}
return m, nil
}
func (m model) View() string {
if m == "" {
return "Press shift+up or shift+down. Q to quit."
}
return "Caught " + string(m)
}
func main() {
if _, err := tea.NewProgram(model("")).Run(); err != nil {
fmt.Println("error while running program:", err)
os.Exit(1)
}
} |
Beta Was this translation helpful? Give feedback.
-
@meowgorithm thanks for looking into this issue. I tried your example, but shift+up/down now working. shift-left/right works as expected. Here is a video showing this: Screen.Recording.2023-04-05.at.09.48.46.mov |
Beta Was this translation helpful? Give feedback.
-
I'm using a standard Terminal.app on macOS.
|
Beta Was this translation helpful? Give feedback.
-
Can confirm, it works for me in Kitty, but not in the Terminal.app on macOS |
Beta Was this translation helpful? Give feedback.
-
iirc, you still need to manually configure |
Beta Was this translation helpful? Give feedback.
-
@antonmedv Please let us know if you have any more issues with it 🙏 |
Beta Was this translation helpful? Give feedback.
Terminal.app
doesn't trigger events for these two combinations. I think historically they have been used for manipulating the scrollback buffer, but they've moved to different shortcuts for that by now.iirc, you still need to manually configure
Terminal.app
to trigger these events. See: https://github.com/timothybasanov/terminal-app-function-keys