Unusual symbols in command outputs

When running MRtrix3 commands on certain terminal emulators, you may see unusual characters / sequences of characters appearing in the terminal output, that look something like the following:

$ mrinfo fa.mif -debug
mrinfo: ←[00;32m[INFO] opening image "fa.mif"...←[0m
mrinfo: ←[00;34m[DEBUG] reading key/value file "fa.mif"...←[0m
mrinfo: ←[01;31m[ERROR] failed to open key/value file "fa.mif": No such file or directory←[0m

MRtrix3 uses ANSI terminal control codes to add colour to the terminal output, and to clear the terminal line of text when updating the text displayed during certain processes (e.g. updating the percentage progress within a progress bar). Some terminal emulators may not have support for these codes, in which case unwanted characters and symbols may instead be displayed.

There are two possible solutions:

  1. Use a different terminal emulator. In particular, earlier instructions for installing MRtrix3 on Windows involved the use of the terminal provided with Git for Windows; this is known to not support ANSI codes. The current recommendation for MRtrix3 Windows installation is based on MSYS2; the ‘MinGW-w64 Win64 Shell’ provided in this installation is known to support ANSI codes.

  2. Terminal colouring can be disabled using the MRtrix configuration file. Set the config file option TerminalColor within either the system-wide or user config file to disable these advanced terminal features:

    TerminalColor: 0

Note that MRtrix3 will attempt to detect the nature of the stream to which its output is being directed (e.g. may be a text file rather than a terminal), and alter both the use of these terminal codes and the appearance of progress bars in order to better suit that target. If however there is a specific use case where this mechanism is not properly engaged, please provide feedback here and we can then investigate.