Thread overview
Visual D - keep console open
Aug 08
bitwise
Aug 09
bitwise
Aug 09
bitwise
August 08
I just installed Visual D 0.50.1 with Visual Studio 2019, and the console wont stay open after I run a console program. Is there a way to get that working without adding system("pause") to my code?

I've tried to start with/without debugging, by explicitly using the menu options in Visual Studio, and it won't work.

I've also disabled this option:
>> Tools->Options->Debugging->General->Automatically close the console window...

Even the option "Pause when program finishes" from the D project settings won't work.

*clock ticks*

It seems the above problem only refers to *.visualdproj projects.

I guess I can (and maybe should?) just use the new VS project type.

  Thanks
August 08

On 08/08/2019 18:36, bitwise wrote:
> I just installed Visual D 0.50.1 with Visual Studio 2019, and the console wont stay open after I run a console program. Is there a way to get that working without adding system("pause") to my code?
> 
> I've tried to start with/without debugging, by explicitly using the menu options in Visual Studio, and it won't work.
> 
> I've also disabled this option:
>>> Tools->Options->Debugging->General->Automatically close the console window...

This option is used when starting the debugger from a VC project
(vcxproj). AFAICT the way VS2019 handles this (reusing the same window)
is rather new and a lot more useful than how it used to work (opening a
new window every time).

> 
> Even the option "Pause when program finishes" from the D project settings won't work.

As you noticed this option is for visualdproj projects. It works for running without debugger for me. Please verify that you have changed this option for the correct configuration and platform (that's a common mistake I make).

> 
> *clock ticks*
> 
> It seems the above problem only refers to *.visualdproj projects.
> 
> I guess I can (and maybe should?) just use the new VS project type.

I consider it the preferred project type and the other legacy, though there are some features only available with the visualdproj projects, e.g. automatic import paths from project dependencies and "private" phobos builds for better debugging.
August 09
On Thursday, 8 August 2019 at 18:31:52 UTC, Rainer Schuetze wrote:

> As you noticed this option is for visualdproj projects. It works for running without debugger for me. Please verify that you have changed this option for the correct configuration and platform (that's a common mistake I make).

This was actually it. Strangely, the platform in the property pages for the D project defaulted to x64, while the platform specified on the VS toolbar defaulted to x86. This was a fresh Visual D project, and I hadn't changed anything. This was also on my laptop. On my PC however, I created a new Visual D project, and the options in the property pages and on the toolbar were both set to Win32, which is what I would expect. I'm not sure what to make of this.

> I consider it the preferred project type and the other legacy, though there are some features only available with the visualdproj projects, e.g. automatic import paths from project dependencies and "private" phobos builds for better debugging.

Ok, this works for now. My main project is meant to be multiplatform and compile on a mac though, so I'll have to revisit this issue later with DUB integration in mind.

Thanks

August 09

On 09/08/2019 05:29, bitwise wrote:
> On Thursday, 8 August 2019 at 18:31:52 UTC, Rainer Schuetze wrote:
> 
>> As you noticed this option is for visualdproj projects. It works for running without debugger for me. Please verify that you have changed this option for the correct configuration and platform (that's a common mistake I make).
> 
> This was actually it. Strangely, the platform in the property pages for the D project defaulted to x64, while the platform specified on the VS toolbar defaulted to x86. This was a fresh Visual D project, and I hadn't changed anything. This was also on my laptop. On my PC however, I created a new Visual D project, and the options in the property pages and on the toolbar were both set to Win32, which is what I would expect. I'm not sure what to make of this.

The project configuration dialog just reopens with whatever configuration and platform it was used before. If you want it to follow the current build configuration and platform, you can select "Active" in the respective boxes.
August 09
On Friday, 9 August 2019 at 06:45:20 UTC, Rainer Schuetze wrote:
>
> The project configuration dialog just reopens with whatever configuration and platform it was used before. If you want it to follow the current build configuration and platform, you can select "Active" in the respective boxes.

IMO, this kind of option should be reset for new projects.