From: Derrick Stolee <derrickstolee@github.com>
To: Matthieu Moy <Matthieu.Moy@univ-lyon1.fr>,
Jonathan Bressat <git.jonathan.bressat@gmail.com>,
"git@vger.kernel.org" <git@vger.kernel.org>
Cc: Cogoni Guillaume <cogoni.guillaume@gmail.com>
Subject: Re: contrib/vscode/: debugging with vscode and gdb
Date: Fri, 25 Mar 2022 15:01:10 -0400 [thread overview]
Message-ID: <c1f255d7-6637-b6ac-0a64-1f64404a6f6c@github.com> (raw)
In-Reply-To: <7a522ccc-0a45-47fa-509c-a7a8b159041d@univ-lyon1.fr>
On 3/25/2022 2:27 PM, Matthieu Moy wrote:
> On 3/25/22 14:19, Derrick Stolee wrote:
>
>> Jonathan and Guillame reported that flipping this setting to "false"
>> allows the VS Code debugger to work with Git. I verified that the
>> debugger did not work by default but now does with this change.
>
> FYI, I got the same problem, and I can reproduce the issue on a hello world program, so "externalConsole": true, is broken at least for me regardless of the Git codebase.
>
> I couldn't understand what exactly the option was supposed to do. If I understand correctly, it should launch another window to show the git program output, but I don't know which window actually (xterm? x-terminal-emulator? a terminal program that isn't installed on my system?).
>
>> contrib/vscode/init.sh | 2 +-
>> t/test-lib-functions.sh | 34 ----------------------------------
>
> I guess the test-lib-functions.sh part is a leftover from another work?
Whoops! Yes I was in the wrong worktree.
>> - "externalConsole": true,
>> + "externalConsole": false,
> I'd actually remove the line completely, to mean "let VSCode decide what to do", i.e. either VSCode's default, or the user's configuration ("launch" section in settings.json, see e.g. https://code.visualstudio.com/docs/getstarted/settings ). If some user has a non-broken externalConsole: true VSCode and likes this behavior, then the best place to configure it is in a user-wide config file IHMO.
I confirmed that deleting the line works just fine.
Here's a better patch without the bogus extra changes.
--- >8 ---
From 8d8ac565a9c6631a509f301e7719692bd781f8d2 Mon Sep 17 00:00:00 2001
From: Derrick Stolee <derrickstolee@github.com>
Date: Fri, 25 Mar 2022 09:07:11 -0400
Subject: [PATCH] contrib/vscode: fix interaction with UI debugger
The contrib/vscode/init.sh script helps Git developers using Visual
Studio Code to hook up the proper settings to work on Git using the UI
features of that editor environment. This should include the debugger
integration, but that is currently broken.
One thing this script does is create a .vscode/launch.json file, which
provides the information for how VS Code should launch the built
executable. This defaults to the Git executable at the root of the
repository (with no arguments). Among the initial settings, the
"externalConsole" setting is set to "true". This has been the case since
the script was created in 54c06c6013 (contrib: add a script to
initialize VS Code configuration, 2018-07-30).
Jonathan and Guillame reported that flipping this setting to "false"
allows the VS Code debugger to work with Git. Matthieu pointed out that
this is the default, so we can leave it out of the file completely and
let a user modify that themselves if they want. I validated that both
the "false" setting and removing the line both work.
The VS Code reference [1] mentions that this setting is only used when
debugging, so should not affect the "Run Without Debugging" feature.
Other than making the UI debugger work, this will also change the Git
output to appear in the "Debug Console" tab instead of a new window.
[1] https://code.visualstudio.com/docs/cpp/launch-json-reference
In cases such as using the Remote SSH capability, this setting is
necessary to have any success executing Git via the "Run" menu, since
the external console is not visible at all from the VS Code window.
Reported-by: Jonathan Bressat <git.jonathan.bressat@gmail.com>
Reported-by: Cogoni Guillaume <cogoni.guillaume@gmail.com>
Helped-by: Matthieu Moy <Matthieu.Moy@univ-lyon1.fr>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
---
contrib/vscode/init.sh | 1 -
1 file changed, 1 deletion(-)
diff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh
index 27de94994b5..f139fd86444 100755
--- a/contrib/vscode/init.sh
+++ b/contrib/vscode/init.sh
@@ -271,7 +271,6 @@ cat >.vscode/launch.json.new <<EOF ||
"stopAtEntry": false,
"cwd": "\${workspaceFolder}",
"environment": [],
- "externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "$GDBPATH",
"setupCommands": [
--
2.35.1.138.gfc5de29e9e6
next prev parent reply other threads:[~2022-03-25 19:26 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-24 8:16 contrib/vscode/: debugging with vscode and gdb Jonathan Bressat
2022-03-25 13:19 ` Derrick Stolee
[not found] ` <2a7eecb4a0b247ef8f855f1c4fb5d510@SAMBXP02.univ-lyon1.fr>
2022-03-25 18:27 ` Matthieu Moy
2022-03-25 19:01 ` Derrick Stolee [this message]
2022-03-26 14:11 ` Jonathan Bressat
2022-04-03 20:18 ` Guillaume Cogoni
[not found] ` <7b139f2c480e4ebc8dc6615b44cd5f24@SAMBXP02.univ-lyon1.fr>
2022-04-05 9:43 ` Matthieu Moy
2022-04-05 22:45 ` [PATCH V1 0/1] contrib/vscode/: debugging with VS Code " COGONI Guillaume
2022-04-05 22:45 ` [PATCH V1 1/1] " COGONI Guillaume
2022-04-06 8:47 ` Ævar Arnfjörð Bjarmason
2022-04-06 11:59 ` Matthieu Moy
2022-04-06 13:35 ` Matthieu Moy
2022-04-06 15:18 ` [PATCH v2 0/1] " COGONI Guillaume
2022-04-06 15:18 ` [PATCH v2 1/1] " COGONI Guillaume
2022-04-06 18:03 ` Derrick Stolee
2022-04-06 20:23 ` Junio C Hamano
2022-04-06 23:39 ` [PATCH v3 0/1] " COGONI Guillaume
2022-04-06 23:39 ` [PATCH v3 1/1] " COGONI Guillaume
2022-04-07 11:17 ` Ævar Arnfjörð Bjarmason
2022-04-07 13:09 ` Derrick Stolee
2022-04-07 16:43 ` Junio C Hamano
2022-04-07 20:40 ` [PATCH v4 0/1] " COGONI Guillaume
2022-04-07 20:40 ` [PATCH v4 1/1] " COGONI Guillaume
[not found] ` <66f08cb2e81647e29a080af05d7c867e@SAMBXP02.univ-lyon1.fr>
2022-04-07 8:59 ` [PATCH V1 " Matthieu Moy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c1f255d7-6637-b6ac-0a64-1f64404a6f6c@github.com \
--to=derrickstolee@github.com \
--cc=Matthieu.Moy@univ-lyon1.fr \
--cc=cogoni.guillaume@gmail.com \
--cc=git.jonathan.bressat@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).