Skip to content

Commit 334f1a4

Browse files
tigTylerLeonhardtandyleejordan
authored
Merge Tig Kindel's work (#166)
* Fixed #58: Multi-line commands rendering wrong * Fixed #58 - Newlines in commands render incorrectly * Added debug instructions to readme * simplified stripping of newline/linefeed * made column spacing tighter * removed excess padding on right * removed excess rows at bottom * status bar wsa occluding window * fixed build scripts to only build ocgv * refactored to make logic more obvious * removed orig files * Updated references to latest Terminal.Gui * Fixed #131 and upgraded to terminal.gui 1.6, pwsh 7.2, and net60 * supported .net and reverted change * Fixes #131 - Out-ConsoleGridView doesn't handle ANSI escape sequences correctly * removed border when minui is enabled * re-implemented feature post merge screw up * improve VS code build and debug support * On exit, ensure only visible marked items are output * Fixes 87 * Fixing crash when MinUi PR is merged * Tweaked build to have a better test at end * removed merge artifacts * exclude .orig files (merge artifacts) Co-authored-by: Tyler James Leonhardt <[email protected]> Co-authored-by: Andy Jordan <[email protected]>
1 parent ac7d4df commit 334f1a4

File tree

13 files changed

+230
-167
lines changed

13 files changed

+230
-167
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ module/
4242
# Ignore package
4343
Microsoft.PowerShell.GraphicalTools.zip
4444
Microsoft.PowerShell.ConsoleGuiTools.zip
45+
46+
# git artifacts
47+
*.orig

.vscode/launch.json

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,20 @@
66
"configurations": [
77
{
88
"name": ".NET Core Launch (console)",
9+
"preLaunchTask": "build ConsoleGuiTools",
910
"type": "coreclr",
1011
"request": "launch",
11-
"preLaunchTask": "build",
12-
"program": "${workspaceFolder}/Cmdlet/bin/Debug/net6.0/win10-x64/OutGridViewCmdlet.dll",
13-
"args": [],
14-
"cwd": "${workspaceFolder}/Cmdlet",
15-
"console": "internalConsole",
16-
"stopAtEntry": false
17-
},
18-
{
19-
"name": ".NET Core Launch (application)",
20-
"type": "coreclr",
21-
"request": "launch",
22-
"preLaunchTask": "build",
23-
"program": "${workspaceFolder}/Application/bin/Debug/net6.0/win10-x64/OutGridViewApplication.dll",
24-
"args": [],
25-
"cwd": "${workspaceFolder}/Application",
26-
"console": "internalConsole",
27-
"stopAtEntry": false
12+
"program": "pwsh",
13+
"args": [
14+
"-NoExit",
15+
"-NoProfile",
16+
"-Command",
17+
"Import-Module ${workspaceFolder}/module/Microsoft.PowerShell.ConsoleGuiTools"
18+
],
19+
"cwd": "${workspaceFolder}",
20+
"console": "integratedTerminal",
21+
"stopAtEntry": false,
22+
"justMyCode": false
2823
},
2924
{
3025
"name": ".NET Core Attach",

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"files.associations": {
3-
"**/.vsts-ci/**/*.yml":"azure-pipelines"
3+
"**/.vsts-ci/**/*.yml":"azure-pipelines",
44
}
55
}

.vscode/tasks.json

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,22 @@
1-
{
1+
// See https://go.microsoft.com/fwlink/?LinkId=733558
2+
// for the documentation about the tasks.json format
3+
{
24
"version": "2.0.0",
35
"tasks": [
46
{
5-
"label": "build",
6-
"osx": {
7-
"command": "/usr/local/bin/pwsh"
8-
},
9-
"windows": {
10-
"command": "pwsh.exe"
11-
},
12-
"linux": {
13-
"command": "/usr/local/bin/pwsh"
14-
},
15-
"type": "process",
7+
"label": "build ConsoleGuiTools",
8+
"command": "Invoke-Build",
9+
"type": "shell",
1610
"args": [
17-
"-c",
18-
"Invoke-Build",
19-
// Build both modules
20-
//"Build -ModuleName Microsoft.PowerShell.GraphicalTools, Microsoft.PowerShell.ConsoleGuiTools",
21-
// Build only Out-GridView
22-
//"Build -ModuleName Microsoft.PowerShell.GraphicalTools",
23-
// Build only Out-ConsoleGridView
24-
"Build -ModuleName Microsoft.PowerShell.ConsoleGuiTools",
11+
"Build",
12+
"-Module",
13+
"Microsoft.PowerShell.ConsoleGuiTools"
2514
],
26-
"problemMatcher": "$msCompile",
27-
"group": {
28-
"kind": "build",
29-
"isDefault": true
30-
}
15+
"group": "build",
16+
"presentation": {
17+
"reveal": "silent"
18+
},
19+
"problemMatcher": "$msCompile"
3120
}
3221
]
3322
}

Build.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# Build...
77
Invoke-Build Build -ModuleName Microsoft.PowerShell.ConsoleGuiTools
88

9-
# Run what was built...
10-
# pwsh -noprofile -command "Import-Module -verbose '$PSScriptRoot/module/Microsoft.PowerShell.GraphicalTools'; Get-Module -all | Out-GridView -OutputMode Single -Title 'Imported Modules'
11-
pwsh -noprofile -command "Import-Module -verbose '$PSScriptRoot/module/Microsoft.PowerShell.ConsoleGuiTools'; Get-Module -all | Out-ConsoleGridView -OutputMode Single -Title 'Imported Modules' -Filter power"
9+
# Run what was built as a bit of test of:
10+
# - Scale: recursive ls of the project
11+
# - Filter: proving regex works
12+
# - SelectMultiple
13+
pwsh -noprofile -command "Import-Module -verbose '$PSScriptRoot/module/Microsoft.PowerShell.ConsoleGuiTools'; Get-ChildItem -Recurse | Out-ConsoleGridView -OutputMode Multiple -Title 'Imported Modules' -Filter \.xml"

README.md

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ to view and filter objects graphically.
2525

2626
## Development
2727

28-
### 1. Install PowerShell 7.1+
28+
### 1. Install PowerShell 7.2+
2929

30-
Install PowerShell 7.1+ with [these instructions](https://github.com/PowerShell/PowerShell#get-powershell).
30+
Install PowerShell 7.2+ with [these instructions](https://github.com/PowerShell/PowerShell#get-powershell).
3131

3232
### 2. Clone the GitHub repository
3333

@@ -49,16 +49,18 @@ Now you're ready to build the code. You can do so in one of two ways:
4949
PS ./GraphicalTools> Invoke-Build Build -ModuleName Microsoft.PowerShell.ConsoleGuiTools
5050
```
5151

52-
From there you can import the module that you just built for example:
52+
From there you can import the module that you just built for example (start a fresh `pwsh` instance first so you can unload the module with an `exit`; otherwise building again may fail because the `.dll` will be held open):
5353

5454
```powershell
55+
pwsh
5556
Import-Module ./module/Microsoft.PowerShell.ConsoleGuiTools
5657
```
5758

5859
And then run the cmdlet you want to test, for example:
5960

6061
```powershell
6162
Get-Process | Out-ConsoleGridView
63+
exit
6264
```
6365

6466
> NOTE: If you change the code and rebuild the project, you'll need to launch a
@@ -72,29 +74,15 @@ PS ./GraphicalTools> code .
7274

7375
Build by hitting `Ctrl-Shift-B` in VS Code.
7476

75-
To debug:
77+
Set a breakpoint and hit `F5` to start the debugger.
7678

77-
In a PowerShell session in the `./GraphicalTools` directory, run `pwsh` (thus
78-
nesting PowerShell).
79-
80-
Then do the folowing:
79+
Click on the VS Code "TERMINAL" tab and type your command that starts `Out-ConsoleGridView`, e.g.
8180

8281
```powershell
83-
Import-Module ./module/Microsoft.PowerShell.ConsoleGuiTools
84-
$pid
82+
ls | ocgv
8583
```
8684

87-
This will import the latest built DLL and output the process ID you'll need
88-
for debugging. Copy this ID to the clipboard.
89-
90-
In VScode, set your breakpoints, etc. Then hit `F5`. In the VScode search
91-
box, paste the value printed by `$pid`. You'll see something like `pwsh.exe
92-
18328`. Click that and the debug session will start.
93-
94-
In the PowerShell session run your commands; breakpoints will be hit, etc.
95-
96-
When done, run `exit` to exit the nested PowerShell and run `pwsh` again.
97-
This unloads the DLL. Repeat.
85+
Your breakpoint should be hit.
9886

9987
## Contributions Welcome
10088

0 commit comments

Comments
 (0)