@@ -835,7 +835,12 @@ async fn run() -> Result<()> {
835835 if let DesktopApp :: Workspace ( workspace) = & app {
836836 queue_desktop_preferences_save ( workspace, & preferences_save_tx) ;
837837 }
838- if let Err ( error) =
838+ if app. promote_focused_workspace_session ( ) {
839+ scroll_accumulator = ScrollLineAccumulator :: default ( ) ;
840+ scroll_metrics_cache = SingleSessionScrollMetricsCache :: default ( ) ;
841+ window. set_title ( & app. status_title ( ) ) ;
842+ window. request_redraw ( ) ;
843+ } else if let Err ( error) =
839844 session_launch:: launch_validated_resume_session ( & session_id, & title)
840845 {
841846 desktop_log:: error ( format_args ! (
@@ -4829,6 +4834,21 @@ impl DesktopApp {
48294834 }
48304835 }
48314836
4837+ fn promote_focused_workspace_session ( & mut self ) -> bool {
4838+ let Self :: Workspace ( workspace) = self else {
4839+ return false ;
4840+ } ;
4841+ let Some ( card) = workspace. focused_session_card ( ) else {
4842+ return false ;
4843+ } ;
4844+ let session_id = card. session_id . clone ( ) ;
4845+ let mut single_session = SingleSessionApp :: new ( Some ( card) ) ;
4846+ single_session. initialize_resumed_session ( & session_id) ;
4847+ single_session. hydrate_resumed_session_from_disk ( & session_id) ;
4848+ * self = Self :: SingleSession ( single_session) ;
4849+ true
4850+ }
4851+
48324852 fn apply_session_event ( & mut self , event : session_launch:: DesktopSessionEvent ) {
48334853 if let Self :: SingleSession ( app) = self {
48344854 app. apply_session_event ( event) ;
0 commit comments