bubbletea icon indicating copy to clipboard operation
bubbletea copied to clipboard

ctrl+pgup, ctrl+pgdown

Open Bwahharharrr opened this issue 3 years ago • 2 comments

Things like shift+t (browser new tab, makes sense to make a 'new tab' support in tui via same key combo Also, crtl+pg up or ctrl+pg down

Bwahharharrr avatar Jul 16 '22 20:07 Bwahharharrr

Hey, @Bwahharharrr! shift+t is supported (it comes in as a literal capital T):

// Here's what shift+t looks like
tea.Key{type: tea.KeyRunes, runes: []rune{'T'}}

// Matching on it in an update:
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
    switch msg := msg.(type) {
        case tea.KeyMsg:
            switch msg.String() {
                case "T":
                // shift+T!
        }
    }
    // ...
}

As for ctrl+pgup and ctrl+pgdown, iirc they're not matchable because of terminal limitations beyond our control, but it's worth looking into again.

meowgorithm avatar Jul 17 '22 05:07 meowgorithm

Yeah I only thought about pgup and pgdown because of the familiarity using them in browser tabs, so using the same commands in tui tabs also makes sense.

Bwahharharrr avatar Jul 17 '22 14:07 Bwahharharrr

Turns out this is actually parseable from the input stream. Fix in master.

muesli avatar Oct 12 '22 05:10 muesli