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
[BUG] stdout.terminalColumns
causes StdoutException
#512
Comments
@jibbers42 can you confirm the version configured in your path is 3.3.10 also? |
It used to be and I just now switched it back to test and be sure - same issue...
|
@jibbers42 the only thing I can think of is that the Dart version is different when you are running with FVM, can you run |
I didn't save the links because I wasn't confident it was related (maybe they were issues here or in other projects), but when originally searching for answers I got the impression that the work to switch how the process is launched, spawn vs start, might fix it. I'm not sure if that switch is actually happening or if it would fix it, just mentioning it in case it helps. |
@jibbers42 does your CLI call dart, or flutter through a separate process? |
I'd guess it's a pretty standard Windows setup
I was referring to however fvm runs dart and a change like #508. I'm trying to find whatever resource led me to think that might make a difference, but my google-fu is failing at the moment. |
@jibbers42 #508 has not been merged. Also, my question was in regard to what is your CLI doing. Because if your CLI starts a new process using a process manager, that could also be causing an issue due to the compatibility problem. But it might be tough to troubleshoot without knowing what the script is doing. |
Oops, I read "CLI" as "terminal" and didn't really understand the question... I had a look and the I'll try to create a minimal repro project... |
script.dart import 'dart:io';
void main() {
print('stdout.terminalColumns: ${stdout.terminalColumns}');
} I tested this script stand-alone - I didn't create a flutter project to set fvm to a specific version. Let me know if you'd like me to do those things... > dart --version
Dart SDK version: 2.18.6 (stable) (Tue Dec 13 21:15:14 2022 +0000) on "windows_x64"
> fvm dart --version
Dart SDK version: 2.18.6 (stable) (Tue Dec 13 21:15:14 2022 +0000) on "windows_x64"
> dart run .\script.dart
stdout.terminalColumns: 132
> fvm dart run .\script.dart
Unhandled exception:
StdoutException: Could not get terminal size, OS Error: The handle is invalid.
, errno = 6
#0 Stdout._terminalSize (dart:io-patch/stdio_patch.dart:172:7)
#1 Stdout._terminalColumns (dart:io-patch/stdio_patch.dart:165:35)
#2 Stdout.terminalColumns (dart:io/stdio.dart:228:30)
#3 main (file:///C:/Users/.../script.dart:4:43)
#4 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:297:19)
#5 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12) |
@jibbers42 I know what is happening; flutter is run through a process inside FVM, which is probably why that information is being lost. I suggest calling the flutter sdk directly the following way here in the documentation: https://fvm.app/docs/guides/running_flutter#call-sdk-directly |
If I understand correctly, that would be a shell alias, so perhaps use Is there a solution that can follow the flutter project to different users and machines and not introduce another way to run the script beyond |
For now, I'll just use the whole relative path to the direct sdk in the readme examples... Thanks for the help! |
Closing as 3.0 has been released. Check again and reopen the issue if needed. |
Before creating a bug report please make check the following
pub cache repair
. Close the terminal and try again.administrator
or withdeveloper
permissions.fvm doctor
if possible and add the output to the issue.Describe the bug
Running my cli app results in an error from
dartio
. It runs fine if I don't use fvm.I get the width of the terminal to make help output friendlier. The offending line is:
int get usageLineLength => min(stdout.terminalColumns, 90);
The error begins:
To Reproduce
Steps to reproduce the behavior:
fvm dart run .\bin\my_script.dart -h
Expected behavior
My script should run (show help in this case).
Running without fvm works fine:
dart run .\bin\my_script.dart -h
Logs
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: