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

Specify terminal group for integrated terminal in launch configuration #68123

Open
markm77 opened this issue Feb 7, 2019 · 19 comments
Open

Specify terminal group for integrated terminal in launch configuration #68123

markm77 opened this issue Feb 7, 2019 · 19 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues under-discussion Issue is under discussion for relevance, priority, approach
Milestone

Comments

@markm77
Copy link

markm77 commented Feb 7, 2019

It is great to see that task configurations now allow the specification of terminal group (#47265) - works well from my initial testing. Can you please also allow launch configurations to specify terminal group when using the integrated terminal for debug and start/stop?

See my comment here: #47265 (comment)

@vscodebot
Copy link

vscodebot bot commented Feb 7, 2019

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@vscodebot vscodebot bot added the terminal General terminal issues that don't fall under another label label Feb 7, 2019
@markm77
Copy link
Author

markm77 commented Feb 14, 2019

A further comment: I guess perhaps the most logical thing would be to simply support the same presentation group of options as for tasks (applicable only when using integrated terminal)...?

https://code.visualstudio.com/docs/editor/tasks#_output-behavior

@Tyriar
Copy link
Member

Tyriar commented Mar 31, 2019

I'm not sure we want this group concept proliferating to everything @alexr00? Split APIs for the terminal will likely look more like the view column APIs.

@Tyriar Tyriar added debug Debug viewlet, configurations, breakpoints, adapter issues under-discussion Issue is under discussion for relevance, priority, approach labels Mar 31, 2019
@markm77
Copy link
Author

markm77 commented Mar 31, 2019

Please when considering this realise how currently painful it is with compound launch configs that launch multiple integrated terminals. You are forever switching between terminals (whose order is a bit random). Anything that allows a compound launch config to launch integrated terminals in side-by-side clusters to group related terminals visually would do the job. Groups seemed the perfect solution but then I don't understand how the view column APIs work (are they for creation of a dynamic grid of terminals like the group concept or just a static grid? These two concepts are different and complementary). Also fragmentation between the operation of integrated terminals for tasks and launch configurations doesn't seem good?

@markm77
Copy link
Author

markm77 commented Mar 31, 2019

Just to give some thoughts on the concepts and possible roadmap here.

I think there is a need to support a dynamic grid of terminals that grows and shrinks as associated tasks or debug configs are started/stopped etc. (Growing or shrinking refers here to number of terminals not UI boundaries which are assumed fixed.) That is for me what the whole group concept is about. I think the group concept is great and could usefully be extended to be a 2D grid and support position ordering etc.

This group concept can be seen as completely independent of and complementary to the useful idea of a static UI arrangement of terminals which persists between sessions of VS Code and which could ultimately be 3D (i.e. stacks of 2D grids like we have stacks of 1D grids today) or something else you are working on. Each terminal in the static arrangement could itself be a group - possibly empty (a placeholder) and awaiting its first dynamic member (task or launch config starting). Note that creating a static mapping between a particular terminal and a task or launch config, a useful function which cannot be done today, is then as simple as assigning a group name to both.

Ultimate support for static arrangements of terminals with nested dynamic grids (groups) as described here seems to me a possible ultimate aspiration and would be very powerful indeed. It creates a flexible way of expressing the relationships between terminals and tasks/debug configs that use them. Which increases the usefulness and usability of both integrated terminals and tasks/debug configs. Done well, I think this would be a killer feature for VS Code vs other IDEs.

@weinand
Copy link
Contributor

weinand commented Mar 31, 2019

@markfinlabs Please be aware that in contrast to tasks, launch configurations do not know anything about terminals. If a debugger supports launching in the integrated terminal, this is an implementation detail of the debugger. And the launch config properties related to terminals are part of the debugger's JSON schema, not part of VS Code's schema.
So VS Code is not in a position to introduce a "terminal group" property in all launch configs. Only debugger extensions could start to support this property.

The only thing we (VS Code) could do is to add the notion of a "terminal group" to the DAP request "runInTerminal" that many debug adapters use to run something in the integrated terminal.

@markm77
Copy link
Author

markm77 commented Mar 31, 2019

Thanks for the reply and the additional info. Would it make sense to expose the same presentation property (https://code.visualstudio.com/docs/editor/tasks#_output-behavior) used by tasks as a runInTerminal argument when argument kind is set to integrated terminal? (Would help unify use of integrated terminals between tasks and debug.)

presentation would capture current and future options relating to the group feature and other terminal display choices and ensure we don't have this discussion about alignment again. : )

@weinand
Copy link
Contributor

weinand commented Mar 31, 2019

A specified "presentation property" in the "runInTerminal" request makes only sense if the specification is "universal" (independent from VS Code). If it is very specific to VS Code, we do not want to include it in the DAP.
But in that case we could consider to support passing an opaque option bag via the "runInTerminal" request.

@markm77
Copy link
Author

markm77 commented Mar 31, 2019

Okay, got it, DAP is a general protocol which I didn't know much about which I guess allows people to create debug profiles that work with multiple IDEs. So I see why this has to be an IDE-specific option bag for enhanced experience with VS Code.

I would definitely support adding presentation or similar as an opaque option bag : ).

@alexr00 alexr00 removed their assignment Oct 1, 2019
@Tyriar Tyriar removed their assignment Oct 8, 2019
@Tyriar Tyriar removed the terminal General terminal issues that don't fall under another label label Oct 8, 2019
@markm77
Copy link
Author

markm77 commented Oct 14, 2019

Just to note, on StackOverflow, there is a desire to be able to clear the integrated terminal when starting debugging.
https://stackoverflow.com/questions/56619836/vscode-clear-integrated-terminal-when-debug-starts
I also need this functionality, particularly when using Jest for unit testing.
I believe the above proposal for support of presentation via an opaque option bag would solve this issue. 😀

@tommitytom
Copy link

Has there been any progress made on this? I just started working with compound debugging and it seemed obvious that they would start in terminals side by side! Is there a way to manually arrange the terminals once debugging has started?

@ldarshan1991
Copy link

Has there been any progress made on this? I just started working with compound debugging and it seemed obvious that they would start in terminals side by side! Is there a way to manually arrange the terminals once debugging has started?

Is there a way to merge the 2 integrated terminals into one integrated terminal so that they split into two?
At least as a temporary workaround until a cleaner solution is provided.

@samuelms1
Copy link

Is there any update on this? Like @tommitytom, I just got started on compound debugging and it would be really nice to have them split. There doesn't appear to be a way to split them after they've started to run like @ldarshan1991 suggested. Thanks for hearing me out. :D

@jSadoski
Copy link

jSadoski commented Feb 8, 2022

Because this shows up first for me when searching, it seems like presentation is now available on debug tasks & compounds:

presentation - using the order, group, and hidden attributes in the presentation object, you can sort, group, and hide configurations and compounds in the Debug configuration dropdown and in the Debug quick pick.

However, I couldn't get this to work, despite the string between tasks.json and launch.json. I'm hoping to see some way to do this soon.

https://code.visualstudio.com/docs/editor/debugging#_launchjson-attributes

@weinand weinand added this to the Backlog milestone Nov 1, 2022
@weinand weinand assigned roblourens and unassigned weinand Nov 1, 2022
@roblourens
Copy link
Member

That presentation group is not related to the terminal group. We still need DAP support for something like this.

@nbelakovski
Copy link

Just wanted to add that I've come up with something of a workaround for this using editor group and editor terminals. After I launch my compound debug and the new integrated terminals are created, I drag them out into the editor area to make them separate tabs, and then use View -> Editor Layout -> Grid 2x2 so that I can see both terminals side by side.

Would be great if they could launch directly into split panes, but this works for now.

@airstrike
Copy link

I was just digging into this as I start Advent of Code with ReScript which requires two scripts to run in parallel npm run res:dev and npm run dev. It seems to be achievable with vscode today, so sharing the below in case helpful.

I'm actually using bun instead of npm and it works fine too (just comment / uncomment the two lines accordingly)

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "ReScript Watcher",
            // "type": "npm",
            // "script": "res:dev",
            "type": "shell",
            "command": "bun run res:dev",
            "isBackground": true,
            "problemMatcher": [],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "presentation": {
                "group": "dev",
            }
        },
        {
            "label": "Vite Server",
            // "type": "npm",
            // "script": "dev",
            "type": "shell",
            "command": "bun run dev",
            "isBackground": true,
            "problemMatcher": [],
            "group": "build",
            "presentation": {
                "group": "dev",
            }
        },
        {
            "label": "Run dev tasks",
            "dependsOn": [
                "ReScript Watcher",
                "Vite Server"
            ],
            "dependsOrder": "parallel",
            "problemMatcher": [],
            "presentation": {
                "group": "dev",
                "reveal": "always",
                "panel": "shared"
            }
        }
    ]
}

@leobaldoneto
Copy link

I was just digging into this as I start Advent of Code with ReScript which requires two scripts to run in parallel npm run res:dev and npm run dev. It seems to be achievable with vscode today, so sharing the below in case helpful.

I'm actually using bun instead of npm and it works fine too (just comment / uncomment the two lines accordingly)

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "ReScript Watcher",
            // "type": "npm",
            // "script": "res:dev",
            "type": "shell",
            "command": "bun run res:dev",
            "isBackground": true,
            "problemMatcher": [],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "presentation": {
                "group": "dev",
            }
        },
        {
            "label": "Vite Server",
            // "type": "npm",
            // "script": "dev",
            "type": "shell",
            "command": "bun run dev",
            "isBackground": true,
            "problemMatcher": [],
            "group": "build",
            "presentation": {
                "group": "dev",
            }
        },
        {
            "label": "Run dev tasks",
            "dependsOn": [
                "ReScript Watcher",
                "Vite Server"
            ],
            "dependsOrder": "parallel",
            "problemMatcher": [],
            "presentation": {
                "group": "dev",
                "reveal": "always",
                "panel": "shared"
            }
        }
    ]
}

It works with tasks.json, but don't with launch.json in configurations and compounds.

@ashikns
Copy link

ashikns commented May 31, 2024

Did anyone ever figure out a solution for this? I'm trying to launch a node-terminal and debugpy in split terminals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

No branches or pull requests