@@ -174,6 +174,8 @@ public MainPageViewModel()
174174 DismissSponsorPromptCommand = new RelayCommand ( ExecuteDismissSponsorPromptCommand ) ;
175175 TerminalAddCommand = new RelayCommand < ShellProfile > ( ( e ) =>
176176 {
177+ if ( Terminals . IsEmpty ( ) )
178+ IsTerminalViewOpen = true ;
177179 Terminals . Add ( new TerminalView ( e ?? TerminalSelectedProfile )
178180 {
179181 Tag = $ "Terminal { Terminals . Count } "
@@ -206,6 +208,8 @@ public MainPageViewModel()
206208 ( terminal as IDisposable ) ? . Dispose ( ) ;
207209 Terminals . Remove ( terminal ) ;
208210 SelectedTerminal = int . Min ( SelectedTerminal , Terminals . Count - 1 ) ;
211+ if ( Terminals . IsEmpty ( ) )
212+ IsTerminalViewOpen = false ;
209213 OnPropertyChanged ( nameof ( ActiveTerminal ) ) ;
210214 OnPropertyChanged ( nameof ( TerminalNames ) ) ;
211215 } ) ;
@@ -245,7 +249,20 @@ public MainPageViewModel()
245249 OnPropertyChanged ( nameof ( ShowStatusBar ) ) ;
246250 break ;
247251 }
248- } ;
252+ if ( e . PropertyName == nameof ( ActiveTerminal ) )
253+ {
254+ if ( ActiveTerminal is TerminalView termView )
255+ {
256+ GetTerminalFolder = termView . GetTerminalFolder ;
257+ SetTerminalFolder = termView . SetTerminalFolder ;
258+ }
259+ else
260+ {
261+ GetTerminalFolder = null ;
262+ SetTerminalFolder = null ;
263+ }
264+ }
265+ } ;
249266
250267 GeneralSettingsService . PropertyChanged += ( s , e ) =>
251268 {
0 commit comments