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

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

Closed
RandalSchwartz opened this issue Feb 27, 2021 · 5 comments
Labels
in debugger Relates to the debug adapter or process of launching a debug session is enhancement
Milestone

Comments

@RandalSchwartz
Copy link

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"
@DanTup
Copy link
Member

DanTup commented Mar 1, 2021

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?

@DanTup DanTup added the awaiting info Requires more information from the customer to progress label Mar 1, 2021
@github-actions
Copy link

github-actions bot commented Apr 1, 2021

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.

@github-actions github-actions bot added the stale Will be closed soon if no response. label Apr 1, 2021
@RandalSchwartz
Copy link
Author

RandalSchwartz commented Apr 1, 2021

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.

@DanTup
Copy link
Member

DanTup commented Apr 1, 2021

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.

@DanTup DanTup added in debugger Relates to the debug adapter or process of launching a debug session is enhancement and removed awaiting info Requires more information from the customer to progress is bug stale Will be closed soon if no response. labels Apr 1, 2021
@DanTup DanTup added this to the On Deck milestone Apr 1, 2021
@DanTup DanTup 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 Apr 1, 2021
@DanTup
Copy link
Member

DanTup commented Apr 1, 2021

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.

@DanTup DanTup modified the milestones: On Deck, v3.23.0 May 13, 2021
@DanTup DanTup closed this as completed in f38e02c May 18, 2021
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 is enhancement
Projects
None yet
Development

No branches or pull requests

2 participants