nzbget icon indicating copy to clipboard operation
nzbget copied to clipboard

[BREAKING] "Invalid option a", due to Win11 Default Terminal Swap

Open dylanh724 opened this issue 2 years ago • 6 comments

https://forum.nzbget.net/viewtopic.php?t=3910

Win11 offers to default your terminal to the fancier (and superior) Windows Terminal. This breaks NZBG completely. Easy to repro. See thread above for further details.

dylanh724 avatar Nov 23 '21 15:11 dylanh724

I believe the underlying Windows change is this: Classic Console API vs Virtual Terminal Sequences. There's logic to check the process ID against the "console" that started it that uses calls like GetrConsoleWindow that don't have a virtual terminal equivalent.

ronw23 avatar Dec 02 '21 02:12 ronw23

Any word on this? It's a breaking bug for Win11 to those that use Windows terminal. At one point, Win11 prompts if you want to permanently switch, and there's 0 reason not to (to those that do not know about this bug) as it's superior in every way.

dylanh724 avatar Dec 11 '21 11:12 dylanh724

I confirm the issue and strange behaviors at startup on Win11 computers. Didn't know it was linked to Windows Terminal (I have it on default too).

I noticed that whichever way I try to start nzbget it will fail on that parcticular computer/setup. Either by opening a .nzb file or by starting nzbget from the start menu or from a shortcut or directly the nzbget.exe file.

Note : Starting nzbget with "Run as administrator" seems to bypass these issues and launch correctly.

zotabee avatar Dec 18 '21 10:12 zotabee

Hmm, this should probably get a priority bump:

  1. This is a common, repro'd, breaking bug.
  2. Win11 is getting dominant.
  3. Win11 shoves Windows Terminal in your face (and for a good reason).
  4. Windows Terminal is superior - I want to set mine to default, but this is the only app preventing me from doing so.

CC @hugbug

dylanh724 avatar Feb 21 '22 04:02 dylanh724

I've figured out a workaround that allows you to keep the new Terminal as default. Create a shortcut to nzbget.exe and put it anywhere. Right click > Properties, and in "Target" add conhost at the very left before the path and a space between them. So it looks like below. This makes it so the old windows console host will run the exe.

Then you can put the shortcut in the startup folder (go to 'Run' and type in shell:startup). Note that in the task manager's startup programs list, it will appear as "conhost.exe".

image

A note: You might have to first run the program with the old console set as the default so it can get the config set up or something, not sure, I forgot to test. Then after you get it to running you can change the default terminal back to the new one.

ThioJoe avatar Apr 08 '22 20:04 ThioJoe

Windows Terminal is now the Default in Windows 11

The day has finally come! Windows Terminal is now the default command line experience on Windows 11 22H2! 🎉 This means that all command line applications will now automatically open in Windows Terminal.

https://devblogs.microsoft.com/commandline/windows-terminal-is-now-the-default-in-windows-11/

zotabee avatar Oct 22 '22 10:10 zotabee