Author Topic: git colors in build window  (Read 4737 times)

guth

  • Senior Community Member
  • Posts: 104
  • Hero Points: 7
git colors in build window
« on: August 01, 2019, 10:31:14 AM »
I do some git commands from within slickedits command window, so I Ctrl-X RET from a buffer and gets the prompt. When I do git status there, the output is not colored. Is it possible to get it colored? I'm on Ubuntu 18.04. If I run git status from an ordinary terminal the output is colored.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6877
  • Hero Points: 530
Re: git colors in build window
« Reply #1 on: August 01, 2019, 11:55:56 AM »
In v24 beta supports the color escapes defined here https://misc.flogisoft.com/bash/tip_colors_and_formatting (TERM=xterm-256-color)

I suspect what's going on is that git will not output the color escapes because it thinks the output is being redirected via a pipe and not being output to a terminal. In order to work around that, you'd have to check if git has an option to force color output.

g++ and clang++ both have options to force color output. For example, "g++ -fdiagnostics-color=always myfile.cpp" or "clang++ -fdiagnostics-color=always myfile.cpp" will display colored error messages in the Build window.

guth

  • Senior Community Member
  • Posts: 104
  • Hero Points: 7
Re: git colors in build window
« Reply #2 on: August 01, 2019, 01:37:12 PM »
stackoverflow taught me that git -c color.ui=always status will give colors when run from within slick.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2899
  • Hero Points: 153
Re: git colors in build window
« Reply #3 on: August 01, 2019, 02:31:00 PM »
Have you tried the git support built into the editor?  It's pretty complete and includes a repository browser.

guth

  • Senior Community Member
  • Posts: 104
  • Hero Points: 7
Re: git colors in build window
« Reply #4 on: August 01, 2019, 02:56:52 PM »
Yes, I have, but staging a complete directory, e.g., the src directory, is quite easy by doing a git add src. If there were a possibility to move files from modified to staged from Browse Repository or from Compare Workspace with git, I would use it more I think. I'm not super much into git, but my workflow involves the following. I guess one can do all these steps with slickedit.

git status  - to see which files have been modified
git diff or git diff --cached - to see changes made to modified or staged files
git add - to stage files before commit
git commit - to commit staged files
git push - to send local commits to git server
git branch - to create a new branch
git checkout - to change to another branch

sometimes I also do

git stash and git stash apply

b

  • Senior Community Member
  • Posts: 325
  • Hero Points: 26
Re: git colors in build window
« Reply #5 on: August 01, 2019, 11:49:17 PM »
I'd second this with the wish of -p support of git {push|add|checkout|commit|stash}   (very addictive git feature).