Skip to content
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

How to remove "Shell terminated too quickly. The window will not be closed automatically." #1460

Closed
opossalite opened this issue Feb 8, 2024 · 4 comments · Fixed by #1479

Comments

@opossalite
Copy link

opossalite commented Feb 8, 2024

I'm wondering about behavior I'm having with Contour which doesn't happen in other terminals. When I open a new terminal and quickly type "exit", I get the message from the title. I will provide a screenshot here as well. How do I prevent this message from popping up? The terminal doesn't close until another key is pressed or I kill the window. Expected behavior is to exit as soon as the command is inputted, I don't get this message with alacritty, kitty, or wezterm. I'm sure this isn't a bug, but I don't see any reference to this online.

image

System info:
NixOS 23.11

@Yaraslaut
Copy link
Member

You can see some info from contour help page :

            [early-exit-threshold UINT]    If the spawned process exits earlier than the given threshold seconds, an error message will be printed and the window not closed immediately.
                                           [default: 6]

This message you see happens only if you try to exit immediately after opening the terminal, so running with contour early-exit-threshold 0 must solve the problem, also, what version of contour are you using?

@opossalite
Copy link
Author

Seems to be 0.3.12.262. Adding the early-exit-threshold argument fixes it, thank you. I'm not sure why this threshold exists though, what is the logic behind it being set at 6 seconds?

@opossalite opossalite changed the title How to remove "Shell terminated too quickly. The Window will not be closed automatically." How to remove "Shell terminated too quickly. The window will not be closed automatically." Feb 8, 2024
@Yaraslaut
Copy link
Member

Seems to be 0.3.12.262. Adding the early-exit-threshold argument fixes it, thank you. I'm not sure why this threshold exists though, what is the logic behind it being set at 6 seconds?

@christianparpart might tell some story about it, i think that it was introduced on the early stage of development for test purposes.

@christianparpart
Copy link
Member

Hi @TheTerrior. This was added because it MAY be that whatever application you spawn as main program in your terminal (usually the shell), can exit right at the startup. This leads to the user believing that the terminal is not working, because you don't see that it even was there, and even if you noticed that, the window would be closed too quickly to actually read any potential diagnostic error message, telling you, why the program terminated too quickly.

Contour since then added a guard that prevents too quick terminating apps to also terminate the terminal in order to allow the user to review the screen before finally closing it.

However, on our CI side, we must expect some tests to terminate quickly, so early-exit-threshold SECONDS was added to to be able to set it to 0, especially since in test-automation, there'll be no user to trigger input of any form, just to finish the integration-test.

Does this clarify its existence for you? Is there anything that you think might help improving user experience?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants