-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
echo TTY mode disabled for launched processes #16300
Comments
@andschwa, can you share a small C# repro we can use to confirm the problem and verify when it's fixed? I tried: var p = Process.Start("bash");
p.WaitForExit(); but I can type fine in the launched process. |
@pallavit, once @andschwa provides a repro, could you take a look at this? My guess is we need to change how we handle initializing/uninitializing our terminal attributes, and that we need to reset the attributes in response to a variety of signals. For example, rather than only setting the attributes at start and unsetting them at exit, we could handle signals like SIGTTOU, SIGTTIN, etc., setting the attributes back to the original values, and then the next time I/O is performed, re-call our initialize operation to set the attributes back. Or something like that. Related, we don't do a good job today with a console app that's been put into the background, as our read operations trigger EIO errors (see the man page for read for details)... for example, try creating a simple C# app that sits in a Console.ReadLine/Console.WriteLine loop and then launch it as a background process. |
@stephentoub Sure, I will take a look. @andschwa Please share a repro. |
This repros with the internal project you should both have access to; however, I understand the additional amount of complexity involved with said project. I'll assign one of our contractors to debug this until we can repro outside said project. @palladia Pulling you into this discussion, I've assigned our linked issue to you. In order to fix this, the CoreFX team needs a repro outside our project. |
@pallavit This gist reproduces what we're seeing. If So for our project, if you try to launch Bash, you can't actually use it (until you've executed Thanks for the repro @palladia. |
@stephentoub Any movement on this? It makes self hosting a bit of a pain. |
This is assigned to @pallavit. |
@andschwa I have not had a chance to look at this yet as I have been busy with some feature work. I will try to get to this ASAP. |
Just checking, thanks guys! |
Along a really similar vein, when most interactive apps are run and then closed (say, Vim), If this isn't I've verified that
|
This is likely very related. We likely need to handle some of the signals I mentioned, and potentially SIGCONT, to redo some of the initialization previously done, including re-sending KeypadXmit: https://github.com/dotnet/corefx/blob/master/src/System.Console/src/System/ConsolePal.Unix.cs#L618. |
|
I'll take a look at this one, Pallavi. Thanks. |
Similar to #15991, if
Console.ReadKey()
has been used by a .NET program, theecho
TTY mode is disabled. To resolve the prior issues, dotnet/coreclr#2561 re-enabled theecho
mode on program shutdown.However, we've run into a different scenario: launching a process from the .NET program inherits the TTY modes. So if you launch Bash from the .NET program, you can't type in it until you've explicitly re-enabled
echo
.The text was updated successfully, but these errors were encountered: