question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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 https://github.com/Dart-Code/Dart-Code/issues/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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
DanTupcommented, Jan 10, 2022

Now shows this during launch:

Screenshot 2022-01-10 at 10 31 23

1reaction
DanTupcommented, 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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run Dart Console Application In Terminal with Visual Studio ...
Any help in achieving the goal of running a Dart file in the terminal using the Run button would be greatly appreciated. If...
Read more >
Settings - Dart & Flutter support for Visual Studio Code
Options: "debugConsole" , "terminal" or "externalTerminal" . Default: "debugConsole" . Whether to run Dart CLI apps in the Debug Console or a terminal....
Read more >
Debugging Flutter apps programmatically
This doc describes debugging features that you can enable in code. For a full list of debugging and profiling tools, see the Debugging...
Read more >
New features in Android Studio Preview - Android Developers
Preview versions of Studio should work with any compatible stable version of AGP. However, if you're using a preview version of AGP, you...
Read more >
Setup Visual Studio Code's Network Connection
Warning : This is dangerous and not recommended, since it opens the door to security issues. Legacy proxy server support. Extensions don't benefit...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found