-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Added capture of server console input for hotkeys #2085
Added capture of server console input for hotkeys #2085
Conversation
fc11c1f
to
492993d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the behaviors I find lacking when using a console :
- Unable to use arrow to navigate between inputs
- Unable to use enter to create an empty line
Also noticed some errors while testing the feature;
Step to reproduce : Press tab
then press delete
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Text.StringBuilder.Remove(Int32 startIndex, Int32 length)
at NitroxServer_Subnautica.Program.<HandleConsoleInput>d__4.MoveNext() in NitroxServer-Subnautica\Program.cs:line 204
Step to reproduce : Open server in launcher wrap
mode
System.IO.IOException: Invalid Descriptor
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.Console.set_TreatControlCAsInput(Boolean value)
at NitroxServer_Subnautica.Program.<StartServer>d__3.MoveNext() in NitroxServer-Subnautica\Program.cs:line 53
5e3a7cb
to
09000c1
Compare
09000c1
to
b037b2e
Compare
65a2c05
to
ad89813
Compare
ad89813
to
8117621
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM CW
Hotkeys
Escape
will clear the input line.Ctrl+C
will clear the input line. If no input, will terminate the server and consoleCtrl+D
will terminate the server and consoleHome
Move cursor to start of inputEnd
Move cursor to end of inputUp Arrow
Go backward (in time) of input historyDown Arrow
Go forward (in time) of input historyLimitations
The input line only shows up correctly when it doesn't wrap to the next line. I see this as a minor issue because you can increase width of console or paste-in large inputs.
Possible improvements
Tasks left
PR refers to #1489