@@ -96,7 +96,8 @@ private function runInteractiveMode(InputInterface $input, OutputInterface $outp
9696 label: 'Select scan options ' ,
9797 options: [
9898 'show-all ' => 'Show all modules including compatible ones ' ,
99- 'include-vendor ' => 'Include vendor modules (default: excluded) ' ,
99+ 'incompatible-only ' => 'Show only incompatible modules (default behavior) ' ,
100+ 'include-vendor ' => 'Include Magento core modules (default: third-party only) ' ,
100101 'detailed ' => 'Show detailed file-level issues with line numbers ' ,
101102 ],
102103 default: [],
@@ -110,6 +111,7 @@ private function runInteractiveMode(InputInterface $input, OutputInterface $outp
110111
111112 // Apply selected options to input
112113 $ showAll = in_array ('show-all ' , $ selectedOptions );
114+ $ incompatibleOnly = in_array ('incompatible-only ' , $ selectedOptions );
113115 $ includeVendor = in_array ('include-vendor ' , $ selectedOptions );
114116 $ detailed = in_array ('detailed ' , $ selectedOptions );
115117 $ thirdPartyOnly = false ; // Not needed in interactive mode
@@ -119,11 +121,13 @@ private function runInteractiveMode(InputInterface $input, OutputInterface $outp
119121 $ config = [];
120122 if ($ showAll ) {
121123 $ config [] = 'Show all modules ' ;
124+ } elseif ($ incompatibleOnly ) {
125+ $ config [] = 'Show incompatible only ' ;
122126 } else {
123127 $ config [] = 'Show modules with issues ' ;
124128 }
125129 if ($ includeVendor ) {
126- $ config [] = 'Include vendor modules ' ;
130+ $ config [] = 'Include Magento core ' ;
127131 } else {
128132 $ config [] = 'Third-party modules only ' ;
129133 }
@@ -133,8 +137,8 @@ private function runInteractiveMode(InputInterface $input, OutputInterface $outp
133137 $ this ->io ->comment ('Configuration: ' . implode (', ' , $ config ));
134138 $ this ->io ->newLine ();
135139
136- // Run scan with selected options
137- return $ this ->runScan ($ showAll , $ thirdPartyOnly , $ includeVendor , $ detailed , false , $ output );
140+ // Run scan with selected options (pass incompatibleOnly flag)
141+ return $ this ->runScan ($ showAll , $ thirdPartyOnly , $ includeVendor , $ detailed , $ incompatibleOnly , $ output );
138142 } catch (\Exception $ e ) {
139143 $ this ->resetPromptEnvironment ();
140144 $ this ->io ->error ('Interactive mode failed: ' . $ e ->getMessage ());
@@ -172,11 +176,12 @@ private function runScan(
172176 ): int {
173177
174178 // Determine filter logic for vendor and third-party modules:
175- // - By default (no flags): scan third-party modules excluding those in vendor/
176- // - With --include-vendor: include vendor modules in the scan
179+ // - excludeVendor controls whether to scan modules in the vendor/ directory
180+ // - By default (no flags): scan third-party modules including those in vendor/
181+ // - With --include-vendor: scan everything including Magento_* core modules
177182 // - With --third-party-only: explicitly scan only third-party modules
178183 $ scanThirdPartyOnly = $ thirdPartyOnly || (!$ includeVendor && !$ thirdPartyOnly );
179- $ excludeVendor = ! $ includeVendor ;
184+ $ excludeVendor = false ; // Always include vendor for third-party scanning
180185
181186 // Run the compatibility check
182187 $ results = $ this ->compatibilityChecker ->check (
@@ -364,25 +369,9 @@ private function isInteractiveTerminal(OutputInterface $output): bool
364369 }
365370 }
366371
367- // Additional check: detect if running in a proper TTY using safer methods
368- if (\function_exists ('stream_isatty ' ) && \defined ('STDIN ' )) {
369- try {
370- return \stream_isatty (\STDIN );
371- } catch (\Throwable $ e ) {
372- // Fall through to next check
373- }
374- }
375-
376- if (\function_exists ('posix_isatty ' ) && \defined ('STDIN ' )) {
377- try {
378- return \posix_isatty (\STDIN );
379- } catch (\Throwable $ e ) {
380- // Fall through to default
381- }
382- }
383-
384- // Conservative default if no TTY-detection functions are available
385- return false ;
372+ // Additional check: try to detect if running in a proper TTY
373+ $ sttyOutput = shell_exec ('stty -g 2>/dev/null ' );
374+ return !empty ($ sttyOutput );
386375 }
387376
388377 /**
@@ -461,7 +450,7 @@ private function getServerVar(string $name): ?string
461450 private function setEnvVar (string $ name , string $ value ): void
462451 {
463452 $ this ->secureEnvStorage [$ name ] = $ value ;
464- $ _SERVER [ $ name] = $ value ;
453+ putenv ( " $ name= $ value" ) ;
465454 }
466455
467456 /**
0 commit comments