File tree Expand file tree Collapse file tree 3 files changed +11
-22
lines changed
Expand file tree Collapse file tree 3 files changed +11
-22
lines changed Original file line number Diff line number Diff line change @@ -54,19 +54,18 @@ function M.open(opts)
5454 state .active_session = nil
5555 state .last_sent_context = nil
5656 state .active_session = M .create_new_session ()
57-
58- -- FIXME: shouldn't need to clear_output here, setting the session should
59- -- do that
60- ui .clear_output ()
6157 else
6258 if not state .active_session then
6359 state .active_session = session .get_last_workspace_session ()
64- end
65-
66- if (are_windows_closed or ui .is_output_empty ()) and not state .display_route then
60+ else
61+ -- active session already set so no event will fire, need to force a refresh
6762 ui .render_output (true )
68- ui .scroll_to_bottom ()
6963 end
64+
65+ -- if (are_windows_closed or ui.is_output_empty()) and not state.display_route then
66+ -- ui.render_output(true)
67+ -- ui.scroll_to_bottom()
68+ -- end
7069 end
7170
7271 if opts .focus == ' input' then
Original file line number Diff line number Diff line change 2828
2929--- Set up all subscriptions, for both local and server events
3030function M .setup_subscriptions (_ )
31- M ._subscriptions .active_session = function (_ , _ , old )
32- if not old then
33- return
31+ M ._subscriptions .active_session = function (_ , new , _ )
32+ M .reset ()
33+ if new then
34+ M .render_full_session ()
3435 end
35- M .render_full_session ()
3636 end
3737 state .subscribe (' active_session' , M ._subscriptions .active_session )
3838 M ._setup_event_subscriptions ()
Original file line number Diff line number Diff line change @@ -143,18 +143,8 @@ describe('opencode.core', function()
143143 it (' handles new session properly' , function ()
144144 state .windows = nil
145145 state .active_session = { id = ' old-session' }
146-
147- ui .clear_output :revert ()
148- local cleared = false
149- stub (ui , ' clear_output' ).invokes (function ()
150- cleared = true
151- end )
152-
153146 core .open ({ new_session = true , focus = ' input' })
154147 assert .truthy (state .active_session )
155- assert .is_true (cleared )
156- ui .clear_output :revert ()
157- stub (ui , ' clear_output' )
158148 end )
159149
160150 it (' focuses the appropriate window' , function ()
You can’t perform that action at this time.
0 commit comments