-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Terminal hangs on exit with 'process exited with code 127' message #4573
Comments
Hey there! This is, unfortunately, by design; it's highly conserved across different types of shells (bash, zsh, powershell and CMD all do the same thing) and the behavior of not closing the tab is in line with Ubuntu's terminal: #4223 (comment) |
Hi, When a terminal only support tabs, as it was before splits landed, this is not too problematic because I can open a new tab and close the dead one (not ideal but acceptable). But now that splits are supported, closing a tab might mean loosing work since a tab might contain more than one terminal. There seem to be an action to close a pane here but this should have better default behavior. My proposal for this would be
On other related comments like this one the default behavior of never closing is suppose to exist to prevent a terminal from closing on startup because of a miss configuration on the shell. This behavior should never be lost even if proposal number 2 gets implemented. I know I could place something like this inside my if [ "$SHLVL" = 1 ]; then
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi
exit 0 If there already exist a way to achieve any of my proposals please point me on the right direction. |
Hey so for the record, we already have a key bound to "close pane" by default, and have for some time now :) Ctrl+Shift+W, which is the default keybinding for /cc @DHowett-MSFT, because |
Thanks for the quick response, Ctrl+Shift+W does close the dead pane/tab but I still think As for |
@carragom Oh, that explains it - If you want it for all your profiles, you could try the following: {
"profiles": {
"defaults": {
"closeOnExit": "always"
},
"list": [
// all your profiles go here
]
}
} |
Thanks a lot, when placing the |
By me, the |
I'll add that this is happening under powershell when it's not expected, for example running a python script and hitting "Ctrl+C" to kill the script. When this happens it requires me to open a new terminal tab and re-navigate to my working directory. |
@jaallen did you install powershell with scoop or dotnet global, or as a standard MSI? |
@DHowett Was installed via standard MSI |
Huh. That's unexpected. Usually we see "^C terminates everything, even things I didn't want it to" with the two powershell wrappers from scoop or dotnet global. |
In that case, it's been a couple years since this machine was rebuilt, so it's possible I did some powershell gymnastics at some point that could have created this. Let me do some deep-diving and I'll report back. |
@DHowett Unfortunately I don't have much else to add. As far as I can tell, I'm just using the built-in powershell without any additional addons or modifications. When I ctrl+c from a hung python script, it prints code 3221225786 and closes the session on that tab. Let me know if I can provide anything specifically that might be of any help. |
@jaallen hmm. If this is PowerShell 7, can you run...
(I hope you're on 7 :P) |
@DHowett Unfortunately....I'm not lol Running the above command, I get the following:
The $PSVersionTable shows me at 5.1.18362.752 |
Can confirm that this occurs for me when prematurely terminating a basic cmdlet with CTRL+C as well. I have installed from the Microsoft App Store in my case. |
I like it that Terminal does not close if there was an error, this can be extremely helpful when you least expect it and I have always used a batch file shortcut I'm currently testing if |
Hi I'm getting this issue too in wsl ubuntu. When I run a script and it fails it exits with [process exited with code 1] The entire shell terminates and I'd prefer to be able to press a hotkey to restart the shell in the same location. |
@chinwobble You're looking for something more like #4772 |
I added an alias called "exit" on my .bash_profile: alias exit="exit 0". It solved the problem for me. |
Hi!
I've noticed that on newer releases(starting from 0.8.x) when you try to close the terminal(with exit command or ctrl+d) after executing a command that returned an error status code, the tab hangs with the message:
[process exited with code
This happens on wsl and cmd.
Environment
Steps to reproduce
Execute from cmd a command that produce an error then try to close with exit command: e.g:
Same behavior in WSL when exit or ctrl+d:
Expected behavior
Windows Terminal tab should be closed.
Actual behavior
Windows Terminal tab freeze.
The text was updated successfully, but these errors were encountered: