From d2a15a200917831cf2b58ce7f08a95762a5de20b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 24 Aug 2022 22:18:46 +0530 Subject: [PATCH] Make using alternate screen the default --- tools/tui/loop.go | 5 +++-- tools/tui/password.go | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/tui/loop.go b/tools/tui/loop.go index 0fb7defdf..d0b5e7ad8 100644 --- a/tools/tui/loop.go +++ b/tools/tui/loop.go @@ -144,6 +144,7 @@ func (self *Loop) on_SIGHUP() error { func CreateLoop() (*Loop, error) { l := Loop{controlling_term: nil} + l.terminal_options.alternate_screen = true l.escape_code_parser.HandleCSI = l.handle_csi l.escape_code_parser.HandleOSC = l.handle_osc l.escape_code_parser.HandleDCS = l.handle_dcs @@ -154,8 +155,8 @@ func CreateLoop() (*Loop, error) { return &l, nil } -func (self *Loop) UseAlternateScreen() { - self.terminal_options.alternate_screen = true +func (self *Loop) NoAlternateScreen() { + self.terminal_options.alternate_screen = false } func (self *Loop) MouseTracking(mt MouseTracking) { diff --git a/tools/tui/password.go b/tools/tui/password.go index dc30e043b..53ea3d229 100644 --- a/tools/tui/password.go +++ b/tools/tui/password.go @@ -19,6 +19,7 @@ var Canceled = errors.New("Canceled by user") func ReadPassword(prompt string, kill_if_signaled bool) (password string, err error) { loop, err := CreateLoop() + loop.NoAlternateScreen() shadow := "" if err != nil { return