+1
Completed

Output: ignore color sequences in (hook) output

Sync 4 years ago updated by Marc Strapetz 10 months ago 5

This topic is about ignoring coloring sequences. If you want to see colors, vote for topic #1580.


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.:

Image 533

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

Image 534

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

Sure.

  • 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:

    #!/bin/sh
    #
    # 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".

    RED='\033[0;31m'
    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.

    +1

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