works now
This commit is contained in:
@@ -54,7 +54,7 @@ func (m tuiModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
m.width = msg.Width
|
||||
m.height = msg.Height
|
||||
return m, nil
|
||||
case tea.KeyMsg:
|
||||
case tea.KeyPressMsg:
|
||||
switch msg.String() {
|
||||
case "q", "esc", "ctrl+c":
|
||||
select {
|
||||
@@ -69,11 +69,14 @@ func (m tuiModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (m tuiModel) View() string {
|
||||
return lipgloss.Place(m.width, m.height, lipgloss.Center, lipgloss.Center, fmt.Sprintf(
|
||||
func (m tuiModel) View() tea.View {
|
||||
content := lipgloss.Place(m.width, m.height, lipgloss.Center, lipgloss.Center, fmt.Sprintf(
|
||||
"Web server running at %s\n\nPress q, esc, or Ctrl+C to stop the task and server.\n",
|
||||
m.address,
|
||||
))
|
||||
v := tea.NewView(content)
|
||||
v.AltScreen = true
|
||||
return v
|
||||
}
|
||||
|
||||
func (w *Web) Run(ctx context.Context, config Config) error {
|
||||
@@ -106,7 +109,6 @@ func (w *Web) Run(ctx context.Context, config Config) error {
|
||||
address: address,
|
||||
quitChan: uiQuitChan,
|
||||
},
|
||||
tea.WithAltScreen(),
|
||||
)
|
||||
|
||||
screenDone = make(chan struct{})
|
||||
|
||||
Reference in New Issue
Block a user