forked from aycabta/yamatanooroti
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Feature: Add CI for windows #25
Open
YO4
wants to merge
78
commits into
ruby:master
Choose a base branch
from
YO4:ci_for_windows
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in windows CI enviconments (Github Actions, Appveyor, CircleCI), it seems to standard handles not valid. use conin$/conout$ explicitly.
on console device, gets() returns console codepage string.
SetConsoleScreenBufferSize has a minimum buffer width limit by window width (pixels) derived from the font size. SetConsoleScreenBufferInfoEx do not seem to have that limitation. so to use SetConsoleScreenBufferInfoEx can avoid font size tweaking.
AttachConsole(), FreeConsole() ignores C runtime interrupt handler. If not addressed, the process will not catch Ctrl+C and will die immediately. Not identical to normal Ctrl+C behavior, but at least a minimal stop action can be performed.
new TESTOPTS --wait=seconds --timeout=seconds --windows=CONSOLE_TYPE --[no-]show-console --[no-]close-console[=COND]
We still support only command prompt window (conhost.exe). Windows Terminal support is planned. Consider legacy-conhost support to be meaningful even without Windows Terminal support, since it can alternatively check operation on older versions of Windows.
When testcase is omitted, @Terminal will be nil
In narrow console window, start up message shows like below: ``` +-----+ |Multi| |line | |REPL.| |promp| |t> | | | ``` When start_tarminal() with ```startup_message: 'Multiline REPL.'```, vterm.rb recieves startup message as stream, so window size is not matter. windows.rb can't recieve startup message as stream, only can retreive_screen(). retreive_screen recieves like: ```["Multi", "line", "REPL.", "promp", "t>", "", ...]``` This patch splits startup_message into every width characters to allow for correct comparisons. If there are wide widths or complex characters, they will fail to divide accurately. So it is not perfect. Nevertheless, the situation can be mitigated.
…imes from one testcase test_simple_dialog_at_right_edge at reline/test/reline/yamatanooroti/test_rendering.rb
If ```def teardown; close; end``` defined in testcase, close() occurs after close_console() which triggered by teardown block in WindowsTestcaseModule
This leak causes problems in the test_yamatanooroti of reline. To wait process terminate with timeout, use Process.detach and Thread#join(timeout)
YO4
force-pushed
the
ci_for_windows
branch
3 times, most recently
from
October 20, 2024 09:01
0862bca
to
5ea4970
Compare
successful_or_if_not_messageout() returns true otherwise raise exception or message output to stderr
YO4
force-pushed
the
ci_for_windows
branch
2 times, most recently
from
October 26, 2024 11:42
1c50d53
to
7cbf84c
Compare
new windows/wt.rb (split from windows/terminal.rb, new WindowsTerminal class) new windows/wmi.rb (WMI Win32_Process interface) new windows/windows-setup.rb (split from windows/windows.rb) change windows terminal pane split strategy. make 3 panes at once if sp --size parameter cached.
More lightweight pid searching process. More lightweight console keeping process. Bonus: child process terminate automatically when yamatanooroti abnormal stopped. before: search with commandline string via wmi Win32_Process after: Yamatanootori creates a named pipe and child process connects that. Then use GetNamedPipeClientProcessId()
Sometimes conhost v1(legacy mode conhost) changes console size when changing codepage. Probably the behavior is only at the transition between SBCS and DBCS.
can't delete running .exe
It seems to ```start /b``` enables ENABLE_VIRTUAL_TERMINAL_PROCESSING SetConsoleMode() flag. This affects to console behavior.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Current Status
original PR here
This PR make Yamatanooroti work in windows CI environment.
Now supports conhost(classic, V2) and conhost(legacy, V1).
Windows Terminal is still not supported but planned.
Windows Terminal support is important because of active development.
microsoft/terminal@1925173
https://github.com/microsoft/terminal/releases/tag/v1.22.2362.0
For Windows Terminal support, a different treatment is needed from for conhost support and will be handled in a separate PR.
To test using conhost, you can specify with
rake TESTOPTS="--windows=conhost"
.In the same way, using conhost(legacy) with
rake TESTOPTS="--windows=legacy-conhost"
.You can specify showing console reaction during testing with
rake TESTOPTS="--show-console"
And close console only for passed test with
rake TESTOPTS="--close-console=pass"
or never close with
rake TESTOPTS="--close-console=never"
Note: Naming consoles
Since the the Command Prompt Window was the only windows console, it was sufficient to call it console if necessary.
Windows Terminal is the new arrival and is referred to by its own name. What would be a reasonable name for the Command Prompt Window?
conhost.exe
provides the Command Prompt Window, so it can be distinguished by calling itconhost
as opposed toterminal
. Windows Settings App calls it Windows Console Host, so as a short form it is reasonable..By the way, the Command Prompt Window has 'legacy console mode'.
https://learn.microsoft.com/en-us/windows/console/legacymode
Legacy console mode provides older windows compatibility,
ConhostV1.dll
provides it.And there is
ForceV2
registry setting.So older conhost can be refered as
legacy
V1
, newer conhost can be refered asclassic
V2
.classic
is counterpart oflegacy
, it is taken from the Readme.md of Windows Terminal repository. But that term is not widely used.