@@ -286,7 +286,7 @@ bool Pane::NavigateFocus(const Direction& direction)
286286// - <none>
287287// Return Value:
288288// - <none>
289- void Pane::_ControlClosedHandler ()
289+ void Pane::_ControlClosedHandler (int32_t exitCode )
290290{
291291 std::unique_lock lock{ _createCloseLock };
292292 // It's possible that this event handler started being executed, then before
@@ -301,10 +301,20 @@ void Pane::_ControlClosedHandler()
301301 return ;
302302 }
303303
304- if (_control.ShouldCloseOnExit ())
304+ // if (_control.ShouldCloseOnExit())
305+ // {
306+ // Fire our Closed event to tell our parent that we should be removed.
307+ // _closedHandlers();
308+ // }
309+ if (exitCode == 0 )
310+ {
311+ _closedHandlers (0 );
312+ }
313+ else
305314 {
306- // Fire our Closed event to tell our parent that we should be removed.
307- _closedHandlers ();
315+ wchar_t buffer[1024 ];
316+ StringCchPrintfW (buffer, 1024 , L" \n [process exited with code %8.08x]" , exitCode);
317+ _control.WriteOutput (buffer);
308318 }
309319}
310320
@@ -317,7 +327,7 @@ void Pane::_ControlClosedHandler()
317327void Pane::Close ()
318328{
319329 // Fire our Closed event to tell our parent that we should be removed.
320- _closedHandlers ();
330+ _closedHandlers (0 );
321331}
322332
323333// Method Description:
@@ -654,13 +664,13 @@ void Pane::_CloseChild(const bool closeFirst)
654664// - <none>
655665void Pane::_SetupChildCloseHandlers ()
656666{
657- _firstClosedToken = _firstChild->Closed ([this ]() {
667+ _firstClosedToken = _firstChild->Closed ([this ](auto && arg ) {
658668 _root.Dispatcher ().RunAsync (CoreDispatcherPriority::Normal, [=]() {
659669 _CloseChild (true );
660670 });
661671 });
662672
663- _secondClosedToken = _secondChild->Closed ([this ]() {
673+ _secondClosedToken = _secondChild->Closed ([this ](auto && arg ) {
664674 _root.Dispatcher ().RunAsync (CoreDispatcherPriority::Normal, [=]() {
665675 _CloseChild (false );
666676 });
0 commit comments