Skip to content

Commit 7e463b5

Browse files
committed
Fixed SHOT
1 parent 1123190 commit 7e463b5

3 files changed

Lines changed: 22 additions & 23 deletions

File tree

src/Microsoft.PowerShell.ConsoleGuiTools/OutConsoleGridView.cs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,15 @@ public HashSet<int> Run(ApplicationData applicationData)
4444
return selectedIndexes ?? [];
4545
}
4646

47+
/// <summary>
48+
/// Releases resources used by the <see cref="OutConsoleGridView" />.
49+
/// </summary>
50+
/// <remarks>
51+
/// Currently, there are no resources to dispose. This method is provided for future extensibility
52+
/// and to follow the standard IDisposable pattern.
53+
/// </remarks>
4754
public void Dispose()
4855
{
49-
if (!Console.IsInputRedirected)
50-
// By emitting this, we fix two issues:
51-
// 1. An issue where arrow keys don't work in the console because .NET
52-
// requires application mode to support Arrow key escape sequences.
53-
// Esc[?1h sets the cursor key to application mode
54-
// See http://ascii-table.com/ansi-escape-sequences-vt-100.php
55-
// 2. An issue where moving the mouse causes characters to show up because
56-
// mouse tracking is still on. Esc[?1003l turns it off.
57-
// See https://www.xfree86.org/current/ctlseqs.html#Mouse%20Tracking
58-
Console.Write("\u001b[?1h\u001b[?1003l");
56+
// No resources to dispose currently
5957
}
6058
}

src/Microsoft.PowerShell.ConsoleGuiTools/ShowObjectTreeWindow.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
using System;
55
using System.Collections.Generic;
66
using System.Diagnostics;
7+
using System.Reflection;
8+
using System.Text.RegularExpressions;
79
using System.IO;
810
using System.Linq;
911
using System.Management.Automation;
10-
using System.Reflection;
11-
using System.Text.RegularExpressions;
12-
using Microsoft.PowerShell.OutGridView.Models;
1312
using Terminal.Gui.App;
14-
using Terminal.Gui.Configuration;
15-
using Terminal.Gui.Drawing;
16-
using Terminal.Gui.Input;
1713
using Terminal.Gui.ViewBase;
1814
using Terminal.Gui.Views;
15+
using Terminal.Gui.Drawing;
16+
using Terminal.Gui.Input;
17+
using Terminal.Gui.Configuration;
18+
using Microsoft.PowerShell.OutGridView.Models;
1919

2020
namespace Microsoft.PowerShell.ConsoleGuiTools;
2121

src/Microsoft.PowerShell.ConsoleGuiTools/ShowObjectView.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@ internal static void Run(ApplicationData applicationData)
3535
{
3636
Terminal.Gui.Configuration.ConfigurationManager.Enable(Terminal.Gui.Configuration.ConfigLocations.All);
3737

38-
if (!string.IsNullOrEmpty(applicationData.ForceDriver))
39-
Application.ForceDriver = applicationData.ForceDriver;
40-
4138
using ShowObjectTreeWindow window = new(applicationData);
42-
using IApplication app = Application.Create();
43-
app.Init();
44-
bool accepted = app.Run(window) is true;
45-
Application.ForceDriver = string.Empty;
39+
using IApplication app = Application.Create().Init(driverName: applicationData.ForceDriver);
40+
app.Run(window);
41+
42+
// using ShowObjectTreeWindow window = new(applicationData);
43+
// using IApplication app = Application.Create();
44+
// app.Init();
45+
// bool accepted = app.Run(window) is true;
46+
// Application.ForceDriver = string.Empty;
4647
}
4748

4849
/// <summary>

0 commit comments

Comments
 (0)