diff --git a/src/System.Management.Automation/engine/Subsystem/FeedbackSubsystem/FeedbackHub.cs b/src/System.Management.Automation/engine/Subsystem/FeedbackSubsystem/FeedbackHub.cs index 7dfe79a2cd93..588cf086d42c 100644 --- a/src/System.Management.Automation/engine/Subsystem/FeedbackSubsystem/FeedbackHub.cs +++ b/src/System.Management.Automation/engine/Subsystem/FeedbackSubsystem/FeedbackHub.cs @@ -183,12 +183,10 @@ public static class FeedbackHub private static bool CanSkip(IEnumerable providers) { - const FeedbackTrigger possibleTriggerOnSuccess = FeedbackTrigger.Success | FeedbackTrigger.Comment; - bool canSkip = true; foreach (IFeedbackProvider provider in providers) { - if ((provider.Trigger & possibleTriggerOnSuccess) != 0) + if (provider.Trigger.HasFlag(FeedbackTrigger.Success)) { canSkip = false; break; @@ -249,7 +247,8 @@ private static bool CanSkip(IEnumerable providers) if (IsPureComment(tokens)) { - trigger = FeedbackTrigger.Comment; + // Don't trigger anything in this case. + return false; } else if (questionMarkValue) { diff --git a/src/System.Management.Automation/engine/Subsystem/FeedbackSubsystem/IFeedbackProvider.cs b/src/System.Management.Automation/engine/Subsystem/FeedbackSubsystem/IFeedbackProvider.cs index d028e5baa629..1446983f791a 100644 --- a/src/System.Management.Automation/engine/Subsystem/FeedbackSubsystem/IFeedbackProvider.cs +++ b/src/System.Management.Automation/engine/Subsystem/FeedbackSubsystem/IFeedbackProvider.cs @@ -18,32 +18,27 @@ namespace System.Management.Automation.Subsystem.Feedback [Flags] public enum FeedbackTrigger { - /// - /// The last command line is comment only. - /// - Comment = 0x0001, - /// /// The last command line executed successfully. /// - Success = 0x0002, + Success = 0x0001, /// /// The last command line failed due to a command-not-found error. /// This is a special case of . /// - CommandNotFound = 0x0004, + CommandNotFound = 0x0002, /// /// The last command line failed with an error record. /// This includes the case of command-not-found error. /// - Error = CommandNotFound | 0x0008, + Error = CommandNotFound | 0x0004, /// /// All possible triggers. /// - All = Comment | Success | Error + All = Success | Error } ///