Output: parse or ignore color sequences in (hook) output

Sync 12 months ago updated by Thomas Singer 12 months ago 4

Add a separate "Output (Terminal Mode)" window that is simply a read-only Git Bash shell to display the output of the last operation. It will not show the history like the original "Output" window does, only the last operation (if the last SmartGit operation is a group of git commands, then just show that group of commands).

Users can either display both windows, or switch between the two, depending on their needs.

Reason:  In the project that I'm working on, it is impossible to read the hook errors in SmartGit.:

I always have to open the shell, which is a pain:

Could you please provide us with a test repository where we can reproduce the problem?


  • https://github.com/lbryio/lbry-desktop/
  • I'm not sure if the hook requires the full installation of the tools.  I think probably not, but see the "Running From Source" on getting set up if needed.  It's just a few tools to install.
    • Install node.js version 10
    • Install Yarn.
    • To replicate the error in the screenshot, remove the "$FlowFixMe" comment in "ui/component/app/view,jsx", and do a regular commit.             

    I found an easier way.  A simple bash script like this in a pre-commit hook would produce the same weird symbols:

    # An example hook script to verify what is about to be committed.
    # Called by "git commit" with no arguments. The hook should
    # exit with non-zero status after issuing an appropriate message if
    # it wants to stop the commit.
    # To enable this hook, rename this file to "pre-commit".

    NC='\033[0m' # No Color
    printf "I ${RED}love${NC} Stack Overflow\n" exit 1

    A bash-like window in SmartGit would produce the required color-coding and would be a bonus.


    Build 16039 (SmartGit 20.2 preview) will remove these ANSI sequences to make the text easier to read.