From 1ea60b397f6690d147fbdcb6d3491cf93b979571 Mon Sep 17 00:00:00 2001 From: Aadi Desai <21363892+supleed2@users.noreply.github.com> Date: Fri, 31 May 2024 14:23:41 +0100 Subject: [PATCH] Remove unnecessary altscrren cmds --- changelog.md | 1 + client/main.go | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index 0b9957d..f823383 100644 --- a/changelog.md +++ b/changelog.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Update to [charmbracelet/bubbletea](https://github.com/charmbracelet/bubbletea) v0.26.4 to fix Windows resizing +- Remove unnecessary alt-screen commands ### Security diff --git a/client/main.go b/client/main.go index b8fe61a..1057d30 100644 --- a/client/main.go +++ b/client/main.go @@ -201,7 +201,7 @@ func (m model) Init() tea.Cmd { } func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { - var tiCmd, vpCmd, clCmd, smCmd tea.Cmd + var tiCmd, vpCmd, smCmd tea.Cmd m.input, tiCmd = m.input.Update(msg) m.history, vpCmd = m.history.Update(msg) @@ -246,7 +246,6 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { m.input.Reset() } case tea.WindowSizeMsg: - clCmd = tea.Sequence(tea.ExitAltScreen, tea.EnterAltScreen) m.history.Height = msg.Height - 2 m.history.Width = msg.Width m.history.GotoBottom() @@ -256,7 +255,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { m.history.SetContent(m.viewMessages()) } - return m, tea.Batch(tiCmd, vpCmd, clCmd, smCmd) + return m, tea.Batch(tiCmd, vpCmd, smCmd) } func (m model) View() string {