-
Notifications
You must be signed in to change notification settings - Fork 933
Stop PowerShell from truncating Scoop listing output #5434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Gabriel Dufresne (GabrielDuf)
merged 5 commits into
main
from
fix/scoop-table-truncation
Sep 23, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
34f3a58
Stop PowerShell from truncating Scoop listing output (#5414)
GabrielDuf 3eb1d0f
Read Scoop update rows by column instead of collapsing whitespace
GabrielDuf 75b26ea
Read Scoop bucket rows by column so paths with spaces survive
GabrielDuf e4dedbd
Address the Copilot review on the Scoop bucket parser
GabrielDuf 00c0416
Read Scoop installed rows by column so empty and spaced sources survive
GabrielDuf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/UniGetUI.PackageEngine.Managers.Scoop/Helpers/ScoopTable.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| using System.Text.RegularExpressions; | ||
|
|
||
| namespace UniGetUI.PackageEngine.Managers.ScoopManager | ||
| { | ||
| internal static partial class ScoopTable | ||
| { | ||
| [GeneratedRegex(@"\x1b\[[0-9;]*m")] | ||
| private static partial Regex AnsiSequence(); | ||
|
|
||
| public static string StripAnsiSequences(string line) => | ||
| line.Contains('\x1b') ? AnsiSequence().Replace(line, "") : line; | ||
|
|
||
| public static IReadOnlyList<int>? ReadColumnStarts(string line) | ||
| { | ||
| if (!line.Contains("---")) | ||
| { | ||
| return null; | ||
| } | ||
|
|
||
| List<int> starts = []; | ||
| for (int i = 0; i < line.Length; i++) | ||
| { | ||
| if (line[i] is not '-') | ||
| { | ||
| continue; | ||
| } | ||
|
|
||
| starts.Add(i); | ||
| while (i < line.Length && line[i] is '-') | ||
| { | ||
| i++; | ||
| } | ||
| } | ||
|
|
||
| return starts; | ||
| } | ||
|
|
||
| public static string ReadColumn(string line, IReadOnlyList<int> starts, int index) | ||
| { | ||
| int start = starts[index]; | ||
| if (start >= line.Length) | ||
| { | ||
| return ""; | ||
| } | ||
|
|
||
| int end = | ||
| index + 1 < starts.Count ? Math.Min(starts[index + 1], line.Length) : line.Length; | ||
| return line[start..end].Trim(); | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.