-
-
Notifications
You must be signed in to change notification settings - Fork 21.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
[OS] Add functions to determine standard I/O device type. #91201
Conversation
Note that unlike the regex, this approach will not work with manually inserted ANSI escape sequences in |
In this case, adding regex will not be straightforward. StdLogger is created before ClassDB init, and RegEx class can't be created before it's registered in ClassDB. |
f0c9469
to
c9a0a7c
Compare
static String exe_renames[] = { | ||
".console.exe", | ||
"_console.exe", | ||
" console.exe", | ||
"console.exe", | ||
String(), | ||
}; |
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.
Should we also support -console.exe
?
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.
It's not supported by wrapper, be I guess could be added.
godot/platform/windows/console_wrapper_windows.cpp
Lines 74 to 80 in b00e1cb
static PCWSTR exe_renames[] = { | |
L".console.exe", | |
L"_console.exe", | |
L" console.exe", | |
L"console.exe", | |
nullptr, | |
}; |
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.
Tested locally, it works as expected.
Test 1
bin/godot.linuxbsd.editor.x86_64 --path ~/Documents/Godot/test_pr_91201 < out.txt > out2.txt
Test 2
bin/godot.linuxbsd.editor.x86_64 --path ~/Documents/Godot/test_pr_91201 < out.txt &> out3.txt
Test 3
bin/godot.linuxbsd.editor.x86_64 --path ~/Documents/Godot/test_pr_91201 < out.txt
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.
Seems good to me.
Thanks! |
stdin
reads when not using wrapper (will return "invalid" type).stdio
read method.stdin
as raw data instead of UTF-8 encoded string.Required to filter escape sequences for the redirected streams (a filter similar to #90900, or probably can be filtered directly in the
rich_print
to avoid extra regex, will add it later as a separate PR).Production edit (keywords for easier searching): TTY, CLI, terminal