Skip to content

Allow setting a default value for launch config's "console" field if not explicitly specified #3169

Closed

Description

@RandalSchwartz

Describe the bug
As instructed, I set "console" : "terminal" in my launch.json. I expected that running my command-line app would then send output to the integrated terminal, and accept typing as stdin for the app.

No, the stdout still went to the debug console, and I am unable to provide input.

To Reproduce
Steps to reproduce the behavior:

  1. Set launch.json as indicated.
  2. Start dart debugging a CLI app that prints to stdout, and reads from stdin.

Expected behavior
I expected that running my command-line app would then send output to the integrated terminal, and accept typing as stdin for the app.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • VS Code version: 1.53.2 (mac)
  • Dart extension version: 3.19.2
  • Dart/Flutter SDK version: Dart SDK version: 2.12.0-259.16.beta (beta) (Tue Feb 23 00:10:18 2021 +0100) on "macos_x64"

Activity

  1. DanTup commented on Mar 1, 2021

    @DanTup
    Member

    I've not been able to reproduce this, it seems to work from my testing:

    vziJjAl

    Could you try capturing a log ("Dart: Capture Debugging Logs") when launching the app?

  2. added
    awaiting infoRequires more information from the customer to progress
    on Mar 1, 2021
  3. github-actions commented on Apr 1, 2021

    @github-actions

    This issue has been marked stale because it is tagged awaiting-info for 30 days with no activity. Remove the stale label or comment to prevent the issue being closed in 10 days.

  4. RandalSchwartz commented on Apr 1, 2021

    @RandalSchwartz
    Author

    Aha. I see it. "debug":"console" must be not only be in a newly created launch.json (aside: why can't I set this globally?), but also doesn't trigger if you select the "debug" option from "run | debug" just above main(). But with those caveats, the feature does work... it's just an annoying extra step to have to edit launch.json for each new project.

  5. DanTup commented on Apr 1, 2021

    @DanTup
    Member

    but also doesn't trigger if you select the "debug" option from "run | debug" just above main()

    Ah yes, that's because those are their own launch configurations, they're not the same as using the commands (which run the selected confirmation from the debug side bar).

    You can, however, add custom code lens links (see https://dartcode.org/docs/custom-codelens/), so you could have "Run in Terminal". / "Debug in Terminal" links there.

  6. added
    in debuggingRelates to the debug adapter or process of running debug sessions
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    and removed
    awaiting infoRequires more information from the customer to progress
    staleWill be closed soon if no response.
    on Apr 1, 2021
  7. added this to the On Deck milestone on Apr 1, 2021
  8. changed the title [-]"console" : "terminal" not using integrated terminal for debugging[/-] [+]Allow setting a default value for launch config's "console" field if not explicitly specified[/+] on Apr 1, 2021
  9. DanTup commented on Apr 1, 2021

    @DanTup
    Member

    aside: why can't I set this globally?

    Sounds like a fair request - I'll reuse this issue for having an option to set a default, for if it's not specified on the launch config. That would also make the default Run/Debug codelens links use it.

  10. modified the milestones: On Deck, v3.23.0 on May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in debuggingRelates to the debug adapter or process of running debug sessionsis enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions