# HG changeset patch
# User Patrik Svestka <patrik.svestka@gmail.com>
# Date 1519041731 -3600
# Mon Feb 19 13:02:11 2018 +0100
# Branch jv
# Node ID 9a0f13223e3964a93233ed9de11854e612ce78a0
# Parent 808f3bb10ef4a78676ea9520fb28f8f03d4c019f
version 1.6.3 Added new configuration option _numeric.start_sleep_in_debug for the user to adjust the refresh rate in the asynchronous mode
Added Out.flush() and Error.Flush() so the streams are flushed
diff -r 808f3bb10ef4 -r 9a0f13223e39 smalltalk.bat
a
|
b
|
|
53 | 53 | :: Versions = |
54 | 54 | :: ========== |
55 | 55 | :: This script |
56 | | SET batch_script_version=1.6.1 |
| 56 | SET batch_script_version=1.6.3 |
57 | 57 | :: Smalltalk/X |
58 | 58 | SET stx_version_default=6.2.6 |
59 | 59 | :: Do not change following line, $STX_VERSION_DEFAULT serves |
diff -r 808f3bb10ef4 -r 9a0f13223e39 smalltalk.cfg
a
|
b
|
|
194 | 194 | |
195 | 195 | # error |
196 | 196 | stdout_ErrorBackgroundColor=Black |
197 | | stdout_ErrorForegroundColor=Red |
198 | | No newline at end of file |
| 197 | stdout_ErrorForegroundColor=Red |
| 198 | |
| 199 | # ------------------------------------------------------------------------------------------- |
| 200 | # Do not touch, unless you know what you are doing settings |
| 201 | # ------------------------------------------------------------------------------------------- |
| 202 | # Sets, in milliseconds, sleep periods in powershell while using custom StX switches |
| 203 | # 50 milliseconds was found empirically |
| 204 | # - less than 50ms takes heavy toll on the CPU |
| 205 | # - more than 50ms the stdout and stderror are refresh rate is quite slow |
| 206 | __numeric.start_sleep_in_debug=50 |
| 207 | No newline at end of file |
diff -r 808f3bb10ef4 -r 9a0f13223e39 smalltalk.ps1
a
|
b
|
|
22 | 22 | $log_file_width = [environment]::GetEnvironmentVariable("stx.__numeric.log_file_width") |
23 | 23 | |
24 | 24 | |
| 25 | # Defines start-sleep periods while running custom switches |
| 26 | $start_sleep_period = [environment]::GetEnvironmentVariable("stx.__numeric.start_sleep_in_debug") |
| 27 | |
| 28 | |
25 | 29 | # ======================================================= |
26 | 30 | # Adjust all variables to PowerShell style $true/$false = |
27 | 31 | # ======================================================= |
… |
… |
|
233 | 237 | $stx_switch, |
234 | 238 | [Parameter(Mandatory=$true)] |
235 | 239 | [String]$logging_function, |
| 240 | [Parameter(Mandatory=$true)] |
| 241 | [Int]$start_sleep_period, |
236 | 242 | [Parameter(Mandatory=$false)] |
237 | 243 | [String]$verb |
238 | 244 | ) |
… |
… |
|
338 | 344 | |
339 | 345 | # Starting process with no return value |
340 | 346 | [Void]$process.Start() |
341 | | |
| 347 | |
342 | 348 | # Begin async read events |
343 | 349 | $process.BeginOutputReadLine() |
344 | 350 | $process.BeginErrorReadLine() |
345 | | |
| 351 | |
346 | 352 | # loop till application exited |
347 | 353 | # used for logging into the stdout/stderr |
348 | 354 | # Note: the timeout has been tested for speed vs. process usage -> 50ms does not use CPU that much + the output is reasonably fast |
349 | 355 | while (!$process.HasExited) { |
350 | | Start-Sleep -Milliseconds 50 |
| 356 | [Console]::Out.Flush() |
| 357 | [Console]::Error.Flush() |
| 358 | Start-Sleep -Milliseconds $start_sleep_period |
351 | 359 | } |
352 | 360 | |
353 | 361 | # Can not be used as it would wait for the exit of stx executable |
… |
… |
|
495 | 503 | # getting rid of all the double quotes around stx switches (were added in batch file) |
496 | 504 | $stx_switch = $stx_switch -replace '"([-]+\w+)"', "`$1" |
497 | 505 | |
498 | | $exit_code = DebugProcessExecute -executable $executable -stx_switch $stx_switch -logging_function $logging_function |
| 506 | $exit_code = DebugProcessExecute -executable $executable -stx_switch $stx_switch -logging_function $logging_function -start_sleep_period $start_sleep_period |
499 | 507 | |
500 | 508 | } Else { |
501 | 509 | $command = @" |