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

Empty window opens with internalConsole during debug #7528

Open
csorvagep opened this issue May 15, 2021 · 10 comments
Open

Empty window opens with internalConsole during debug #7528

csorvagep opened this issue May 15, 2021 · 10 comments
Labels
debugger more info needed The issue report is not actionable in its current state

Comments

@csorvagep
Copy link

Bug type: Debugger

Describe the bug

  • OS and Version: Windows 10 20H2
  • VS Code Version: 1.56.2
  • C/C++ Extension Version: 1.4.0-insiders

After setting the launch.json as the following, an external window is opened at debug. All output appears in the debug console, but an empty console window is there.

    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug (win)",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "${command:cmake.launchTargetPath}",
            "args": [ ],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "console": "internalConsole",
            "internalConsoleOptions": "openOnSessionStart"
        }

I looked up the documentation for the launch.json, but there is no mention of "console" option, only the old "externalConsole" option is there, which is deprecated.

@sean-mcmanus
Copy link
Collaborator

"console" got added recently. The documentation hasn't gotten updated yet.

@csorvagep
Copy link
Author

Yes I thought so, since this in on insiders. I've only wrote that, to ensure that I've looked it up and creating an issue is not my first thing. :)

@WardenGnaw
Copy link
Member

Documentation is currently in the intellisense of the launch.json.

image
image

The behavior you are seeing seems to be set to newExternalWindow, but I am unable to recreate the new window showing up with just internalConsole

@WardenGnaw WardenGnaw added debugger more info needed The issue report is not actionable in its current state labels May 17, 2021
@csorvagep
Copy link
Author

Yes, the window is similar to a newExternalWindow (so it's not an externalTerminal window) but all output appears in the debug console.

I've created a simple test executable project with cmaketools quick start, then placed a breakpoint on the "Hello, world!" line. Created a windows launch configuration, set the program to: ${command:cmake.launchTargetPath} and the console to internalConsole. After starting a debugging session an empty window opens and the focus is on that window. (that is the annoying part). After continuing the program the text appears in the debug console, and the window closes.

Should I copy some logs or else in order to reproduce?

@WardenGnaw
Copy link
Member

Can you share the simple test project, steps to build and the launch.json if its different from the one above?

@csorvagep
Copy link
Author

I'm using the CMakeTools extension for the project generation and build:

  • Command palette: CMake: Quick Start, set project name, executable target
  • Kit selected: Visual Studio Community 2019 - amd64
  • Configure and build (or F7)
  • Place breakpoint on line 4
  • Run and Debug panel create a launch.json file link, C++ (Windows)
  • Change program in launch.json to ${command:cmake.launchTargetPath} and console to internalConsole
  • Debug the program

Here are the generated files:
main.cpp:

#include <iostream>

int main(int, char**) {
    std::cout << "Hello, world!\n";
}

CMakeLists.txt:

cmake_minimum_required(VERSION 3.0.0)
project(dbgtest VERSION 0.1.0)

include(CTest)
enable_testing()

add_executable(dbgtest main.cpp)

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)

launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(Windows) Launch",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "${command:cmake.launchTargetPath}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "console": "internalConsole"
        }
    ]
}

@csorvagep
Copy link
Author

@WardenGnaw, should I provide more info to reproduce this?

@csorvagep
Copy link
Author

This is still kind of annoying, especially with a graphical interface, this adds an extra window.

@Anutrix
Copy link

Anutrix commented Oct 29, 2021

Still happens on stable Windows 11 Pro 21H2 22000.282.
Even crashes some applications. See godotengine/godot#54076.

@Anutrix
Copy link

Anutrix commented Oct 29, 2021

Requirements for the bug to be reproduced:

  • The default terminal application to Windows Terminal should be set to Windows Terminal.
  • Use launch.json i.e debug options to run applications.

Directly running from VSCode's Windows Terminal has no issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debugger more info needed The issue report is not actionable in its current state
Projects
None yet
Development

No branches or pull requests

4 participants