Terminal Crash on exit #13469

Closed
opened 2026-01-31 03:43:34 +00:00 by claunia · 4 comments
Owner

Originally created by @nmss on GitHub (Apr 15, 2021).

Windows Terminal version (or Windows build number)

Windows Terminal Version : 1.7.1033.0 (from Microsoft Store)

Other Software

No response

Steps to reproduce

With cmd.exe

  • open a cmd.exe tab in windows terminal
  • close it with exit 0

With powershell

  • open a powershell tab in windows terminal
  • close it with exit 0

note that it only crashes when the last tab is closed in this way

Expected Behavior

the window is closed

Actual Behavior

the window is closed and this error appear

image

Originally created by @nmss on GitHub (Apr 15, 2021). ### Windows Terminal version (or Windows build number) Windows Terminal Version : 1.7.1033.0 (from Microsoft Store) ### Other Software _No response_ ### Steps to reproduce With cmd.exe - open a cmd.exe tab in windows terminal - close it with `exit 0` With powershell - open a powershell tab in windows terminal - close it with `exit 0` note that it only crashes when the last tab is closed in this way ### Expected Behavior the window is closed ### Actual Behavior the window is closed and this error appear ![image](https://user-images.githubusercontent.com/1228204/114912737-a76cce80-9e20-11eb-94d0-5eb925c07334.png)
claunia added the Needs-TriageNeeds-Tag-Fix labels 2026-01-31 03:43:34 +00:00
Author
Owner

@nmss commented on GitHub (Apr 16, 2021):

I cannot reproduce anymore, maybe I just needed a system restart

@nmss commented on GitHub (Apr 16, 2021): I cannot reproduce anymore, maybe I just needed a system restart
Author
Owner

@sunshouxiang commented on GitHub (Apr 22, 2021):

This really reproduces for me but I got it fixed by adding something in ~/.bash_logout, e.g.,
local BASH_NR=$(pstree -p | grep bash | wc -l)
if [ "$BASH_NR" = "" ]; then
rm -rf /tmp/* 2>/dev/null
touch /tmp/logged_out_at_$(date +%Y%m%d-%H%M%S).txt
fi

@sunshouxiang commented on GitHub (Apr 22, 2021): This really reproduces for me but I got it fixed by adding something in ~/.bash_logout, e.g., local BASH_NR=$(pstree -p | grep bash | wc -l) if [ "$BASH_NR" = "" ]; then rm -rf /tmp/* 2>/dev/null touch /tmp/logged_out_at_$(date +%Y%m%d-%H%M%S).txt fi
Author
Owner

@sunshouxiang commented on GitHub (Apr 22, 2021):

The above does not help if I run any commands in the tab, so I have to exit from a clean tab as the final one.

@sunshouxiang commented on GitHub (Apr 22, 2021): The above does not help if I run any commands in the tab, so I have to exit from a clean tab as the final one.
Author
Owner

@strngtn commented on GitHub (Apr 28, 2021):

Have the same issue with Windows Terminal version 1.7.1033.0 on Windows 10 20H2

After running exit in the last tab(no matter PS or winPS or CMD), the window will crash instead of close.

@strngtn commented on GitHub (Apr 28, 2021): Have the same issue with Windows Terminal version 1.7.1033.0 on Windows 10 20H2 After running exit in the last tab(no matter PS or winPS or CMD), the window will crash instead of close.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13469