Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Consider supporting color in posh-git prompt?

61 views
Skip to first unread message

David Mohundro

unread,
Mar 15, 2010, 11:01:03 AM3/15/10
to posh-git
Hey guys, thanks for putting this together! I've been using git in
powershell for a while and I've missed the tab completion that bash
supports out of the box.

Any thoughts on adding something like the following to support git
color output?

$env:TERM = 'cygwin'
$env:LESS = 'FRSX'

I blogged about it a few months back at
http://www.mohundro.com/blog/2010/02/04/SomeTipsOnUsingGitWithWindows.aspx.

Mark Embling

unread,
Mar 15, 2010, 11:04:21 AM3/15/10
to posh...@googlegroups.com
In my case, I just have that exact thing inside my profile.ps1. Do you think this ought to be included then? I'd tend to think this is probably separate to the job of supplying prompt/tab expansion and should be handled separately (allowing people to opt in or not according to preference).

Perhaps it would be worth wrapping it in a function, allowing people to just call it from their profiles. Something like Enable-GitColors perhaps? Thoughts?

Keith Dahlby

unread,
Mar 15, 2010, 11:09:29 AM3/15/10
to posh...@googlegroups.com
We should at least include it in the sample profile, which seems like a natural place to document common/suggested settings.

For development purposes, I've just set up my local profile to include the sample profile from my repo. New users will likely just use the sample as their profile, so I'd say it should result in a sensible default PowerShell+Git environment.

Mark Embling

unread,
Mar 15, 2010, 11:22:51 AM3/15/10
to posh...@googlegroups.com
I've put it up wrapped in the function to my fork. Not too sure its in the right place to be honest (it's not prompt-related yet it's not really a util either...). I agree its definitely something which should be included one way or another because it does improve the readability of the output significantly.

David Mohundro

unread,
Mar 15, 2010, 12:12:53 PM3/15/10
to posh-git
Agree it really isn't a prompt responsibility - GitUtils.ps1 probably
makes the most sense.

I could envision a GitEnv.ps1 at some point, but I don't know if there
would be that many other environment type settings. Maybe if there
were also common utility functions for setting up the shell scripts
for diff tools like BeyondCompare or DiffMerge? I could see that
living in a GitEnv.ps1 or a GitSettings.ps1.

On Mar 15, 10:22 am, Mark Embling <cont...@markembling.info> wrote:
> I've put it up wrapped in the function to my fork. Not too sure its in the

> right place to be honest (it's not prompt-related yet it's not really a *
> util* either...). I agree its definitely something which should be included


> one way or another because it does improve the readability of the output
> significantly.
>

> On Mon, Mar 15, 2010 at 15:09, Keith Dahlby <dahl...@gmail.com> wrote:
> > We should at least include it in the sample profile, which seems like a
> > natural place to document common/suggested settings.
>
> > For development purposes, I've just set up my local profile to include the
> > sample profile from my repo. New users will likely just use the sample as
> > their profile, so I'd say it should result in a sensible default
> > PowerShell+Git environment.
>

> > On Mon, Mar 15, 2010 at 10:04 AM, Mark Embling <cont...@markembling.info>wrote:
>
> >> In my case, I just have that exact thing inside my profile.ps1. Do you
> >> think this ought to be included then? I'd tend to think this is probably
> >> separate to the job of supplying prompt/tab expansion and should be handled
> >> separately (allowing people to opt in or not according to preference).
>
> >> Perhaps it would be worth wrapping it in a function, allowing people to
> >> just call it from their profiles. Something like Enable-GitColors perhaps?
> >> Thoughts?
>

> >> On Mon, Mar 15, 2010 at 15:01, David Mohundro <drmohun...@gmail.com>wrote:
>
> >>> Hey guys, thanks for putting this together! I've been using git in
> >>> powershell for a while and I've missed the tab completion that bash
> >>> supports out of the box.
>
> >>> Any thoughts on adding something like the following to support git
> >>> color output?
>
> >>> $env:TERM = 'cygwin'
> >>> $env:LESS = 'FRSX'
>
> >>> I blogged about it a few months back at
>

> >>>http://www.mohundro.com/blog/2010/02/04/SomeTipsOnUsingGitWithWindows...
> >>> .
>
>

Reply all
Reply to author
Forward
0 new messages