LogInformation ( "Attempting to get console or terminal window handle" ); // Attempt 1: Get console window handle IntPtr consoleHandle = NativeBridge . LogWarning ( "GetAncestor returned zero, falling back to console handle" ); return consoleHandle ; // Return console handle as fallback } } // Attempt 2: Try to get parent process window handle try { using var currentProcess = System . LogWarning ( "Returning IntPtr.Zero as window handle - authentication may require additional user interaction" ); return IntPtr .