1

When working on a console app, is there a way to tell if I'm debugging in the new Windows Terminal app? When I actually run the console app it doesn't run in Windows Terminal but when debugging (with VS2022) the debugger runs in the new Windows Terminal app if the default terminal option in windows is set to Windows Console Host.

I know in cmd.exe or PowerShell I can get the WT_SESSION environment variable and it will return a guid but when I'm debugging WT_SESSION is null even if its running in Windows Terminal.

Another way to would be to check what the default terminal app is set to, but I can't seem to find how to do that programmatically either. Does anyone know if that's maybe a registry setting or something?

LorneCash
  • 1,446
  • 2
  • 16
  • 30

0 Answers0