Skip to content

Commit c01dcee

Browse files
committed
Use SessioN#reset_ui for UI switch
1 parent 5687a01 commit c01dcee

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/debug/local.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ def initialize(windows)
118118
super()
119119
end
120120

121+
def deactivate
122+
super
123+
clear_screen!
124+
end
125+
121126
def height
122127
if (w = IO.console_size[0]) == 0 # for tests PTY
123128
80

lib/debug/session.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,8 +1029,7 @@ def process_command line
10291029
types = type.split(",").map(&:to_sym)
10301030
start_tui(types)
10311031
when 'off'
1032-
@ui.clear_screen!
1033-
@ui = UI_LocalConsole.new
1032+
reset_ui(UI_LocalConsole.new)
10341033
end
10351034

10361035
return :retry
@@ -1805,7 +1804,7 @@ def start_tui(types)
18051804
UI_LocalTuiConsole::FramedWindow.new(type, @ui.width, SUPPORTED_WINDOWS[type][:height])
18061805
end
18071806

1808-
@ui = UI_LocalTuiConsole.new(windows)
1807+
reset_ui(UI_LocalTuiConsole.new(windows))
18091808
tui_data = @tc.generate_tui_data(@ui.windows_metadata)
18101809
capture_tui_data(tui_data)
18111810
@ui.puts

0 commit comments

Comments
 (0)