Skip to content

Commit

Permalink
disable auth prompting on git 2.3+ - fixes #76
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Feb 6, 2015
1 parent 6178236 commit f43ab97
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pure.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ prompt_pure_setup() {
# if output doesn't end with a newline
export PROMPT_EOL_MARK=''

# disable auth prompting on git 2.3+
export GIT_TERMINAL_PROMPT=0

prompt_opts=(cr subst percent)

zmodload zsh/datetime
Expand Down

9 comments on commit f43ab97

@0xBADDCAFE
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix seems to make side effect in my environment. I can't use git command that requests input like username or password.
env) Mac OS X 10.10.3, git 2.4 (by homebrew), Terminal.app 2.5.3

Last login: Sat May  9 06:55:01 on ttys000

~cd clonetest

~/clonetest master
❯ git --version
git version 2.4.0

~/clonetest master
❯ git push
fatal: could not read Username for 'https://github.com': terminal prompts disabled

And I did comment out export GIT_TERMINAL_PROMPT=0, now works fine.

@sindresorhus
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0xBADDCAFE
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already read it, but seems not to what I mean. I don't want to know how to set GIT_TERMINAL_PROMPT=1 but want how to avoid git's terminal prompts disabled error.

If this problem happens only in my environment, please ignore. Thanks.

@sindresorhus
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting GIT_TERMINAL_PROMPT=1 after initializing pure doesn't fix it?

@0xBADDCAFE
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I see. It fix my problem but cause #76.
I hope that there is a way to solve each problem…

@mafredri
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The simple solution here would be to remove the export and do GIT_TERMINAL_PROMT=0 command git fetch instead.

@0xBADDCAFE
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I try alias git='GIT_TERMINAL_PROMPT=1 command git' and this helps me.
Yeah, it's simple and good solution.

@sindresorhus
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mafredri Can you open an issue? Or even better, a pull request? I want to see this fixed.

@mafredri
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple enough fix, done :)

Please sign in to comment.