Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly display error messages during startup
As reported by John Keeping, 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. The problem is that done_display() and therefore endwin() is called twice when die() is called. First via die_callback (which always points to done_display() once init_display() has been called), and again by the atexit() handler also installed once init_display() has been called. atexit() must be there so that ncurses is "shutdown" when Tig exits due to a signal. The fix therefore checks the "cursed" flag before calling endwin(). Fixes #385
- Loading branch information