SlickEdit Community

Archived Beta Discussions => SlickEdit 201x Beta Discussions => SlickEdit 2019 v24 Beta Discussion => Topic started by: guth on August 01, 2019, 10:31:14 am

Title: git colors in build window
Post by: guth 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.
Title: Re: git colors in build window
Post by: Clark 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 (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.
Title: Re: git colors in build window
Post by: guth 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.
Title: Re: git colors in build window
Post by: Dan 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.
Title: Re: git colors in build window
Post by: guth 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
Title: Re: git colors in build window
Post by: b 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).