Crashes when interacting with file that has "["s or "]"s in the name #1015

Closed
opened 2026-01-29 15:38:37 +00:00 by claunia · 3 comments
Owner

Originally created by @smiRaphi on GitHub (Aug 9, 2025).

Originally assigned to: @claunia on GitHub.

Version

6.0.0-alpha6

Commit hash

89ae5e8

Tested debug version?

  • Yes

Which operating systems have you used?

  • Windows
  • Linux
  • macOS
  • Other

What is the architectural bit size you're using?

  • 32-bit
  • 64-bit
  • Unsure or unknown

What processor are you using?

  • An Intel or AMD
  • An ARM or Apple Silicon
  • Unsure or unknown

Description

Crashes when a filename including square parentheses gets used.

Exact command line used

aaru filesystem list "test [a].do" -d

Expected behavior

Works with these file names.

Actual behavior

Crashes

Output of command execution with debug output enabled

aaru 6.0.0~alpha9+e10c237e
Copyright ╕ 2011-2023 Natalia Portillo


DEBUG (Ls command): --debug=True
DEBUG (Ls command): --encoding=
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.InvalidOperationException: Could not find color or style 'cr'.
   at Spectre.Console.StyleParser.Parse(String text)
   at Spectre.Console.MarkupParser.Parse(String text, Style style)
   at Spectre.Console.AnsiConsoleExtensions.Markup(IAnsiConsole console, String value)
   at Spectre.Console.AnsiConsoleExtensions.Markup(IAnsiConsole console, IFormatProvider provider, String format, Object[] args)
   at Spectre.Console.AnsiConsoleExtensions.MarkupLine(IAnsiConsole console, IFormatProvider provider, String format, Object[] args)
   at Spectre.Console.AnsiConsoleExtensions.MarkupLine(IAnsiConsole console, String format, Object[] args)
   at Aaru.Commands.Filesystem.LsCommand.<>c__DisplayClass1_1.<Invoke>b__2(String format, Object[] objects)
   at Aaru.Console.AaruConsole.DebugWriteLine(String module, String format, Object[] arg)
   at Aaru.Commands.Filesystem.LsCommand.Invoke(Boolean debug, Boolean verbose, String encoding, String imagePath, Boolean longFormat, String namespace, String options)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.InvokeWithManyArguments(RuntimeMethodInfo mi, Int32 argCount, Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at System.CommandLine.NamingConventionBinder.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.NamingConventionBinder.ModelBindingCommandHandler.Invoke(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass19_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__18_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__5_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<<UseExceptionHandler>b__0>d.MoveNext()
Originally created by @smiRaphi on GitHub (Aug 9, 2025). Originally assigned to: @claunia on GitHub. ### Version 6.0.0-alpha6 ### Commit hash 89ae5e8 ### Tested debug version? - [x] Yes ### Which operating systems have you used? - [x] Windows - [ ] Linux - [ ] macOS - [ ] Other ### What is the architectural bit size you're using? - [ ] 32-bit - [x] 64-bit - [ ] Unsure or unknown ### What processor are you using? - [x] An Intel or AMD - [ ] An ARM or Apple Silicon - [ ] Unsure or unknown ### Description Crashes when a filename including square parentheses gets used. ### Exact command line used `aaru filesystem list "test [a].do" -d` ### Expected behavior Works with these file names. ### Actual behavior Crashes ### Output of command execution with debug output enabled ```shell aaru 6.0.0~alpha9+e10c237e Copyright ╕ 2011-2023 Natalia Portillo DEBUG (Ls command): --debug=True DEBUG (Ls command): --encoding= Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Could not find color or style 'cr'. at Spectre.Console.StyleParser.Parse(String text) at Spectre.Console.MarkupParser.Parse(String text, Style style) at Spectre.Console.AnsiConsoleExtensions.Markup(IAnsiConsole console, String value) at Spectre.Console.AnsiConsoleExtensions.Markup(IAnsiConsole console, IFormatProvider provider, String format, Object[] args) at Spectre.Console.AnsiConsoleExtensions.MarkupLine(IAnsiConsole console, IFormatProvider provider, String format, Object[] args) at Spectre.Console.AnsiConsoleExtensions.MarkupLine(IAnsiConsole console, String format, Object[] args) at Aaru.Commands.Filesystem.LsCommand.<>c__DisplayClass1_1.<Invoke>b__2(String format, Object[] objects) at Aaru.Console.AaruConsole.DebugWriteLine(String module, String format, Object[] arg) at Aaru.Commands.Filesystem.LsCommand.Invoke(Boolean debug, Boolean verbose, String encoding, String imagePath, Boolean longFormat, String namespace, String options) at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) --- End of inner exception stack trace --- at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) at System.Reflection.RuntimeMethodInfo.InvokeWithManyArguments(RuntimeMethodInfo mi, Int32 argCount, Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at System.CommandLine.NamingConventionBinder.ModelBindingCommandHandler.InvokeAsync(InvocationContext context) at System.CommandLine.NamingConventionBinder.ModelBindingCommandHandler.Invoke(InvocationContext context) at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseErrorReporting>b__0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseHelp>b__0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass19_0.<<UseTypoCorrections>b__0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__18_0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseDirective>b__0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__5_0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<<UseExceptionHandler>b__0>d.MoveNext() ```
claunia added the bugbeginner labels 2026-01-29 15:38:38 +00:00
Author
Owner

@smiRaphi commented on GitHub (Aug 9, 2025):

Nvm, seems to have something to do with a filename in the filesystem of the image maybe? here's the image:
869.zip

@smiRaphi commented on GitHub (Aug 9, 2025): Nvm, seems to have something to do with a filename in the filesystem of the image maybe? here's the image: [869.zip](https://github.com/user-attachments/files/21698285/869.zip)
Author
Owner

@claunia commented on GitHub (Aug 9, 2025):

If the filename has a bracket right now we're not catching up them, and Spectre.Console it's thinking we're trying to use markup and going crazy.

It's a known issue we just have to go through all the application and trap up console output. PRs should however be easy to do (just "Markup.Escape" console output) and are welcome) and pretty welcome.

@claunia commented on GitHub (Aug 9, 2025): If the filename has a bracket right now we're not catching up them, and Spectre.Console it's thinking we're trying to use markup and going crazy. It's a known issue we just have to go through all the application and trap up console output. PRs should however be easy to do (just "Markup.Escape" console output) and are welcome) and pretty welcome.
Author
Owner
@claunia commented on GitHub (Aug 11, 2025): FIU: https://openproject.claunia.com/projects/aaru/work_packages/540/activity
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: aaru-dps/Aaru-aaru-dps#1015