Skip to content

Commit ac6cbf7

Browse files
Add IHostUISupportsMultipleChoiceSelection impl (#1785)
Without this, `InternalHostUserInterface` will try to emulate support, leading to different runtime behavior.
1 parent e7efb40 commit ac6cbf7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: src/PowerShellEditorServices/Services/PowerShell/Host/EditorServicesConsolePSHostUserInterface.cs

+8-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace Microsoft.PowerShell.EditorServices.Services.PowerShell.Host
1414
{
15-
internal class EditorServicesConsolePSHostUserInterface : PSHostUserInterface
15+
internal class EditorServicesConsolePSHostUserInterface : PSHostUserInterface, IHostUISupportsMultipleChoiceSelection
1616
{
1717
private readonly PSHostUserInterface _underlyingHostUI;
1818

@@ -90,5 +90,12 @@ public void ResetProgress()
9090
public override void WriteVerboseLine(string message) => _underlyingHostUI.WriteVerboseLine(message);
9191

9292
public override void WriteWarningLine(string message) => _underlyingHostUI.WriteWarningLine(message);
93+
94+
public Collection<int> PromptForChoice(
95+
string caption,
96+
string message,
97+
Collection<ChoiceDescription> choices,
98+
IEnumerable<int> defaultChoices)
99+
=> ((IHostUISupportsMultipleChoiceSelection)_underlyingHostUI).PromptForChoice(caption, message, choices, defaultChoices);
93100
}
94101
}

0 commit comments

Comments
 (0)