Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Shell/Commands/CommandParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

foreach (var cmd in commands)
{
SystemCommands.Add(cmd);

Check warning on line 72 in Shell/Commands/CommandParser.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'item' in 'bool HashSet<string>.Add(string item)'.
var safeCmd = EscapeMarkup(cmd);
//AnsiConsole.MarkupLine($"\t[[[green]+[/]]] Loaded system command: [yellow]{safeCmd}[/]");
}
Expand Down Expand Up @@ -101,7 +101,7 @@
var cmdName = parts[0];
var args = parts.Skip(1).ToArray();

if (cmdName.StartsWith("./") || cmdName.StartsWith("/") || cmdName.Contains("/"))
if (cmdName.StartsWith("./"))
{
try
{
Expand All @@ -111,9 +111,9 @@
{
FileName = "/bin/bash",
Arguments = $"-c \"{commandLine}\"",
RedirectStandardOutput = true,
RedirectStandardError = true,
RedirectStandardInput = true,
RedirectStandardOutput = false,
RedirectStandardError = false,
RedirectStandardInput = false,
UseShellExecute = false,
CreateNoWindow = true
}
Expand All @@ -138,7 +138,7 @@
}
catch (Exception ex)
{
Console.WriteLine($"[[[red]-[/]]] - Error executing file: {ex.Message}");
AnsiConsole.MarkupLine($"[[[red]-[/]]] - Error executing file: {ex.Message}");
return true;
}
}
Expand Down
Loading