Skip to content
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

terminal and externalTerminal console configuration should warn that they are not supported for Flutter #3767

Closed
romaomb opened this issue Jan 5, 2022 · 6 comments
Labels
in debugger Relates to the debug adapter or process of launching a debug session in flutter Relates to running Flutter apps is enhancement
Milestone

Comments

@romaomb
Copy link

romaomb commented Jan 5, 2022

Describe the bug:
It seems that whenever we set "console": "externalTerminal" or "console": "terminal" in the launch.json for Flutter apps, the configuration is being ignored and the Flutter logs are displayed in the Debug Console, even if you add "dart.cliConsole": "externalTerminal" in the settings.json. It's working fine for Dart apps, though.

@DanTup, could it be related to #3434?

To Reproduce:

  1. Create a Flutter app
  2. Create a launch configuration and set console to terminal or externalTerminal:
{
    "configurations": [
        {
            "name": "Flutter",
            "type": "dart",
            "request": "launch",
            "program": "lib\\main.dart",
            "console": "externalTerminal"
        }
    ]
}
  1. The logs will be shown in the Debug Console.

Expected behavior
See the Flutter logs in the selected terminal. For me, the most important thing is externalTerminal, since it helps me a lot with my windows placement (vscode | emulator + terminal)

Versions:

  • Windows 10
  • VS Code version: 1.63.2
  • Dart extension version: v3.32.0
  • Dart/Flutter SDK version: Dart 2.15.1 | Flutter 2.8.1
@romaomb romaomb added the is bug label Jan 5, 2022
@DanTup
Copy link
Member

DanTup commented Jan 5, 2022

terminal/externalTerminal are not supported for Flutter apps because for debugging the extension needs to own the process (since we communicate with it using JSON).

Can you clarify why you're trying to run in this mode? The usual reason is to read from stdin but for Flutter the app may be running on another device, so you wouldn't have direct access to stdin anyway.

@DanTup DanTup added awaiting info Requires more information from the customer to progress and removed is bug labels Jan 5, 2022
@DanTup DanTup changed the title terminal and externalTerminal console configuration not working as expected terminal and externalTerminal console configuration not working for Flutter Jan 5, 2022
@DanTup
Copy link
Member

DanTup commented Jan 5, 2022

Sorry, I just noticed you explained this in your message:

since it helps me a lot with my windows placement (vscode | emulator + terminal)

However I'm still not certain what the goal is. When running using the external terminal you'll lose the ability to evaluate expressions or see structured error output, so I think the only thing that would show up in the terminal (if it were possible to run this way) would be the output of print statements?

@romaomb
Copy link
Author

romaomb commented Jan 10, 2022

Yeap, now that I'm thinking again, it does seem impractical. I was just trying to condensate everything in a single screen, having the terminal with the logs below the emulator and the vscode filling up the rest of the screen, something like:

Row(children: [
    vscode,
    Column(children: [
        emulator,
        terminal,
    ],),
],),

Which would be "the same" as running from the terminal, but then I lose some of the plugin's beauty.

Maybe then we could have a new "type": "flutter" that doesn't accept "console" or something that would alert/inform the user that Flutter doesn't support terminal/externalTerminal.

@DanTup
Copy link
Member

DanTup commented Jan 10, 2022

Using "type": "flutter" is a little complicated, as we generally decide whether a project is Flutter or not during the resolution of the debug config (so that you can just press F5 when you have a .dart file open and get the right thing regardless of project type). Having an additional type would also force the user to select between Dart or Flutter if they hit F5 with no files open (whereas now we call dart "Dart & Flutter").

or something that would alert/inform the user that Flutter doesn't support terminal/externalTerminal.

That's valid - it shouldn't silently ignore it. I'll use this issue for adding a warning.

Unfortunately, until VS Code supports multiple Windows (which I think lots of people want, but may be blocked on electron) I don't think there's a great solution to this. When it does, I would expect you'd be able to detach the Debug Console and put it wherever you'd like though, which probably addresses your need?

@DanTup DanTup changed the title terminal and externalTerminal console configuration not working for Flutter terminal and externalTerminal console configuration should warn that they are not supported for Flutter Jan 10, 2022
@DanTup
Copy link
Member

DanTup commented Jan 10, 2022

Now shows this during launch:

Screenshot 2022-01-10 at 10 31 23

@DanTup DanTup closed this as completed in 88fd008 Jan 10, 2022
@DanTup DanTup added this to the v3.34.0 milestone Jan 10, 2022
@DanTup DanTup added in debugger Relates to the debug adapter or process of launching a debug session in flutter Relates to running Flutter apps is enhancement and removed awaiting info Requires more information from the customer to progress labels Jan 10, 2022
@bvoq
Copy link

bvoq commented Mar 13, 2023

helped me, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in debugger Relates to the debug adapter or process of launching a debug session in flutter Relates to running Flutter apps is enhancement
Projects
None yet
Development

No branches or pull requests

3 participants