Skip to content

Commit 6dbdc20

Browse files
committed
feat(tui): add keystroke logging for debugging
- add logging for all key presses in tui update loop - import logger package in tui module - log key string representation for debugging purposes
1 parent 9379e0f commit 6dbdc20

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/tui/tui.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"time"
1010

1111
"github.com/museslabs/kyma/internal/config"
12+
"github.com/museslabs/kyma/internal/logger"
1213
"github.com/museslabs/kyma/internal/tui/transitions"
1314
)
1415

@@ -128,6 +129,10 @@ func (m model) Init() tea.Cmd {
128129
}
129130

130131
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
132+
if keyMsg, ok := msg.(tea.KeyMsg); ok {
133+
logger.Info("Key pressed", "key", keyMsg.String())
134+
}
135+
131136
if m.command != nil && m.command.IsShowing() {
132137
command, cmd := m.command.Update(msg)
133138
m.command = &command

0 commit comments

Comments
 (0)