Skip to content
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

Closed
wants to merge 1 commit into from

Commits on Feb 25, 2015

  1. Avoid initializing ncurses before parsing options

    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>
    johnkeeping committed Feb 25, 2015
    Configuration menu
    Copy the full SHA
    b28fe28 View commit details
    Browse the repository at this point in the history