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

guth

  • Senior Community Member
  • Posts: 102
  • 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: 6064
  • Hero Points: 467
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: 102
  • 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: 2647
  • Hero Points: 141
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: 102
  • 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: 320
  • 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).