Remove unnecessary altscrren cmds

This commit is contained in:
Aadi Desai 2024-05-31 14:23:41 +01:00
parent 955a298459
commit 1ea60b397f
Signed by: supleed2
SSH key fingerprint: SHA256:CkbNRs0yVzXEiUp2zd0PSxsfRUMFF9bLlKXtE1xEbKM
2 changed files with 3 additions and 3 deletions

View file

@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- Update to [charmbracelet/bubbletea](https://github.com/charmbracelet/bubbletea) v0.26.4 to fix Windows resizing - Update to [charmbracelet/bubbletea](https://github.com/charmbracelet/bubbletea) v0.26.4 to fix Windows resizing
- Remove unnecessary alt-screen commands
### Security ### Security

View file

@ -201,7 +201,7 @@ func (m model) Init() tea.Cmd {
} }
func (m model) Update(msg tea.Msg) (tea.Model, 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.input, tiCmd = m.input.Update(msg)
m.history, vpCmd = m.history.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() m.input.Reset()
} }
case tea.WindowSizeMsg: case tea.WindowSizeMsg:
clCmd = tea.Sequence(tea.ExitAltScreen, tea.EnterAltScreen)
m.history.Height = msg.Height - 2 m.history.Height = msg.Height - 2
m.history.Width = msg.Width m.history.Width = msg.Width
m.history.GotoBottom() m.history.GotoBottom()
@ -256,7 +255,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.history.SetContent(m.viewMessages()) 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 { func (m model) View() string {