-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid initializing ncurses before parsing options #385
Conversation
If called before a view has been set up, report() will call die() which prints to stderr and exits. However, because init_display() is called well before the first view is set, this is likely to result in endwin() being called which will clear the user's terminal meaning that they do not see the message. For example, running "tig blame master" results in: user@host ~/src/tig $ tig blame master user@host ~/src/tig $d options to blame tig 2.0.3 (Dec 20 2014) Usage: tig [options] [revs] [--] [paths] or: tig log [options] [revs] [--] [paths] or: tig show [options] [revs] [--] [paths] or: tig blame [options] [rev] [--] path or: tig grep [options] [pattern] or: tig refs or: tig stash or: tig status or: tig < [git command output] Options: +<number> Select line <number> in the first view -v, --version Show version and exit -h, --help Show help message and exit with the cursor positioned on the second prompt above most of the error output. Signed-off-by: John Keeping <john@keeping.me.uk>
What terminal does this happen with? In any case, I think it would be best to put the lazy initialization code in |
I see the problem with xterm. Do you mean |
Yes, sorry, I meant |
It looks like the problem is that
Note that in order to reproduce this issue I had to test in a fresh terminal; once Tig has run it looks like there is some code that makes the bug go away. |
When you have time could you please give this a try? |
That fixes it for me. Thanks! |
Thanks for testing @johnkeeping |
If called before a view has been set up, report() will call die() which
prints to stderr and exits. However, because init_display() is called
well before the first view is set, this is likely to result in endwin()
being called which will clear the user's terminal meaning that they do
not see the message.
For example, running "tig blame master" results in:
with the cursor positioned on the second prompt above most of the error
output.