Preventing console window from closing on Visual Studio C/C++ Console application

前端 未结 21 2075
灰色年华
灰色年华 2020-11-21 23:42

This is a probably an embarasing question as no doubt the answer is blindingly obvious.

I\'ve used Visual Studio for years, but this is the first time I\'ve done any

21条回答
  •  情书的邮戳
    2020-11-22 00:15

    Currently there is no way to do this with apps running in WSL2. However there are two work-arounds:

    1. The debug window retains the contents of the WSL shell window that closed.

    2. The window remains open if your application returns a non-zero return code, so you could return non-zero in debug builds for example.

提交回复
热议问题