vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

Option to change the title of the integrated terminal in vscode for a launched C application?

Open ldarshan1991 opened this issue 4 years ago • 4 comments

Type: Debugger

Describe the bug

  • OS and Version: Windows 10
  • VS Code Version: 1.50.1
  • C/C++ Extension Version: 1.1.0-insider3
  • Other extensions you installed (and if the issue persists after disabling them):
  • A clear and concise description of what the bug is.

To Reproduce Please include a code sample and launch.json configuration. Steps to reproduce the behavior:

  1. Have launch configuration to launch an C application

{
    "launch": {
        // Use IntelliSense to learn about possible attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
            {
                "name": "App1",
                "type": "cppdbg",
                "request": "launch",
                "program": "${workspaceFolder}/path/to/the/executable/x86_64bi_linux-abc",
                "args": [
                    "102"
                ],
                "presentation": {
                    "hidden": false,
                    "group": "NonGDB",
                    "order": 1
                },
                "stopAtEntry": false,
                "cwd": "/another/path/where/necessary/data/file/is/present",
                "environment": [],
                "externalConsole": false,
                "MIMode": "gdb",
                "miDebuggerPath": "/path/to/gdb-8.1.2",
                "setupCommands": [
                    {
                        "description": "Enable pretty-printing for gdb",
                        "text": "-enable-pretty-printing",
                        "ignoreFailures": true
                    }
                ]
            }
		]
	}
}
  1. When I launch an application in vscode via launch.json. The application launches from the integrated terminal with the title of the terminal set to that application name.

image

Need an property in the launch.json to set my choice of name for the terminal?

Additional context If applicable, please include logging by adding "logging": { "engineLogging": true, "trace": true, "traceResponse": true } in your launch.json Add any other context about the problem here including log or error messages in your Debug Console or Output windows.

parent request raised in VSCode - https://github.com/microsoft/vscode/issues/109235

ldarshan1991 avatar Nov 10 '20 13:11 ldarshan1991

Thank you for filing this issue.

We will investigate adding terminalName to the launch.json and setting it for the RunInTerminal title.

This is where we set the title. https://github.com/microsoft/MIEngine/blob/ec52d600d5d4a5d9a2517aa392e0c1767ad49e55/src/MICore/Transports/RunInTerminalTransport.cs#L51

WardenGnaw avatar Nov 11 '20 16:11 WardenGnaw

Thanks @WardenGnaw for picking up this request.

ldarshan1991 avatar Nov 14 '20 09:11 ldarshan1991

This issue has been closed automatically because it has not had recent activity.

github-actions[bot] avatar May 13 '21 11:05 github-actions[bot]

Can we reopen this, I'd like to have this as it's very useful when debugging network applications. My terminal kind of looks like this now, and it's hard to differentiate between configurations: image

guusw avatar Apr 01 '24 05:04 guusw

As I explain in the referenced issue, it might be better implemented in vscode, but will see how it goes with their backlog of features etc. Consider upvoting it if you are interested 👍

dimateos avatar May 17 '24 07:05 dimateos

Hi, also upvoting for the same reason, as setting in settings.json

   "terminal.integrated.tabs.title": "${task}",

Doesn't affect the terminal opened by the launch.json task.

Prefixing the terminal title by the launch name will be a quality of life improvement for many of us that are doing parallele debugging.

something like the pseudo code

FormattableString.Invariant($"{getLaunchTaskName()} | cppdbg: {Path.GetFileName(options.ExePath)}");

pirpyn avatar Jul 03 '24 12:07 pirpyn