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
Implement a new console input system to fix an issue with the tmux send-keys command #255
Conversation
This prevents MultiAdmin from shutting down properly |
This is not related to issue #252, that issue is to do with mono trying to print to a non-existent console window, therefore causing an error, while this pull request appears to be related to something entirely different. The reason that MultiAdmin has been changed to use |
Hmm, when I debugged in mono, it returned Also I was debugging with default settings (enabled the new input system and disabled hiding console input) and it didn't throw an exception regarding As there's an issue with |
It's required to be cancelled for shutting down MultiAdmin.... It doesn't matter if there's console switching or what, but currently it's a big issue. I think instead, this should be fixed in Mono, instead of trying to make some janky workaround in MultiAdmin that breaks functionality in another place. |
I'd test it on .NET 5, since I haven't tested it on .NET 5 yet. |
Sounds like a good idea, it wouldn't be worthwhile to try to fix something that's already fixed elsewhere. I want to get MultiAdmin on .NET 5 released soon, but it'd require a huge change in how the releases are structured and I want there to be some sort of semi-stable release out for the new version first. Maybe a new config option to just use |
I think it's great, I'm going to do that after I get a result of testing the issue on .NET 5. |
I'm not sure whether it would be too confusing, but it could be a lot simpler for it to just be an integer value for selecting the input system, like using |
I've got a great result. It works perfectly on .NET 5 except it freezes on close. Probably it's the same thing that happened with LocalAdmin, it was falling in a loop on close. |
…ry 'use_new_input_system'
I think it's now ready to be reviewed. |
When you send some message to a tmux session, which runs MA, it reads the first key of the message and then falls in a loop with
Console.KeyAvailable
.Somehow
Console.KeyAvailable
returnsfalse
after the first key is read, this part of code causes the issueMultiAdmin/MultiAdmin/ServerIO/InputHandler.cs
Lines 106 to 109 in a64eec3
My fix is to just remove all calls to
WaitForKey(CancellationToken)
, however,Console.ReadKey()
always works and it blocks the task of reading input, are thoseCancellationTokenSource
s needed at all?Related to #252.
This PR implements a new console input system and removes the
use_new_input_system
config entry.The default value of the new
console_input_system
config entry isNew
(as before).