diff --git a/src/Microsoft.PowerShell.Linux.Host/host.cs b/src/Microsoft.PowerShell.Linux.Host/host.cs
index 5b78bf8ca..d04177d4a 100644
--- a/src/Microsoft.PowerShell.Linux.Host/host.cs
+++ b/src/Microsoft.PowerShell.Linux.Host/host.cs
@@ -13,10 +13,9 @@ namespace Microsoft.PowerShell.Linux.Host
///
internal class MyHost : PSHost, IHostSupportsInteractiveSession
{
- public MyHost(Listener Listener, bool isInteractive)
+ public MyHost(Listener Listener)
{
this.Listener = Listener;
- this.myHostUserInterface = new MyHostUserInterface(isInteractive);
}
///
@@ -45,7 +44,7 @@ namespace Microsoft.PowerShell.Linux.Host
/// A reference to the implementation of the PSHostUserInterface
/// class for this application.
///
- private MyHostUserInterface myHostUserInterface;
+ private MyHostUserInterface myHostUserInterface = new MyHostUserInterface();
///
/// A reference to the runspace used to start an interactive session.
diff --git a/src/Microsoft.PowerShell.Linux.Host/main.cs b/src/Microsoft.PowerShell.Linux.Host/main.cs
index a1258734e..8ffbe8661 100644
--- a/src/Microsoft.PowerShell.Linux.Host/main.cs
+++ b/src/Microsoft.PowerShell.Linux.Host/main.cs
@@ -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();
diff --git a/src/Microsoft.PowerShell.Linux.Host/rawui.cs b/src/Microsoft.PowerShell.Linux.Host/rawui.cs
index 20657fcfb..3dfd540af 100644
--- a/src/Microsoft.PowerShell.Linux.Host/rawui.cs
+++ b/src/Microsoft.PowerShell.Linux.Host/rawui.cs
@@ -16,16 +16,6 @@ namespace Microsoft.PowerShell.Linux.Host
internal class MyRawUserInterface : PSHostRawUserInterface
{
- public MyRawUserInterface (bool isInteractive)
- {
- this.isInteractive = isInteractive;
- }
-
- ///
- /// Whether or not this UI is actually interactive.
- ///
- bool isInteractive;
-
///
/// 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
///
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 { }
}
///
diff --git a/src/Microsoft.PowerShell.Linux.Host/ui.cs b/src/Microsoft.PowerShell.Linux.Host/ui.cs
index 67223a748..ed6817e1b 100644
--- a/src/Microsoft.PowerShell.Linux.Host/ui.cs
+++ b/src/Microsoft.PowerShell.Linux.Host/ui.cs
@@ -17,15 +17,10 @@ namespace Microsoft.PowerShell.Linux.Host
///
internal class MyHostUserInterface : PSHostUserInterface, IHostUISupportsMultipleChoiceSelection
{
- public MyHostUserInterface(bool isInteractive)
- {
- this.myRawUi = new MyRawUserInterface(isInteractive);
- }
-
///
/// A reference to the PSRawUserInterface implementation.
///
- private MyRawUserInterface myRawUi;
+ private MyRawUserInterface myRawUi = new MyRawUserInterface();
///
/// 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();
}