Revert "Skip BufferSize when not interactive"
This reverts commit 9a5c010f54
.
This commit is contained in:
parent
d31647f52c
commit
a4fd57298d
@ -13,10 +13,9 @@ namespace Microsoft.PowerShell.Linux.Host
|
||||
/// </summary>
|
||||
internal class MyHost : PSHost, IHostSupportsInteractiveSession
|
||||
{
|
||||
public MyHost(Listener Listener, bool isInteractive)
|
||||
public MyHost(Listener Listener)
|
||||
{
|
||||
this.Listener = Listener;
|
||||
this.myHostUserInterface = new MyHostUserInterface(isInteractive);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -45,7 +44,7 @@ namespace Microsoft.PowerShell.Linux.Host
|
||||
/// A reference to the implementation of the PSHostUserInterface
|
||||
/// class for this application.
|
||||
/// </summary>
|
||||
private MyHostUserInterface myHostUserInterface;
|
||||
private MyHostUserInterface myHostUserInterface = new MyHostUserInterface();
|
||||
|
||||
/// <summary>
|
||||
/// A reference to the runspace used to start an interactive session.
|
||||
|
@ -192,7 +192,7 @@ OPTIONS
|
||||
// Create the host and runspace instances for this interpreter.
|
||||
// Note that this application does not support console files so
|
||||
// only the default snap-ins will be available.
|
||||
this.myHost = new MyHost(this, initialScript == null);
|
||||
this.myHost = new MyHost(this);
|
||||
InitialSessionState iss = InitialSessionState.CreateDefault2();
|
||||
this.myRunSpace = RunspaceFactory.CreateRunspace(this.myHost, iss);
|
||||
this.myRunSpace.Open();
|
||||
|
@ -16,16 +16,6 @@ namespace Microsoft.PowerShell.Linux.Host
|
||||
|
||||
internal class MyRawUserInterface : PSHostRawUserInterface
|
||||
{
|
||||
public MyRawUserInterface (bool isInteractive)
|
||||
{
|
||||
this.isInteractive = isInteractive;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not this UI is actually interactive.
|
||||
/// </summary>
|
||||
bool isInteractive;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background color of the displayed text.
|
||||
/// This maps to the corresponding Console.Background property.
|
||||
@ -42,15 +32,10 @@ namespace Microsoft.PowerShell.Linux.Host
|
||||
/// </summary>
|
||||
public override Size BufferSize
|
||||
{
|
||||
get { return new Size(Console.WindowWidth, Console.WindowHeight); }
|
||||
set { }
|
||||
//get { return new Size(Console.BufferWidth, Console.BufferHeight); }
|
||||
//set { Console.SetBufferSize(value.Width, value.Height); }
|
||||
get {
|
||||
if (!isInteractive)
|
||||
return new Size(0, 0);
|
||||
|
||||
return new Size(Console.WindowWidth, Console.WindowHeight);
|
||||
}
|
||||
set { }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -17,15 +17,10 @@ namespace Microsoft.PowerShell.Linux.Host
|
||||
/// </summary>
|
||||
internal class MyHostUserInterface : PSHostUserInterface, IHostUISupportsMultipleChoiceSelection
|
||||
{
|
||||
public MyHostUserInterface(bool isInteractive)
|
||||
{
|
||||
this.myRawUi = new MyRawUserInterface(isInteractive);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A reference to the PSRawUserInterface implementation.
|
||||
/// </summary>
|
||||
private MyRawUserInterface myRawUi;
|
||||
private MyRawUserInterface myRawUi = new MyRawUserInterface();
|
||||
|
||||
/// <summary>
|
||||
/// Gets an instance of the PSRawUserInterface class for this host
|
||||
@ -349,6 +344,7 @@ ReadNext:
|
||||
Console.ForegroundColor = foregroundColor;
|
||||
Console.BackgroundColor = backgroundColor;
|
||||
Console.Write(value);
|
||||
//Console.Write(value);
|
||||
Console.ResetColor();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user